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 group by query with having in #6560

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

Sqlitelogictest crash on group by query with having in #6560

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

Comments

@monetdb-team
Copy link

Date: 2018-03-23 13:50:42 +0100
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2019-05-03 10:37:50 +0200

Comment 26278

Date: 2018-03-23 13:50:42 +0100
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:

Just run the query bellow, it gives an assertion error in rel_bin.c.

Reproducible: Always

Steps to Reproduce:

  1. CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER);
  2. INSERT INTO tab1 VALUES(22,6,8), (28,57,45), (82,44,71);
  3. SELECT + - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( col2 / + 15 + + 88 ) IN ( AVG ( col2 ) );

Actual Results:

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

Expected Results:

An empty result set.

Backtrace:

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1 0x00007ffff4781c41 in __GI_abort () at abort.c:79
2 0x00007ffff4778f7a in __assert_fail_base (fmt=0x7ffff48c9260 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fffe84ff378 "s", file=file@entry=0x7fffe84ff308 "rel_bin.c",
line=line@entry=576, function=function@entry=0x7fffe84ffb48 <PRETTY_FUNCTION.18599> "exp_bin") at assert.c:92
3 0x00007ffff4778ff2 in __GI___assert_fail (assertion=0x7fffe84ff378 "s", file=0x7fffe84ff308 "rel_bin.c", line=576, function=0x7fffe84ffb48 <PRETTY_FUNCTION.18599> "exp_bin") at assert.c:101
4 0x00007fffe8385d6e in exp_bin (be=0x7fffb0002b60, e=0x7fffb00f1260, left=0x7fffb00f5780, right=0x7fffb00f67e0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:576
5 0x00007fffe838f063 in rel2bin_project (be=0x7fffb0002b60, rel=0x7fffb00f1370, refs=0x7fffb00f48e0, topn=0x0) at rel_bin.c:2481
6 0x00007fffe839ac4d in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00f1370, refs=0x7fffb00f48e0) at rel_bin.c:5068
7 0x00007fffe838c783 in rel2bin_semijoin (be=0x7fffb0002b60, rel=0x7fffb00f18f0, refs=0x7fffb00f48e0) at rel_bin.c:1939
8 0x00007fffe839ab93 in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00f18f0, refs=0x7fffb00f48e0) at rel_bin.c:5052
9 0x00007fffe838ef90 in rel2bin_project (be=0x7fffb0002b60, rel=0x7fffb00ef560, refs=0x7fffb00f48e0, topn=0x0) at rel_bin.c:2469
10 0x00007fffe839ac4d in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00ef560, refs=0x7fffb00f48e0) at rel_bin.c:5068
11 0x00007fffe838ef90 in rel2bin_project (be=0x7fffb0002b60, rel=0x7fffb00f2320, refs=0x7fffb00f48e0, topn=0x0) at rel_bin.c:2469
12 0x00007fffe839ac4d in subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00f2320, refs=0x7fffb00f48e0) at rel_bin.c:5068
13 0x00007fffe839af35 in _subrel_bin (be=0x7fffb0002b60, rel=0x7fffb00f2320, refs=0x7fffb00f48e0) at rel_bin.c:5130
14 0x00007fffe839b04d in output_rel_bin (be=0x7fffb0002b60, rel=0x7fffb00f2320) at rel_bin.c:5153
15 0x00007fffe83b72c4 in sql_relation2stmt (be=0x7fffb0002b60, r=0x7fffb00f2320) at sql_gencode.c:542
16 0x00007fffe83b74b7 in backend_dumpstmt (be=0x7fffb0002b60, mb=0x7fffb0125a30, r=0x7fffb00f2320, top=1, add_end=1,
query=0x7fffb0110990 "select + - col2 from tab1 as cor0 group by col0, col2 having ( col2 / + 15 + + 88 ) in ( avg ( col2 ) );") at sql_gencode.c:582
17 0x00007fffe83b7d2f in backend_dumpproc (be=0x7fffb0002b60, c=0x7fffe973e368, cq=0x7fffb0116670, r=0x7fffb00f2320) at sql_gencode.c:712
18 0x00007fffe83799d8 in SQLparser (c=0x7fffe973e368) at sql_scenario.c:1233
19 0x00007ffff7a0da85 in runPhase (c=0x7fffe973e368, phase=1) at mal_scenario.c:510
20 0x00007ffff7a0db8e in runScenarioBody (c=0x7fffe973e368, once=0) at mal_scenario.c:532
21 0x00007ffff7a0de47 in runScenario (c=0x7fffe973e368, once=0) at mal_scenario.c:569
22 0x00007ffff7a0fd82 in MSserveClient (dummy=0x7fffe973e368) at mal_session.c:514
23 0x00007ffff7a0f8d1 in MSscheduleClient (command=0x7fffb0000b30 "0", challenge=0x7fffc72dbd9b "xfouFWzfo", fin=0x17ff770, fout=0x7fffc0002d90, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0)
at mal_session.c:397
24 0x00007ffff7ab04d5 in doChallenge (data=0x17ff780) at mal_mapi.c:279
25 0x00007ffff7699479 in thread_starter (arg=0x9c4c10) at gdk_system.c:476
26 0x00007ffff4b0950b in start_thread (arg=0x7fffc72dc700) at pthread_create.c:465
27 0x00007ffff484116f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment 26279

Date: 2018-03-23 13:55:15 +0100
From: MonetDB Mercurial Repository <>

Changeset 288504db76dc 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=288504db76dc

Changeset description:

Added test for bug #6560

Comment 26285

Date: 2018-03-24 13:49:59 +0100
From: MonetDB Mercurial Repository <>

Changeset 60cf89593bf0 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=60cf89593bf0

Changeset description:

fixed bug #6560, ie handle aliases better in groupby

Comment 26309

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

The Mar2018 version has been released.

Comment 26993

Date: 2019-05-03 10:37:50 +0200
From: MonetDB Mercurial Repository <>

Changeset 2ecd89950f47 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=2ecd89950f47

Changeset description:

Adding more sqlite tests failing queries:

Bug #6560 gives right results in Apr2019 branch, but wrong on default.
Bug #6561 we should analyze first, but I think MonetDB outputs wrong results.
Bug #6576 more overflows in calculations.
@monetdb-team monetdb-team added bug Something isn't working minor 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 minor SQL
Projects
None yet
Development

No branches or pull requests

2 participants