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 in aggregation query with a long having clause #6431

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

Comments

@monetdb-team
Copy link

Date: 2017-10-16 17:25:30 +0200
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2017-10-26 14:01:36 +0200

Comment 25745

Date: 2017-10-16 17:25:30 +0200
From: @PedroTadim

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

The server gets an assertion error while compiling an aggregation query with a long having clause.

Reproducible: Always

Steps to Reproduce:

  1. CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER);
  2. SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT ( * ) + ( col0 ) * 12 ) ), + COUNT ( * ), COUNT ( * ) / 97 ) );

Actual Results:

Mserver gets an assertion error on an exp_bin function call.

Expected Results:

An empty result set.

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

Backtrace:

0 0x00007ffff490169b in raise () from /lib64/libc.so.6
1 0x00007ffff49034a0 in abort () from /lib64/libc.so.6
2 0x00007ffff48f9d5a in __assert_fail_base () from /lib64/libc.so.6
3 0x00007ffff48f9dd2 in __assert_fail () from /lib64/libc.so.6
4 0x00007fffe8a42e94 in exp_bin (be=0x7fffb805fc00, e=0x7fffb80756d0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:564
5 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb80796c0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449
6 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079890, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478
7 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb80798f0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449
8 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079f40, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449
9 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079bc0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478
10 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a1c0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478
11 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a250, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478
12 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a2e0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478
13 0x00007fffe8a4c157 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb80783d0, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2465
14 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb80783d0, refs=0x7fffb807f7a0) at rel_bin.c:4834
15 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb8078e40, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453
16 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb8078e40, refs=0x7fffb807f7a0) at rel_bin.c:4834
17 0x00007fffe8a49877 in rel2bin_semijoin (be=0x7fffb805fc00, rel=0x7fffb8078760, refs=0x7fffb807f7a0) at rel_bin.c:1923
18 0x00007fffe8a56e57 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb8078760, refs=0x7fffb807f7a0) at rel_bin.c:4818
19 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb807da90, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453
20 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb807da90, refs=0x7fffb807f7a0) at rel_bin.c:4834
21 0x00007fffe8a4d003 in rel2bin_groupby (be=0x7fffb805fc00, rel=0x7fffb80734e0, refs=0x7fffb807f7a0) at rel_bin.c:2670
22 0x00007fffe8a56f6d in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb80734e0, refs=0x7fffb807f7a0) at rel_bin.c:4842
23 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb807d360, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453
24 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb807d360, refs=0x7fffb807f7a0) at rel_bin.c:4834
25 0x00007fffe8a57208 in output_rel_bin (be=0x7fffb805fc00, rel=0x7fffb807d360) at rel_bin.c:4899
26 0x00007fffe8a72453 in sql_relation2stmt (be=0x7fffb805fc00, r=0x7fffb807d360) at sql_gencode.c:529
27 0x00007fffe8a727d2 in backend_dumpstmt (be=0x7fffb805fc00, mb=0x7fffb84bd760, r=0x7fffb807d360, top=1, add_end=1,
query=0x7fffb80f4540 "select distinct + ( - col2 ) as col0 from tab2 as cor0 where not ( - 1 * col2 ) <> ( 37 ) group by col2 having ( col2 ) in ( coalesce ( + ( + coalesce ( - 64, count ( * ) + ( col0 ) * 12 ) ), + count "...) at sql_gencode.c:576
28 0x00007fffe8a73037 in backend_dumpproc (be=0x7fffb805fc00, c=0x7fffea11d338, cq=0x7fffb82009d0, r=0x7fffb807d360) at sql_gencode.c:703
29 0x00007fffe8a36ee5 in SQLparser (c=0x7fffea11d338) at sql_scenario.c:1182
30 0x00007ffff7a14da0 in runPhase (c=0x7fffea11d338, phase=1) at mal_scenario.c:506
31 0x00007ffff7a14ee4 in runScenarioBody (c=0x7fffea11d338) at mal_scenario.c:539
32 0x00007ffff7a15087 in runScenario (c=0x7fffea11d338) at mal_scenario.c:568
33 0x00007ffff7a16c3c in MSserveClient (dummy=0x7fffea11d338) at mal_session.c:473
34 0x00007ffff7a1672c in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd395deb "ZZqqcD1Mb", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190,
compute_column_widths=0) at mal_session.c:364
35 0x00007ffff7ab9ba6 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273
36 0x00007ffff768fae4 in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485
37 0x00007ffff4ca336d in start_thread () from /lib64/libpthread.so.0
38 0x00007ffff49dbbbf in clone () from /lib64/libc.so.6

Comment 25746

Date: 2017-10-16 17:30:03 +0200
From: MonetDB Mercurial Repository <>

Changeset 788e56f1c467 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=788e56f1c467

Changeset description:

Added test for bug #6431

Comment 25747

Date: 2017-10-17 13:57:13 +0200
From: MonetDB Mercurial Repository <>

Changeset 7d459ebe5c26 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=7d459ebe5c26

Changeset description:

fixed bug #6431

Comment 25749

Date: 2017-10-17 13:58:37 +0200
From: @njnes

fixed, ie the col0 in the having isn't known (ie isn't passed in the alias
list or group by columns)

@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