Changeset: cfa035d658b6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfa035d658b6 Added Files: sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.out sql/test/mergetables/Tests/sqlsmith.Bug-6426.sql sql/test/mergetables/Tests/sqlsmith.Bug-6426.stable.err sql/test/mergetables/Tests/sqlsmith.Bug-6426.stable.out Modified Files: sql/backends/monet5/rel_bin.c sql/server/rel_optimizer.c sql/test/BugTracker-2017/Tests/All sql/test/mergetables/Tests/All Branch: Jul2017 Log Message:
fixed bugs 6424, 6425 and 6426 diffs (truncated from 416 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -1738,10 +1738,7 @@ rel2bin_join(backend *be, sql_rel *rel, /* only handle simple joins here */ if ((exp_has_func(e) && get_cmp(e) != cmp_filter) || - (get_cmp(e) == cmp_or && - exps_card(e->l) == CARD_MULTI && - exps_card(e->r) == CARD_MULTI) - ) { + (get_cmp(e) == cmp_or)) { if (!join && !list_length(lje)) { stmt *l = bin_first_column(be, left); stmt *r = bin_first_column(be, right); @@ -1947,9 +1944,7 @@ rel2bin_semijoin(backend *be, sql_rel *r if (list_length(lje) && (idx || e->type != e_cmp || e->flag != cmp_equal)) break; if ((exp_has_func(e) && get_cmp(e) != cmp_filter) || - (get_cmp(e) == cmp_or && - exps_card(e->l) == CARD_MULTI && - exps_card(e->r) == CARD_MULTI) ) { + (get_cmp(e) == cmp_or)) { break; } diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -4332,6 +4332,8 @@ rel_push_semijoin_down(int *changes, mvc for(n = exps->h; n; n = n->next) { sql_exp *sje = n->data; + if (sje->type != e_cmp) + return rel; if (right && (is_complex_exp(sje->flag) || rel_has_exp(lr, sje->l) >= 0 || diff --git a/sql/test/BugTracker-2017/Tests/All b/sql/test/BugTracker-2017/Tests/All --- a/sql/test/BugTracker-2017/Tests/All +++ b/sql/test/BugTracker-2017/Tests/All @@ -76,3 +76,5 @@ sqlitelogictest-aggregation-not-in.Bug-6 sqlsmith-semijoin-constant.bug-6417 sqlsmith.Bug-6418 sqlsmith.Bug-6423 +sqlsmith.Bug-6424 +sqlsmith.Bug-6425 diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.sql b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.sql @@ -0,0 +1,16 @@ +select + ref_2.name as c0, + case when true then ref_3.dimpos else ref_3.dimpos end + as c1 +from + sys.tables as ref_0 + inner join sys.dependencies as ref_1 + right join sys.tables as ref_2 + on ((ref_2.temporary is NULL) + or (ref_2.system is not NULL)) + inner join bam.pg as sample_1 + on (false) + on (ref_0.system = ref_2.system ) + inner join sys.netcdf_vardim as ref_3 + on (true) +where ref_2.commit_action is NULL; diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.err b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.err @@ -0,0 +1,34 @@ +stderr of test 'sqlsmith.Bug-6424` in directory 'sql/test/BugTracker-2017` itself: + + +# 08:07:16 > +# 08:07:16 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37745" "--set" "mapi_usock=/var/tmp/mtest-10220/.s.monetdb.37745" "--set" "monet_prompt=" "--forcemito" "--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017" +# 08:07:16 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-monetdb/Linux-x86_64/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 37745 +# cmdline opt mapi_usock = /var/tmp/mtest-10220/.s.monetdb.37745 +# cmdline opt monet_prompt = +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017 +# cmdline opt gdk_debug = 536870922 + +# 08:07:16 > +# 08:07:16 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-10220" "--port=37745" +# 08:07:16 > + + +# 08:07:16 > +# 08:07:16 > "Done." +# 08:07:16 > + diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.out b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.out @@ -0,0 +1,51 @@ +stdout of test 'sqlsmith.Bug-6424` in directory 'sql/test/BugTracker-2017` itself: + + +# 08:07:16 > +# 08:07:16 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37745" "--set" "mapi_usock=/var/tmp/mtest-10220/.s.monetdb.37745" "--set" "monet_prompt=" "--forcemito" "--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017" +# 08:07:16 > + +# MonetDB 5 server v11.27.6 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2017', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers +# Found 7.330 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:37745/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-10220/.s.monetdb.37745 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded + +Ready. + +# 08:07:16 > +# 08:07:16 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-10220" "--port=37745" +# 08:07:16 > + +#select +# ref_2.name as c0, +# case when true then ref_3.dimpos else ref_3.dimpos end +# as c1 +#from +# sys.tables as ref_0 +# inner join sys.dependencies as ref_1 +# right join sys.tables as ref_2 +# on ((ref_2.temporary is NULL) +# or (ref_2.system is not NULL)) +# inner join bam.pg as sample_1 +# on (false) +# on (ref_0.system = ref_2.system ) +# inner join sys.netcdf_vardim as ref_3 +# on (true) +#where ref_2.commit_action is NULL; +% .L76, .L100 # table_name +% c0, c1 # name +% varchar, int # type +% 0, 1 # length + +# 08:07:16 > +# 08:07:16 > "Done." +# 08:07:16 > + diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.sql b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.sql @@ -0,0 +1,14 @@ +select + sample_2.keyword as c0 +from + sys.optimizers as sample_0 + right join sys.netcdf_vardim as sample_1 + on (((true) + or (false)) + or (true)) + right join sys.keywords as sample_2 + right join sys.privilege_codes as sample_3 + on (sample_2.keyword = sample_3.privilege_code_name ) + on (sample_1.var_id = sample_3.privilege_code_id ) +where false +limit 106; diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.err b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.err @@ -0,0 +1,34 @@ +stderr of test 'sqlsmith.Bug-6425` in directory 'sql/test/BugTracker-2017` itself: + + +# 08:07:16 > +# 08:07:16 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37745" "--set" "mapi_usock=/var/tmp/mtest-10220/.s.monetdb.37745" "--set" "monet_prompt=" "--forcemito" "--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017" +# 08:07:16 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-monetdb/Linux-x86_64/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 37745 +# cmdline opt mapi_usock = /var/tmp/mtest-10220/.s.monetdb.37745 +# cmdline opt monet_prompt = +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017 +# cmdline opt gdk_debug = 536870922 + +# 08:07:17 > +# 08:07:17 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-10220" "--port=37745" +# 08:07:17 > + + +# 08:07:17 > +# 08:07:17 > "Done." +# 08:07:17 > + diff --git a/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.out b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.out @@ -0,0 +1,49 @@ +stdout of test 'sqlsmith.Bug-6425` in directory 'sql/test/BugTracker-2017` itself: + + +# 08:07:16 > +# 08:07:16 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37745" "--set" "mapi_usock=/var/tmp/mtest-10220/.s.monetdb.37745" "--set" "monet_prompt=" "--forcemito" "--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017" +# 08:07:16 > + +# MonetDB 5 server v11.27.6 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2017', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers +# Found 7.330 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:37745/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-10220/.s.monetdb.37745 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded + +Ready. + +# 08:07:17 > +# 08:07:17 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-10220" "--port=37745" +# 08:07:17 > + +#select +# sample_2.keyword as c0 +#from +# sys.optimizers as sample_0 +# right join sys.netcdf_vardim as sample_1 +# on (((true) +# or (false)) +# or (true)) +# right join sys.keywords as sample_2 +# right join sys.privilege_codes as sample_3 +# on (sample_2.keyword = sample_3.privilege_code_name ) +# on (sample_1.var_id = sample_3.privilege_code_id ) +#where false +#limit 106; +% .L7 # table_name +% c0 # name +% varchar # type +% 0 # length + +# 08:07:17 > +# 08:07:17 > "Done." +# 08:07:17 > + diff --git a/sql/test/mergetables/Tests/All b/sql/test/mergetables/Tests/All --- a/sql/test/mergetables/Tests/All +++ b/sql/test/mergetables/Tests/All @@ -22,4 +22,5 @@ addtable mergedb_create mergedb.Bug-6820 +sqlsmith.Bug-6426 mergedb_drop diff --git a/sql/test/mergetables/Tests/sqlsmith.Bug-6426.sql b/sql/test/mergetables/Tests/sqlsmith.Bug-6426.sql new file mode 100644 --- /dev/null +++ b/sql/test/mergetables/Tests/sqlsmith.Bug-6426.sql @@ -0,0 +1,32 @@ +select + sample_4.x as c0, + sample_0.location as c1 +from + sys.netcdf_files as sample_0 + right join tmp.idxs as sample_1 + right join sys.types as sample_2 + on (sample_1.table_id = sample_2.id ) + inner join sys.s as sample_4 + inner join tmp.idxs as ref_0 + on (false) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list