Changeset: 516d270cbe32 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=516d270cbe32 Added Files: sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.sql sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.err sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.out sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.sql sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.err sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.out Modified Files: sql/server/rel_exp.c sql/test/BugTracker-2014/Tests/All Branch: Jan2014 Log Message:
fixed bugs 3505 and 3511 diffs (truncated from 308 to 300 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -738,6 +738,24 @@ exp_match_list( list *l, list *r) return match; } +static int +exps_equal( list *l, list *r) +{ + node *n, *m; + + if (!l || !r) + return l == r; + if (list_length(l) != list_length(r)) + return 0; + for (n = l->h, m = r->h; n && m; n = n->next, m = m->next) { + sql_exp *le = n->data, *re = m->data; + + if (!exp_match_exp(le,re)) + return 0; + } + return 1; +} + int exp_match_exp( sql_exp *e1, sql_exp *e2) { @@ -769,15 +787,15 @@ exp_match_exp( sql_exp *e1, sql_exp *e2) break; case e_aggr: if (!subaggr_cmp(e1->f, e2->f) && /* equal aggregation*/ - exp_match_list(e1->l, e2->l) && + exps_equal(e1->l, e2->l) && e1->flag == e2->flag) return 1; break; case e_func: if (!subfunc_cmp(e1->f, e2->f) && /* equal functions */ - exp_match_list(e1->l, e2->l) && + exps_equal(e1->l, e2->l) && /* optional order by expressions */ - exp_match_list(e1->r, e2->r)) + exps_equal(e1->r, e2->r)) return 1; break; case e_atom: diff --git a/sql/test/BugTracker-2014/Tests/All b/sql/test/BugTracker-2014/Tests/All --- a/sql/test/BugTracker-2014/Tests/All +++ b/sql/test/BugTracker-2014/Tests/All @@ -18,7 +18,9 @@ in_incorrect_multi.Bug-3462 crash_on_groupby_distinct_serial.Bug-3463 local-temp-1.Bug-3468 local-temp-2.Bug-3468 +boolean_not.Bug-3505 varchar_conversion_crash.Bug-3506 +bug_in_cse.Bug-3511 stringfloatshtcompare.Bug-3512 oid-table-assert.Bug-3514 round-properties.Bug-3515 diff --git a/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.sql b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.sql @@ -0,0 +1,16 @@ +start transaction; +CREATE TABLE BOOLTBL1 (f1 bool); +INSERT INTO BOOLTBL1 (f1) VALUES (cast('true' AS boolean)); +INSERT INTO BOOLTBL1 (f1) VALUES ('true'); +INSERT INTO BOOLTBL1 (f1) VALUES ('false'); + +SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT FALSE; +SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT TRUE; + +SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT FALSE); +SELECT f1 FROM BOOLTBL1 WHERE NOT FALSE = f1; +SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = FALSE; + +SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT TRUE); +SELECT f1 FROM BOOLTBL1 WHERE NOT TRUE = f1; +SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = TRUE; diff --git a/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.err b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.err @@ -0,0 +1,35 @@ +stderr of test 'boolean_not.Bug-3505` in directory 'sql/test/BugTracker-2014` itself: + + +# 19:06:47 > +# 19:06:47 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=38042" "--set" "mapi_usock=/var/tmp/mtest-25685/.s.monetdb.38042" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014" "--set" "mal_listing=0" +# 19:06:47 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/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 = 38042 +# cmdline opt mapi_usock = /var/tmp/mtest-25685/.s.monetdb.38042 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014 +# cmdline opt mal_listing = 0 + +# 19:06:47 > +# 19:06:47 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-25685" "--port=38042" +# 19:06:47 > + + +# 19:06:48 > +# 19:06:48 > "Done." +# 19:06:48 > + diff --git a/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.out b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/boolean_not.Bug-3505.stable.out @@ -0,0 +1,92 @@ +stdout of test 'boolean_not.Bug-3505` in directory 'sql/test/BugTracker-2014` itself: + + +# 19:06:47 > +# 19:06:47 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=38042" "--set" "mapi_usock=/var/tmp/mtest-25685/.s.monetdb.38042" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014" "--set" "mal_listing=0" +# 19:06:47 > + +# MonetDB 5 server v11.17.22 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2014', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.334 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:38042/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-25685/.s.monetdb.38042 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded + +Ready. + +# 19:06:47 > +# 19:06:47 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-25685" "--port=38042" +# 19:06:47 > + +#start transaction; +#CREATE TABLE BOOLTBL1 (f1 bool); +#INSERT INTO BOOLTBL1 (f1) VALUES (cast('true' AS boolean)); +[ 1 ] +#INSERT INTO BOOLTBL1 (f1) VALUES ('true'); +[ 1 ] +#INSERT INTO BOOLTBL1 (f1) VALUES ('false'); +[ 1 ] +#SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT FALSE; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ true ] +[ true ] +#SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT TRUE; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ false ] +#SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT FALSE); +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ true ] +[ true ] +#SELECT f1 FROM BOOLTBL1 WHERE NOT FALSE = f1; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ true ] +[ true ] +#SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = FALSE; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ true ] +[ true ] +#SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT TRUE); +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ false ] +#SELECT f1 FROM BOOLTBL1 WHERE NOT TRUE = f1; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ false ] +#SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = TRUE; +% sys.booltbl1 # table_name +% f1 # name +% boolean # type +% 5 # length +[ false ] + +# 19:06:48 > +# 19:06:48 > "Done." +# 19:06:48 > + diff --git a/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.sql b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.sql @@ -0,0 +1,2 @@ +SELECT contains(smallc, bigc) AS smallcontainsbig, contains(bigc, smallc) AS bigcontainssmall FROM (SELECT Buffer(GeomFromText('POINT(1 2)', 0), 10) As smallc, Buffer(GeomFromText('POINT(1 2)', 0), 20) As bigc) As foo; + diff --git a/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.err b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.err @@ -0,0 +1,35 @@ +stderr of test 'bug_in_cse.Bug-3511` in directory 'sql/test/BugTracker-2014` itself: + + +# 19:06:48 > +# 19:06:48 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=38042" "--set" "mapi_usock=/var/tmp/mtest-25685/.s.monetdb.38042" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014" "--set" "mal_listing=0" +# 19:06:48 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/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 = 38042 +# cmdline opt mapi_usock = /var/tmp/mtest-25685/.s.monetdb.38042 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014 +# cmdline opt mal_listing = 0 + +# 19:06:48 > +# 19:06:48 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-25685" "--port=38042" +# 19:06:48 > + + +# 19:06:48 > +# 19:06:48 > "Done." +# 19:06:48 > + diff --git a/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.out b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/bug_in_cse.Bug-3511.stable.out @@ -0,0 +1,38 @@ +stdout of test 'bug_in_cse.Bug-3511` in directory 'sql/test/BugTracker-2014` itself: + + +# 19:06:48 > +# 19:06:48 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=38042" "--set" "mapi_usock=/var/tmp/mtest-25685/.s.monetdb.38042" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014" "--set" "mal_listing=0" +# 19:06:48 > + +# MonetDB 5 server v11.17.22 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2014', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.334 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:38042/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-25685/.s.monetdb.38042 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded + +Ready. + +# 19:06:48 > +# 19:06:48 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-25685" "--port=38042" +# 19:06:48 > + +#SELECT contains(smallc, bigc) AS smallcontainsbig, contains(bigc, smallc) AS bigcontainssmall FROM (SELECT Buffer(GeomFromText('POINT(1 2)', 0), 10) As smallc, Buffer(GeomFromText('POINT(1 2)', 0), 20) As bigc) As foo; +% .L, .L # table_name +% smallcontainsbig, bigcontainssmall # name _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list