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

Sqlitelogictest crash on complex select query with case statement #6573

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Sqlitelogictest crash on complex select query with case statement #6573

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2018-04-09 10:45:04 +0200
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2018-06-20 11:02:16 +0200

Comment 26352

Date: 2018-04-09 10:45:04 +0200
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Build Identifier:

Run the query bellow for an assertion error.

Reproducible: Always

Steps to Reproduce:

  1. SELECT - ( 5 ) AS col1, + CASE WHEN NOT - 43 NOT IN ( + + 33 * 65, - 31 ) THEN NULL WHEN ( + ( - 41 ) ) IN ( 73 * CASE + + 33 WHEN - 25 THEN - CAST ( NULL AS INTEGER ) ELSE NULL END ) THEN 64 WHEN NOT ( + CAST ( + CASE + 52 WHEN COUNT ( * ) THEN NULL WHEN 51 THEN - 68 ELSE NULL END AS INTEGER ) ) = 50 THEN NULL END * 11 + NULLIF ( ( - 3 ) + 51, 32 ) AS col1;

Actual Results:

Assertion error in mserver5: rel_bin.c:576: exp_bin: Assertion `s' failed.

Expected Results:

A single result set row with values -5, NULL

Backtrace:

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1 0x00007ffff4782c41 in __GI_abort () at abort.c:79
2 0x00007ffff4779f7a in __assert_fail_base (fmt=0x7ffff48ca260 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fffe84fe738 "s", file=file@entry=0x7fffe84fe6c8 "rel_bin.c",
line=line@entry=576, function=function@entry=0x7fffe84fef08 <PRETTY_FUNCTION.18603> "exp_bin") at assert.c:92
3 0x00007ffff4779ff2 in __GI___assert_fail (assertion=0x7fffe84fe738 "s", file=0x7fffe84fe6c8 "rel_bin.c", line=576, function=0x7fffe84fef08 <PRETTY_FUNCTION.18603> "exp_bin") at assert.c:101
4 0x00007fffe8384d0e in exp_bin (be=0x7fffb0002b60, e=0x7fffb00f0c30, left=0x7fffb010c470, right=0x7fffb010c660, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:576
5 0x00007fffe83841a2 in exp_bin (be=0x7fffb0002b60, e=0x7fffb00fb480, left=0x7fffb010c470, right=0x7fffb010c660, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:450
6 0x00007fffe838e003 in rel2bin_project (be=0x7fffb0002b60, rel=0x7fffb00f47f0, refs=0x7fffb010be40, topn=0x0) at rel_bin.c:2481
7 0x00007fffe8399bed in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00f47f0, refs=0x7fffb010be40) at rel_bin.c:5068
8 0x00007fffe838df30 in rel2bin_project (be=0x7fffb0002b60, rel=0x7fffb00fb030, refs=0x7fffb010be40, topn=0x0) at rel_bin.c:2469
9 0x00007fffe8399bed in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00fb030, refs=0x7fffb010be40) at rel_bin.c:5068
10 0x00007fffe8399ed5 in _subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00fb030, refs=0x7fffb010be40) at rel_bin.c:5130
11 0x00007fffe8399fed in output_rel_bin (be=0x7fffb0002b60, rel=0x7fffb00fb030) at rel_bin.c:5153
12 0x00007fffe83b6384 in sql_relation2stmt (be=0x7fffb0002b60, r=0x7fffb00fb030) at sql_gencode.c:542
13 0x00007fffe83b6577 in backend_dumpstmt (be=0x7fffb0002b60, mb=0x7fffb0125ac0, r=0x7fffb00fb030, top=1, add_end=1,
query=0x7fffb010fa80 "select - ( 5 ) as col1, + case when not - 43 not in ( + + 33 * 65, - 31 ) then null when ( + ( - 41 ) ) in ( 73 * case + + 33 when - 25 then - cast ( null as integer ) else null end ) then 64 when not"...) at sql_gencode.c:582
14 0x00007fffe83b6def in backend_dumpproc (be=0x7fffb0002b60, c=0x7fffe973d368, cq=0x7fffb01158a0, r=0x7fffb00fb030) at sql_gencode.c:712
15 0x00007fffe8378978 in SQLparser (c=0x7fffe973d368) at sql_scenario.c:1233
16 0x00007ffff7a0f378 in runPhase (c=0x7fffe973d368, phase=1) at mal_scenario.c:510
17 0x00007ffff7a0f481 in runScenarioBody (c=0x7fffe973d368, once=0) at mal_scenario.c:532
18 0x00007ffff7a0f73a in runScenario (c=0x7fffe973d368, once=0) at mal_scenario.c:569
19 0x00007ffff7a11666 in MSserveClient (dummy=0x7fffe973d368) at mal_session.c:519
20 0x00007ffff7a11161 in MSscheduleClient (command=0x7fffb0000b30 "\360\030", challenge=0x7fffc72e1d9b "8HgaRnl3at5", fin=0x17ff660, fout=0x7fffc0002d90, protocol=PROTOCOL_9, blocksize=8190,
compute_column_widths=0) at mal_session.c:397
21 0x00007ffff7ab22c8 in doChallenge (data=0x17ff670) at mal_mapi.c:279
22 0x00007ffff769936e in thread_starter (arg=0x9c4bc0) at gdk_system.c:476
23 0x00007ffff4b0a50b in start_thread (arg=0x7fffc72e2700) at pthread_create.c:465
24 0x00007ffff484216f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment 26354

Date: 2018-04-09 10:46:30 +0200
From: MonetDB Mercurial Repository <>

Changeset 799859bfffd7 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=799859bfffd7

Changeset description:

Added tests for bugs 6572 and 6573

Comment 26357

Date: 2018-04-11 16:20:14 +0200
From: MonetDB Mercurial Repository <>

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

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=885e050fdec6

Changeset description:

fixes for bugs 6572, 6573 and 6574
also fix select -2*50 cast problem, fix type of function in rewriter.

6572/6574 fixed in dead code optimizer

6573 fixed problem in 'IN' handling with constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant