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 #6552

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

Sqlitelogictest crash on complex case statement #6552

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-12 10:11:24 +0100
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

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

Comment 26251

Date: 2018-03-12 10:11:24 +0100
From: @PedroTadim

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

Just run the query bellow.

Reproducible: Always

Steps to Reproduce:

  1. SELECT CASE WHEN + - 44 <> 44 * - - 17 + 30 AND NOT NULL IS NOT NULL THEN COUNT ( * ) WHEN NULL NOT IN ( COUNT ( DISTINCT + 86 ) * - COUNT ( * ) ) THEN + 53 ELSE ( 66 ) * - CAST ( NULL AS INTEGER ) + 10 END;

Actual Results:

SIGSEV in rel_select.c:2170 for dereferencing a NULL pointer.

Expected Results:

1

Backtrace:

0 0x00007fffe83dfc90 in rel_logical_value_exp (sql=0x7fffb400a080, rel=0x7fffcb388780, sc=0x7fffb41e30e0, f=2) at rel_select.c:2170
1 0x00007fffe83e9c23 in rel_case (sql=0x7fffb400a080, rel=0x7fffcb388780, token=46, opt_cond=0x0, when_search_list=0x7fffb41e2aa0, opt_else=0x7fffb41e3820, f=2) at rel_select.c:3891
2 0x00007fffe83ea312 in rel_case_exp (sql=0x7fffb400a080, rel=0x7fffcb388780, se=0x7fffb41e38a0, f=2) at rel_select.c:3974
3 0x00007fffe83edc6f in rel_value_exp2 (sql=0x7fffb400a080, rel=0x7fffcb388780, se=0x7fffb41e38a0, f=2, ek=..., is_last=0x7fffcb38869c) at rel_select.c:4810
4 0x00007fffe83edd72 in rel_value_exp (sql=0x7fffb400a080, rel=0x7fffcb388780, se=0x7fffb41e38a0, f=2, ek=...) at rel_select.c:4836
5 0x00007fffe83ede71 in column_exp (sql=0x7fffb400a080, rel=0x7fffcb388780, column_e=0x7fffb41e3920, f=2) at rel_select.c:4849
6 0x00007fffe83ee0d8 in rel_column_exp (sql=0x7fffb400a080, rel=0x7fffcb388780, column_e=0x7fffb41e3920, f=2) at rel_select.c:4893
7 0x00007fffe83ee254 in rel_simple_select (sql=0x7fffb400a080, rel=0x7fffb41e3b10, where=0x0, selection=0x7fffb41e3940, distinct=0) at rel_select.c:4922
8 0x00007fffe83efe37 in rel_query (sql=0x7fffb400a080, rel=0x0, sq=0x7fffb41e3a20, toplevel=1, ek=..., apply=8) at rel_select.c:5337
9 0x00007fffe83f182b in rel_subquery (sql=0x7fffb400a080, rel=0x0, sq=0x7fffb41e3a20, ek=..., apply=8) at rel_select.c:5716
10 0x00007fffe83f1952 in rel_selects (sql=0x7fffb400a080, s=0x7fffb41e3a20) at rel_select.c:5737
11 0x00007fffe83d5f2e in rel_semantic (sql=0x7fffb400a080, s=0x7fffb41e3a20) at rel_semantic.c:231
12 0x00007fffe831ed0a in sql_symbol2relation (c=0x7fffb400a080, sym=0x7fffb41e3a20) at sql.c:118
13 0x00007fffe833ff99 in SQLparser (c=0x7fffe9709368) at sql_scenario.c:1171
14 0x00007ffff7a0c09f in runPhase (c=0x7fffe9709368, phase=1) at mal_scenario.c:510
15 0x00007ffff7a0c1a8 in runScenarioBody (c=0x7fffe9709368, once=0) at mal_scenario.c:532
16 0x00007ffff7a0c461 in runScenario (c=0x7fffe9709368, once=0) at mal_scenario.c:569
17 0x00007ffff7a0e39c in MSserveClient (dummy=0x7fffe9709368) at mal_session.c:514
18 0x00007ffff7a0deeb in MSscheduleClient (command=0x7fffb4000b30 "\260<", challenge=0x7fffcb388d9b "9IUXRjfyi", fin=0x17df890, fout=0x7fffc4002d90, protocol=PROTOCOL_9, blocksize=8190,
compute_column_widths=0) at mal_session.c:397
19 0x00007ffff7aaeaef in doChallenge (data=0x17df8a0) at mal_mapi.c:279
20 0x00007ffff7692f06 in thread_starter (arg=0x7fffc4004e80) at gdk_system.c:476
21 0x00007ffff4af661b in start_thread (arg=0x7fffcb389700) at pthread_create.c:465
22 0x00007ffff4823c2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment 26253

Date: 2018-03-12 10:35:15 +0100
From: MonetDB Mercurial Repository <>

Changeset 5100acc0528d 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=5100acc0528d

Changeset description:

Added tests for bugs 6552 and 6553

Comment 26256

Date: 2018-03-14 10:03:51 +0100
From: MonetDB Mercurial Repository <>

Changeset 8c9f8c70fb25 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=8c9f8c70fb25

Changeset description:

fixed bugs 6552 and 6553, by more defensive code

Comment 26259

Date: 2018-03-14 10:05:01 +0100
From: @njnes

fixed crash

Comment 26313

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

The Mar2018 version has been released.

@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