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

Lateral crash report (sqlsmith) #6314

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

Lateral crash report (sqlsmith) #6314

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

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2017-05-13 19:24:35 +0200
From: @mlkersten
To: SQL devs <>
Version: 11.25.21 (Dec2016-SP4)
CC: @njnes

Last updated: 2017-06-12 15:14:38 +0200

Comment 25316

Date: 2017-05-13 19:24:35 +0200
From: @mlkersten

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0
Build Identifier:

A crash occurred in the query shown below.
Perhaps related to the name resolution in laterals.
Test file added to the testweb.

(gdb) print *sql
$1 = {errstr = '\000' <repeats 8191 times>, sa = 0x1c7d4d0, qc = 0x1afeee0, clientid = 0, scanner = {rs = 0x60e8e0, ws = 0x60a160, log = 0x0, yynext = 0, yylast = 365,
yysval = 846, yyval = 388, yycur = 847, yybak = 10 '\n', as = 0, key = 578, started = 1, mode = LINE_N, schema = 0x1c91a40 "sys", errstr = 0x0}, params = 0x0,
forward = 0x0, vars = 0x1aed420, topvars = 10, sizevars = 32, frame = 1, use_views = 1, args = 0x1b08740, argc = 1, argmax = 32, sym = 0x1c923a0, no_mitosis = 0,
user_id = 3, role_id = 3, last_id = -1, rowcnt = -1, timezone = 0, cache = 100, caching = 100, history = 0, reply_size = -1, sizeheader = 0, debug = 0, emode = 0 '\000',
emod = 0 '\000', session = 0x1b089c0, type = 0, pushdown = 1, label = 10, cascade_action = 0x0, opt_stats = {0, 0, 0, 0, 0, 0, 0, 0}, result_id = 0, results = 0x0}
(gdb) print *rel
$2 = (sql_rel *) 0x1c95680
(gdb) print *column_r
$3 = {token = 47, type = type_list, data = {i_val = 29949856, l_val = 29949856, sval = 0x1c8ffa0 "\300\377\310\001", lval = 0x1c8ffa0, sym = 0x1c8ffa0, typeval = {
type = 0x1c8ffa0, digits = 3183328701, scale = 3183328701}}}

0 0x00007fffee295ede in rel_column_ref (sql=0x1bb8ea0, rel=0x7fffffffc5e0, column_r=0x1c90000, f=2)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:1065
1 0x00007fffee2a56c0 in rel_value_exp2 (sql=0x1bb8ea0, rel=0x7fffffffc5e0, se=0x1c90000, f=2, ek=..., is_last=0x7fffffffc4fc)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4345
2 0x00007fffee2a617d in rel_value_exp (sql=0x1bb8ea0, rel=0x7fffffffc5e0, se=0x1c90000, f=2, ek=...)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4489
3 0x00007fffee2a6262 in column_exp (sql=0x1bb8ea0, rel=0x7fffffffc5e0, column_e=0x1c90090, f=2) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4502
4 0x00007fffee2a64c9 in rel_column_exp (sql=0x1bb8ea0, rel=0x7fffffffc5e0, column_e=0x1c90090, f=2)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4546
5 0x00007fffee2a7090 in rel_select_exp (sql=0x1bb8ea0, rel=0x1c95680, sn=0x1c908a0, ek=...) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4741
6 0x00007fffee2a80f4 in rel_query (sql=0x1bb8ea0, rel=0x0, sq=0x1c908a0, toplevel=1, ek=..., apply=8)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4980
7 0x00007fffee2a99d4 in rel_subquery (sql=0x1bb8ea0, rel=0x0, sq=0x1c908a0, ek=..., apply=8) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5345
8 0x00007fffee292249 in rel_subquery_optname (sql=0x1bb8ea0, rel=0x0, query=0x1c908a0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:259
9 0x00007fffee295664 in table_ref (sql=0x1bb8ea0, rel=0x0, tableref=0x1c908a0, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:937
10 0x00007fffee2a7c84 in rel_query (sql=0x1bb8ea0, rel=0x0, sq=0x1c90e80, toplevel=1, ek=..., apply=8)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4919
11 0x00007fffee2a99d4 in rel_subquery (sql=0x1bb8ea0, rel=0x0, sq=0x1c90e80, ek=..., apply=8) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5345
12 0x00007fffee292249 in rel_subquery_optname (sql=0x1bb8ea0, rel=0x0, query=0x1c90e80) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:259
13 0x00007fffee295664 in table_ref (sql=0x1bb8ea0, rel=0x0, tableref=0x1c90e80, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:937
14 0x00007fffee2a8a9c in rel_joinquery_ (sql=0x1bb8ea0, rel=0x0, tab1=0x1c90e80, natural=0, jointype=jt_inner, tab2=0x1c91100, js=0x1c912f0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5130
15 0x00007fffee2a959e in rel_joinquery (sql=0x1bb8ea0, rel=0x0, q=0x1c913d0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5264
16 0x00007fffee292703 in query_exp_optname (sql=0x1bb8ea0, r=0x0, q=0x1c913d0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339
17 0x00007fffee295686 in table_ref (sql=0x1bb8ea0, rel=0x0, tableref=0x1c913d0, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:939
18 0x00007fffee2a8a9c in rel_joinquery_ (sql=0x1bb8ea0, rel=0x0, tab1=0x1c913d0, natural=0, jointype=jt_inner, tab2=0x1c91e90, js=0x1c920b0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5130
19 0x00007fffee2a959e in rel_joinquery (sql=0x1bb8ea0, rel=0x0, q=0x1c92190) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5264
20 0x00007fffee292703 in query_exp_optname (sql=0x1bb8ea0, r=0x0, q=0x1c92190) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339
21 0x00007fffee295686 in table_ref (sql=0x1bb8ea0, rel=0x0, tableref=0x1c92190, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:939
22 0x00007fffee2a7c84 in rel_query (sql=0x1bb8ea0, rel=0x0, sq=0x1c923a0, toplevel=1, ek=..., apply=8)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:4919
23 0x00007fffee2a99d4 in rel_subquery (sql=0x1bb8ea0, rel=0x0, sq=0x1c923a0, ek=..., apply=8) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5345
24 0x00007fffee2a9ae5 in rel_selects (sql=0x1bb8ea0, s=0x1c923a0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5366
25 0x00007fffee290eb6 in rel_semantic (sql=0x1bb8ea0, s=0x1c923a0) at /export/scratch1/home/mk/default//package/sql/server/rel_semantic.c:211
26 0x00007fffee1d6bc3 in sql_symbol2relation (c=0x1bb8ea0, sym=0x1c923a0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:117

Reproducible: Always

Steps to Reproduce:

select
(select id from sys.schemas) as c0
from
(select subq_0.c3 as c4
from
lateral (select
ref_0.ndim as c3
from
tmp._tables as sample_1
where ((select index_type_id from sys.index_types) is not NULL)
or (true)) as subq_0
where (select n_regionkey from sys.nation) is not NULL) as subq_1
inner join sys.idxs as ref_1
on (subq_1.c2 = ref_1.id )
inner join sys.netcdf_attrs as sample_15
inner join sys.dependency_types as ref_20
on (sample_15.att_name = ref_20.dependency_type_name )
right join sys.privilege_codes as sample_16
on (sample_15.att_type = sample_16.privilege_code_name )
on (ref_1.type = sample_16.privilege_code_id )
where sample_16.privilege_code_id is NULL;

Comment 25321

Date: 2017-05-14 14:33:43 +0200
From: MonetDB Mercurial Repository <>

Changeset f3896bec855d made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=f3896bec855d

Changeset description:

fixed bug #6314, ie recursive lateral

Comment 25325

Date: 2017-05-14 21:56:44 +0200
From: @njnes

fixed in dec016. Also recursive lateral is now handled

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