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

Another assertion error in rel_or (sqlsmith) #6422

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

Another assertion error in rel_or (sqlsmith) #6422

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


Copy link

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

Date: 2017-10-14 23:48:50 +0200
From: @mlkersten
To: SQL devs <>
Version: 11.27.5 (Jul2017-SP1)
CC: @njnes

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

Comment 25714

Date: 2017-10-14 23:48:50 +0200
From: @mlkersten

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

On the mergedb example and sf1

0 0x00007f3d40aea69b in raise () from /lib64/
1 0x00007f3d40aec4a0 in abort () from /lib64/
2 0x00007f3d40ae2d5a in _assert_fail_base () from /lib64/
3 0x00007f3d40ae2dd2 in assert_fail () from /lib64/
4 0x00007f3d3b5db407 in rel_or (sql=0x7f3cfc0da2c0, rel=0x0, l=0x7f3cfc84a5d0, r=0x7f3cfc84aba0, oexps=0x0, lexps=0x7f3cfc84a6a0, rexps=0x0)
at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:1152
5 0x00007f3d3b5ad933 in rel_logical_exp (sql=0x7f3cfc0da2c0, rel=0x0, sc=0x7f3cfc8493c0, f=1)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:2377
6 0x00007f3d3b5bbd7d in rel_joinquery
(sql=0x7f3cfc0da2c0, rel=0x7f3cfc84a5d0, tab1=0x7f3cfc848890, natural=0, jointype=jt_right,
tab2=0x7f3cfc848a20, js=0x7f3cfc8493c0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5330
7 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc8494a0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422
8 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc8494a0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339
9 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc8494a0, lateral=0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941
10 0x00007f3d3b5bbb10 in rel_joinquery
(sql=0x7f3cfc0da2c0, rel=0x0, tab1=0x7f3cfc8486f0, natural=0, jointype=jt_right, tab2=0x7f3cfc8494a0,
js=0x7f3cfc849580) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5299
11 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc849660)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422
12 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc849660)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339
13 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc849660, lateral=0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941
14 0x00007f3d3b5bb9d2 in rel_joinquery
(sql=0x7f3cfc0da2c0, rel=0x0, tab1=0x7f3cfc849660, natural=0, jointype=jt_left, tab2=0x7f3cfc849810,
js=0x7f3cfc849a00) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5288
15 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc849ae0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422
16 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc849ae0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339
17 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc849ae0, lateral=0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941
18 0x00007f3d3b5bab65 in rel_query (sql=0x7f3cfc0da2c0, rel=0x0, sq=0x7f3cfc849ce0, toplevel=1, ek=..., apply=8)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5065
19 0x00007f3d3b5bc90a in rel_subquery (sql=0x7f3cfc0da2c0, rel=0x0, sq=0x7f3cfc849ce0, ek=..., apply=8)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5503
20 0x00007f3d3b5bca31 in rel_selects (sql=0x7f3cfc0da2c0, s=0x7f3cfc849ce0)
at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5524
21 0x00007f3d3b5a2786 in rel_semantic (sql=0x7f3cfc0da2c0, s=0x7f3cfc849ce0)
at /export/scratch1/home/mk/default//package/sql/server/rel_semantic.c:225
22 0x00007f3d3b4e3b09 in sql_symbol2relation (c=0x7f3cfc0da2c0, sym=0x7f3cfc849ce0)
at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:117
23 0x00007f3d3b50296c in SQLparser

Reproducible: Always

Steps to Reproduce:

sample_5.keyword as c0
sys.keywords as sample_5
right join sys.dependency_types as sample_6
right join sys.privileges as sample_7
on ((4 is not NULL)
or (EXISTS (
sample_8.table_type_name as c0,
sample_8.table_type_id as c1,
63 as c2
sys.table_types as sample_8
where sample_8.table_type_id is not NULL)))
on (sample_7.obj_id is NULL)
left join tmp.keys as sample_9
on (sample_5.keyword = )
where sample_5.keyword is not NULL;

Comment 25718

Date: 2017-10-15 11:12:19 +0200
From: MonetDB Mercurial Repository <>

Changeset e13088976d30 made by Niels Nes in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e13088976d30

Changeset description:

fix crash/assert of Bug #6422 (make sure we only remove the wrapping select if the
innner part matches).

Comment 25719

Date: 2017-10-15 11:12:59 +0200
From: @njnes

fixed, we only remove the wrapping selects (and merge the or-ed expression lists), when the innner relations are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant