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 coalesce call #6565

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

Sqlitelogictest crash on complex select query with coalesce call #6565

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-03 16:02:52 +0200
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

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

Comment 26332

Date: 2018-04-03 16:02:52 +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 a SIGSEGV on rel_project2groupby call on rel_select.c.

Reproducible: Always

Steps to Reproduce:

  1. SELECT + NULLIF ( + 67, + + NULLIF ( + + 46, 66 - CASE WHEN 51 IN ( + 91 ) THEN + SUM ( CAST ( NULL AS INTEGER ) ) + - 92 ELSE - ( - 47 ) END ) ) / - CAST ( NULL AS INTEGER ) + + NULLIF ( - COALESCE ( CAST ( - 35 AS INTEGER ), + 6, COUNT ( ALL 28 ) ), 75 + 14 );

Actual Results:

SIGSEGV on rel_project2groupby call on rel_select.c

Expected Results:

A single NULL value

Backtrace:

0 0x00007fffe840ab95 in rel_project2groupby (sql=0x7fffb000a0d0, g=0x7fffb01e3c30) at rel_select.c:187
1 0x00007fffe841beb2 in _rel_aggr (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, distinct=0, s=0x1946150, aname=0x7fffb01e1ab0 "sum", args=0x7fffb01e1c80, f=2) at rel_select.c:3607
2 0x00007fffe841d4d0 in rel_aggr (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1ca0, f=2) at rel_select.c:3812
3 0x00007fffe84211bd in rel_value_exp2 (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1ca0, f=2, ek=..., is_last=0x7fffc72e06cc) at rel_select.c:4663
4 0x00007fffe8421e66 in rel_value_exp (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1ca0, f=2, ek=...) at rel_select.c:4845
5 0x00007fffe841b369 in rel_binop (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1e80, f=2, ek=...) at rel_select.c:3450
6 0x00007fffe8421166 in rel_value_exp2 (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1e80, f=2, ek=..., is_last=0x7fffc72e088c) at rel_select.c:4659
7 0x00007fffe8421e66 in rel_value_exp (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e1e80, f=2, ek=...) at rel_select.c:4845
8 0x00007fffe841d9ee in rel_case (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, token=46, opt_cond=0x0, when_search_list=0x7fffb01e1f20, opt_else=0x7fffb01e2000, f=2) at rel_select.c:3863
9 0x00007fffe841e3fe in rel_case_exp (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e2080, f=2) at rel_select.c:3983
10 0x00007fffe8421d63 in rel_value_exp2 (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e2080, f=2, ek=..., is_last=0x7fffc72e0b7c) at rel_select.c:4819
11 0x00007fffe8421e66 in rel_value_exp (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e2080, f=2, ek=...) at rel_select.c:4845
12 0x00007fffe841b3ac in rel_binop (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e21a0, f=2, ek=...) at rel_select.c:3451
13 0x00007fffe8421166 in rel_value_exp2 (sql=0x7fffb000a0d0, rel=0x7fffc72e1780, se=0x7fffb01e21a0, f=2, ek=..., is_last=0x7fffc72e0d3c) at rel_select.c:4659
...

Comment 26334

Date: 2018-04-03 16:36:56 +0200
From: MonetDB Mercurial Repository <>

Changeset 549d90c8aba5 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=549d90c8aba5

Changeset description:

Added tests for bugs 6565 and 6566

Comment 26336

Date: 2018-04-04 13:44:59 +0200
From: MonetDB Mercurial Repository <>

Changeset 52858676c04b 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=52858676c04b

Changeset description:

fxes for bugs 6565 and 6565
6565 make sure we handle just created projections in the project2groupby
6566 when rewriting a function with a 'NULL' argument into NULL, cast it into the right type
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