Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a table from a complex query crashes mserver or triggers assertion #3921

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2016-02-11 15:27:28 +0100
From: @hannesmuehleisen
To: SQL devs <>
Version: 11.19.3 (Oct2014)
CC: ajdamico, @njnes

Last updated: 2016-03-25 09:59:32 +0100

Comment 21778

Date: 2016-02-11 15:27:28 +0100
From: @hannesmuehleisen

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36
Build Identifier:

Running these queries produces a crash.

create table ep (pde_id clob, bene_id clob, srvc_dt clob, prod_srvc_id clob, plan_cntrct_rec_id clob, plan_pbp_rec_num clob, qty_dspnsd_num double, days_suply_num double, drug_cvrg_stus_cd clob, ctstrphc_cvrg_cd clob, ptnt_pay_amt double, othr_troop_amt double, lics_amt double, plro_amt double, cvrd_d_plan_pd_amt double, ncvrd_plan_pd_amt double, tot_rx_cst_amt double, benefit_phase clob, ccw_pharmacy_id double, ccw_prscrbr_id double, pde_prscrbr_id_frmt_cd clob, formulary_id clob, frmlry_rx_id clob, rptd_gap_dscnt_num double, brnd_gnrc_cd clob, rx_c_cov double, rx_c_lics double, rx_c_tpc double, rx_c_tdc double, rx_c_oop double, rx_c_gdc double, rx_e_cov double, rx_e_lics double, rx_e_tpc double, rx_e_tdc double, rx_e_oop double, rx_e_gdc double, rx_o_cov double, rx_o_lics double, rx_o_tpc double, rx_o_tdc double, rx_o_oop double, rx_o_gdc double, rx_ce_cov double, rx_ce_lics double, rx_ce_tpc double, rx_ce_tdc double, rx_ce_oop double, rx_ce_gdc double, rx_co_cov double, rx_co_lics double, rx_co_tpc double, rx_co_tdc double, rx_co_oop double, rx_co_gdc double, rx_eo_cov double, rx_eo_lics double, rx_eo_tpc double, rx_eo_tdc double, rx_eo_oop double, rx_eo_gdc double, rx_ceo_cov double, rx_ceo_lics double, rx_ceo_tpc double, rx_ceo_tdc double, rx_ceo_oop double, rx_ceo_gdc double);

create table aep13 as select bene_id ,CAST( COUNT( DISTINCT CASE WHEN drug_cvrg_stus_cd IN ('c') THEN ccw_prscrbr_id END ) AS DOUBLE ) as rx_c_pre,CAST( COUNT( DISTINCT CASE WHEN drug_cvrg_stus_cd IN ('c') THEN ccw_pharmacy_id END ) AS DOUBLE ) as rx_c_pha from ep group by bene_id WITH DATA;

Assertion: >Assertion failed: (cname), function exp_column, file rel_exp.c, line 464.

Stack trace:

frame 0: 0x00007fff95b26002 libsystem_kernel.dylib__pthread_kill + 10 frame 1: 0x00007fff9aed75c5 libsystem_pthread.dylibpthread_kill + 90
frame 2: 0x00007fff901026e7 libsystem_c.dylibabort + 129 frame 3: 0x00007fff900c9df8 libsystem_c.dylib__assert_rtn + 321
frame 4: 0x0000000104d8bc8d lib_sql.soexp_column(sa=0x0000000104740e20, rname=0x0000000000000000, cname=0x0000000000000000, t=0x0000000102137590, card=3, has_nils=1, intern=0) + 141 at rel_exp.c:464 frame 5: 0x0000000104db9f86 lib_sql.sorel_groupby_distinct2(changes=0x0000700000809794, sql=0x000000010205e210, rel=0x00000001021360b0) + 1126 at rel_optimizer.c:4583
frame 6: 0x0000000104da7ed1 lib_sql.sorel_groupby_distinct(changes=0x0000700000809794, sql=0x000000010205e210, rel=0x00000001021360b0) + 481 at rel_optimizer.c:4643 frame 7: 0x0000000104d9a1ee lib_sql.sorewrite(sql=0x000000010205e210, rel=0x00000001021360b0, rewriter=(lib_sql.sorel_groupby_distinct at rel_optimizer.c:4620), has_changes=0x00007000008098ac) + 430 at rel_optimizer.c:7678 frame 8: 0x0000000104d9a128 lib_sql.sorewrite(sql=0x000000010205e210, rel=0x0000000102136250, rewriter=(lib_sql.sorel_groupby_distinct at rel_optimizer.c:4620), has_changes=0x00007000008098ac) + 232 at rel_optimizer.c:7664 frame 9: 0x0000000104d9a1d4 lib_sql.sorewrite(sql=0x000000010205e210, rel=0x0000000102139eb0, rewriter=(lib_sql.sorel_groupby_distinct at rel_optimizer.c:4620), has_changes=0x00007000008098ac) + 404 at rel_optimizer.c:7675 frame 10: 0x0000000104d984c4 lib_sql.so_rel_optimizer(sql=0x000000010205e210, rel=0x0000000102139eb0, level=0) + 1524 at rel_optimizer.c:7848
frame 11: 0x0000000104d97e9d lib_sql.sorel_optimizer(sql=0x000000010205e210, rel=0x0000000102139eb0) + 45 at rel_optimizer.c:7909 frame 12: 0x0000000104c56185 lib_sql.sosql_symbol2relation(c=0x000000010205e210, sym=0x0000000102132c10) + 101 at sql.c:118
frame 13: 0x0000000104c842d5 lib_sql.soSQLparser(c=0x0000000103006340) + 3477 at sql_scenario.c:1189 frame 14: 0x0000000100069a70 libmonetdb5.19.dylibrunPhase(c=0x0000000103006340, phase=1) + 112 at mal_scenario.c:531
frame 15: 0x00000001000696e5 libmonetdb5.19.dylibrunScenarioBody(c=0x0000000103006340) + 485 at mal_scenario.c:567 frame 16: 0x000000010006947b libmonetdb5.19.dylibrunScenario(c=0x0000000103006340) + 91 at mal_scenario.c:595
frame 17: 0x000000010006b72e libmonetdb5.19.dylib`MSserveClient(dummy=0x0000000103006340) + 494 at mal_session.c:445

Reproducible: Always

Comment 21779

Date: 2016-02-11 15:33:39 +0100
From: MonetDB Mercurial Repository <>

Changeset c9829154dcbb made by Hannes Muehleisen hannes@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=c9829154dcbb

Changeset description:

Test for Bug #3921

Comment 21781

Date: 2016-02-11 16:18:16 +0100
From: @hannesmuehleisen

This was naturally found by our resident bug-bloodhound A.D.

Comment 21788

Date: 2016-02-13 13:34:23 +0100
From: MonetDB Mercurial Repository <>

Changeset 3f7b5a1465d3 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=3f7b5a1465d3

Changeset description:

fixed bug #3920 and 3921, make sure we name aggregation expressions
properly.

Comment 21789

Date: 2016-02-13 19:11:48 +0100
From: @njnes

fixed by adding names.

Comment 21969

Date: 2016-03-25 09:59:32 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants