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 CASE statement #6550

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

Sqlitelogictest crash on complex CASE statement #6550

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

Comments

@monetdb-team
Copy link

Date: 2018-03-05 10:39:42 +0100
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2018-03-29 15:39:14 +0200

Comment 26241

Date: 2018-03-05 10:39:42 +0100
From: @PedroTadim

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

Mserver gets an assertion error while compiling the query bellow.

Reproducible: Always

Steps to Reproduce:

  1. SELECT ALL CASE WHEN NOT NULL NOT IN ( - COALESCE ( + - CAST ( + 45 AS INTEGER ), - 66, - 9 * COALESCE ( 80, NULLIF ( - 12, + + ( + 26 ) + - - MAX ( 18 ) + 66 + 98 ) + + + AVG ( ALL 35 ), - - 55 - - - 67, + 42 ) ), + COUNT ( * ) * - + 23, + 66 * + 93 + - ( - 61 ) + + 10 * + 92 * + - 40 * - 47 / 29, COUNT ( * ) * 30 / 28 + 73 ) THEN COUNT ( * ) / - - 86 ELSE NULL END - - 66;

Actual Results:

Assertion error on rel_bin.c

Expected Results:

A single result set with NULL

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

Backtrace:
0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1 0x00007ffff4744381 in __GI_abort () at abort.c:79
2 0x00007ffff473a8fa in __assert_fail_base (fmt=0x7ffff48b5c28 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fffe84c77f8 "s", file=file@entry=0x7fffe84c7788 "rel_bin.c",
line=line@entry=576, function=function@entry=0x7fffe84c7fc8 <PRETTY_FUNCTION.18611> "exp_bin") at assert.c:92
3 0x00007ffff473a972 in __GI___assert_fail (assertion=0x7fffe84c77f8 "s", file=0x7fffe84c7788 "rel_bin.c", line=576, function=0x7fffe84c7fc8 <PRETTY_FUNCTION.18611> "exp_bin") at assert.c:101
4 0x00007fffe834b531 in exp_bin (be=0x7fffb4002b60, e=0x7fffb420d030, left=0x7fffb4260330, right=0x7fffb4260460, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:576
5 0x00007fffe834abe8 in exp_bin (be=0x7fffb4002b60, e=0x7fffb42499d0, left=0x7fffb4260330, right=0x7fffb4260460, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:479
6 0x00007fffe834a9c5 in exp_bin (be=0x7fffb4002b60, e=0x7fffb4249a50, left=0x7fffb4260330, right=0x7fffb4260460, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:450
7 0x00007fffe8354826 in rel2bin_project (be=0x7fffb4002b60, rel=0x7fffb4201d20, refs=0x7fffb4259ab0, topn=0x0) at rel_bin.c:2481
8 0x00007fffe83603f8 in subrel_bin (be=0x7fffb4002b60, rel=0x7fffb4201d20, refs=0x7fffb4259ab0) at rel_bin.c:5056
9 0x00007fffe8354753 in rel2bin_project (be=0x7fffb4002b60, rel=0x7fffb4248d20, refs=0x7fffb4259ab0, topn=0x0) at rel_bin.c:2469
10 0x00007fffe83603f8 in subrel_bin (be=0x7fffb4002b60, rel=0x7fffb4248d20, refs=0x7fffb4259ab0) at rel_bin.c:5056
11 0x00007fffe83606e0 in _subrel_bin (be=0x7fffb4002b60, rel=0x7fffb4248d20, refs=0x7fffb4259ab0) at rel_bin.c:5118
12 0x00007fffe83607f8 in output_rel_bin (be=0x7fffb4002b60, rel=0x7fffb4248d20) at rel_bin.c:5141
13 0x00007fffe837d189 in sql_relation2stmt (be=0x7fffb4002b60, r=0x7fffb4248d20) at sql_gencode.c:532
14 0x00007fffe837d37c in backend_dumpstmt (be=0x7fffb4002b60, mb=0x7fffb4210bf0, r=0x7fffb4248d20, top=1, add_end=1,
query=0x7fffb420f490 "select all case when not null not in ( - coalesce ( + - cast ( + 45 as integer ), - 66, - 9 * coalesce ( 80, nullif ( - 12, + + ( + 26 ) + - - max ( 18 ) + 66 + 98 ) + + + avg ( all 35 ), - - 55 - - -"...) at sql_gencode.c:572
15 0x00007fffe837dbf4 in backend_dumpproc (be=0x7fffb4002b60, c=0x7fffe9708368, cq=0x7fffb42153d0, r=0x7fffb4248d20) at sql_gencode.c:702
16 0x00007fffe833efb6 in SQLparser (c=0x7fffe9708368) at sql_scenario.c:1233
17 0x00007ffff7a0b07f in runPhase (c=0x7fffe9708368, phase=1) at mal_scenario.c:510
18 0x00007ffff7a0b188 in runScenarioBody (c=0x7fffe9708368, once=0) at mal_scenario.c:532
19 0x00007ffff7a0b441 in runScenario (c=0x7fffe9708368, once=0) at mal_scenario.c:569
20 0x00007ffff7a0d37c in MSserveClient (dummy=0x7fffe9708368) at mal_session.c:514
21 0x00007ffff7a0cecb in MSscheduleClient (command=0x7fffb4000b30 "0+", challenge=0x7fffcae5bd9b "aTVCQTWqy", fin=0x7fffc4000ca0, fout=0x7fffc4002d90, protocol=PROTOCOL_9, blocksize=8190,
compute_column_widths=0) at mal_session.c:397
22 0x00007ffff7aadc14 in doChallenge (data=0x7fffc4000cb0) at mal_mapi.c:290
23 0x00007ffff7691f06 in thread_starter (arg=0x7fffc4000ce0) at gdk_system.c:476
24 0x00007ffff4af561b in start_thread (arg=0x7fffcae5c700) at pthread_create.c:465
25 0x00007ffff482298f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment 26243

Date: 2018-03-05 11:05:10 +0100
From: MonetDB Mercurial Repository <>

Changeset 7582f0753563 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=7582f0753563

Changeset description:

Added tests for bugs 6550 and 6551

Comment 26249

Date: 2018-03-11 18:54:40 +0100
From: MonetDB Mercurial Repository <>

Changeset 81dd28eef303 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=81dd28eef303

Changeset description:

fixed bug #6550

Comment 26250

Date: 2018-03-11 21:32:41 +0100
From: @njnes

fixed complicated combination of in, case and aggregation.

Comment 26311

Date: 2018-03-29 15:39:14 +0200
From: @sjoerdmullender

The Mar2018 version 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