Changeset: 48e9b1665879 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=48e9b1665879 Modified Files: sql/ChangeLog.Jun2010 sql/src/server/rel_optimizer.mx sql/src/server/rel_select.mx sql/src/test/BugTracker-2010/Tests/All Branch: default Log Message:
Merge with Jun2010 branch. diffs (truncated from 678 to 300 lines): diff -r 45c1f030e31d -r 48e9b1665879 sql/ChangeLog.Jun2010 --- a/sql/ChangeLog.Jun2010 Thu Aug 12 22:43:43 2010 +0200 +++ b/sql/ChangeLog.Jun2010 Fri Aug 13 09:27:01 2010 +0200 @@ -1,7 +1,14 @@ # ChangeLog file for sql # This file is updated with Maddlog +* Fri Aug 13 2010 Niels Nes <ni...@cwi.nl> +- Fixed bug 2643 added more defensive code, when an aggregation function + doesn't exist +- Fixed bug 2651 properly handle dead code elimination with + op_semi/op_anti and references + * Thu Aug 12 2010 Niels Nes <ni...@cwi.nl> +- Fixed bug 2652. Correctly list all columns of a 'IN' query with 'EXCEPT' - Fixed bug 2353. The relational optimizer didn't handle range join expressions properly. - fixed bug 2354. Improved function resolution. diff -r 45c1f030e31d -r 48e9b1665879 sql/src/server/rel_optimizer.mx --- a/sql/src/server/rel_optimizer.mx Thu Aug 12 22:43:43 2010 +0200 +++ b/sql/src/server/rel_optimizer.mx Fri Aug 13 09:27:01 2010 +0200 @@ -3004,13 +3004,15 @@ static void rel_used(sql_rel *rel) { - if (is_join(rel->op) || is_set(rel->op)) { + if (is_join(rel->op) || is_set(rel->op) || is_semi(rel->op)) { if (rel->l) rel_used(rel->l); if (rel->r) rel_used(rel->r); - } else if (is_topn(rel->op) || is_select(rel->op)) + } else if (is_topn(rel->op) || is_select(rel->op)) { + rel_used(rel->l); rel = rel->l; + } if (rel->exps) { exps_used(rel->exps); if (rel->r && (rel->op == op_project || rel->op == op_groupby)) diff -r 45c1f030e31d -r 48e9b1665879 sql/src/server/rel_select.mx --- a/sql/src/server/rel_select.mx Thu Aug 12 22:43:43 2010 +0200 +++ b/sql/src/server/rel_select.mx Fri Aug 13 09:27:01 2010 +0200 @@ -2732,7 +2732,6 @@ list_destroy(vals); } r = rel_lastexp(sql, right); - rel_setsubquery(right); rel = rel_crossproduct(left, right, op_join); if (rel_convert_types(sql, &l, &r, 1, type_equal) < 0) { exp_destroy(l); @@ -3494,9 +3493,12 @@ return exp_fix_scale(sql, t, exp, 1, (t->type->scale == SCALE_FIX)); } else { - char *type = exp_subtype(e)->type->sqlname; - - exp_destroy(e); + char *type = "unknown"; + + if (e) { + type = exp_subtype(e)->type->sqlname; + exp_destroy(e); + } return sql_error(sql, 02, "%s: no such operator '%s(%s)'", toUpperCopy(alloca(strlen(aggrstr) + 1), aggrstr), aggrstr, type); } } diff -r 45c1f030e31d -r 48e9b1665879 sql/src/test/BugTracker-2010/Tests/All --- a/sql/src/test/BugTracker-2010/Tests/All Thu Aug 12 22:43:43 2010 +0200 +++ b/sql/src/test/BugTracker-2010/Tests/All Fri Aug 13 09:27:01 2010 +0200 @@ -47,3 +47,6 @@ assert_on_type_mismatch.Bug-2319 crash_on_in_1.Bug-2352 crash_on_complex_join_exp.Bug-2353 +crash_in_dce.Bug-2651 +in_query_missing_columns.Bug-2652 +sum_on_date_crash.Bug-2643 diff -r 45c1f030e31d -r 48e9b1665879 sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.sql Fri Aug 13 09:27:01 2010 +0200 @@ -0,0 +1,37 @@ +CREATE TABLE "sys"."anbinew" ( + "naam" VARCHAR(128), + "vestigingsplaats" VARCHAR(64), + "beschikking" DATE, + "einddatum" DATE, + "intrekking" DATE +); +CREATE TABLE "sys"."anbikvk2" ( + "naam" VARCHAR(128), + "vestigingsplaats" VARCHAR(32), + "beschikking" DATE, + "einddatum" DATE, + "intrekking" DATE, + "kvks" INTEGER +); +CREATE TABLE "sys"."kvk" ( + "id" INTEGER NOT NULL, + "kvk" BIGINT, + "bedrijfsnaam" VARCHAR(256), + "adres" VARCHAR(256), + "postcode" VARCHAR(10), + "plaats" VARCHAR(32), + "type" VARCHAR(14), + "kvks" INTEGER, + "sub" INTEGER, + "bedrijfsnaam_size" SMALLINT, + "adres_size" SMALLINT, + CONSTRAINT "kvk_id_pkey" PRIMARY KEY ("id") +); + +select naam, vestigingsplaats, beschikking, einddatum, intrekking, kvks +from anbinew, kvk where lower(naam) = lower(bedrijfsnaam) and lower(plaats) = +lower(vestigingsplaats) and kvks not in (select kvk from anbikvk2); + +drop table kvk; +drop table anbikvk2; +drop table anbinew; diff -r 45c1f030e31d -r 48e9b1665879 sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.stable.err --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.stable.err Fri Aug 13 09:27:01 2010 +0200 @@ -0,0 +1,66 @@ +stderr of test 'crash_in_dce.Bug-2651` in directory 'src/test/BugTracker-2010` itself: + + +# 00:36:24 > +# 00:36:24 > mserver5 "--config=/ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm" --set mapi_open=true --set xrpc_open=true --set mapi_port=33475 --set xrpc_port=44252 --set monet_prompt= --set mal_listing=2 --trace "--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo Over.. +# 00:36:24 > + +# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu +# builtin opt gdk_version = 1.38.4 +# builtin opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# builtin opt exec_prefix = ${prefix} +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# builtin opt gdk_vmtrim = yes +# builtin opt monet_admin = adm +# builtin opt monet_prompt = > +# builtin opt monet_welcome = yes +# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB +# builtin opt monet_daemon = no +# builtin opt host = localhost +# builtin opt mapi_port = 50000 +# builtin opt mapi_clients = 2 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_debug = 0 +# builtin opt standoff_ns = +# builtin opt standoff_start = start +# builtin opt standoff_end = end +# config opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# config opt config = ${prefix}/etc/monetdb5.conf +# config opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# config opt exec_prefix = ${prefix} +# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm +# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin +# config opt mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid +# config opt mero_controlport = 50001 +# config opt sql_optimizer = default_pipe +# config opt minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector +# config opt default_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt nov2009_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# cmdline opt config = /ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf +# cmdline opt gdk_nr_threads = 0 +# cmdline opt monet_mod_path = /ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin +# cmdline opt gdk_dbfarm = /ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm +# cmdline opt mapi_open = true +# cmdline opt xrpc_open = true +# cmdline opt mapi_port = 33475 +# cmdline opt xrpc_port = 44252 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_src_test_BugTracker-2010 +# cmdline opt mal_listing = 0 +#warning: please don't forget to set your vault key! +#(see /ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf) + +# 00:36:24 > +# 00:36:24 > mclient -lsql -ftest -i -e --host=alf --port=33475 +# 00:36:24 > + + +# 00:36:24 > +# 00:36:24 > Done. +# 00:36:24 > + diff -r 45c1f030e31d -r 48e9b1665879 sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.stable.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/src/test/BugTracker-2010/Tests/crash_in_dce.Bug-2651.stable.out Fri Aug 13 09:27:01 2010 +0200 @@ -0,0 +1,68 @@ +stdout of test 'crash_in_dce.Bug-2651` in directory 'src/test/BugTracker-2010` itself: + + +# 00:36:24 > +# 00:36:24 > mserver5 "--config=/ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm" --set mapi_open=true --set xrpc_open=true --set mapi_port=33475 --set xrpc_port=44252 --set monet_prompt= --set mal_listing=2 --trace "--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo Over.. +# 00:36:24 > + +# MonetDB server v5.20.4, based on kernel v1.38.4 +# Not released +# Serving database 'mTests_src_test_BugTracker-2010', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.754 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved +# Visit http://monetdb.cwi.nl/ for further information +# Listening for connection requests on mapi:monetdb://alf.ins.cwi.nl:33475/ +# MonetDB/SQL module v2.38.4 loaded + +Ready. + +Over.. + +# 00:36:24 > +# 00:36:24 > mclient -lsql -ftest -i -e --host=alf --port=33475 +# 00:36:24 > + +#CREATE TABLE "sys"."anbinew" ( +# "naam" VARCHAR(128), +# "vestigingsplaats" VARCHAR(64), +# "beschikking" DATE, +# "einddatum" DATE, +# "intrekking" DATE +#); +#CREATE TABLE "sys"."anbikvk2" ( +# "naam" VARCHAR(128), +# "vestigingsplaats" VARCHAR(32), +# "beschikking" DATE, +# "einddatum" DATE, +# "intrekking" DATE, +# "kvks" INTEGER +#); +#CREATE TABLE "sys"."kvk" ( +# "id" INTEGER NOT NULL, +# "kvk" BIGINT, +# "bedrijfsnaam" VARCHAR(256), +# "adres" VARCHAR(256), +# "postcode" VARCHAR(10), +# "plaats" VARCHAR(32), +# "type" VARCHAR(14), +# "kvks" INTEGER, +# "sub" INTEGER, +# "bedrijfsnaam_size" SMALLINT, +# "adres_size" SMALLINT, +#select naam, vestigingsplaats, beschikking, einddatum, intrekking, kvks +#from anbinew, kvk where lower(naam) = lower(bedrijfsnaam) and lower(plaats) = +#lower(vestigingsplaats) and kvks not in (select kvk from anbikvk2); +% sys.anbinew, sys.anbinew, sys.anbinew, sys.anbinew, sys.anbinew, sys.kvk # table_name +% naam, vestigingsplaats, beschikking, einddatum, intrekking, kvks # name +% varchar, varchar, date, date, date, int # type +% 0, 0, 10, 10, 10, 1 # length +#drop table kvk; +#drop table anbikvk2; +#drop table anbinew; + +# 00:36:24 > +# 00:36:24 > Done. +# 00:36:24 > + diff -r 45c1f030e31d -r 48e9b1665879 sql/src/test/BugTracker-2010/Tests/crash_on_complex_join_exp.Bug-2353.stable.err --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/src/test/BugTracker-2010/Tests/crash_on_complex_join_exp.Bug-2353.stable.err Fri Aug 13 09:27:01 2010 +0200 @@ -0,0 +1,66 @@ +stderr of test 'crash_on_complex_join_exp.Bug-2353` in directory 'src/test/BugTracker-2010` itself: + + +# 21:49:44 > +# 21:49:44 > mserver5 "--config=/ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm" --set mapi_open=true --set xrpc_open=true --set mapi_port=33178 --set xrpc_port=41304 --set monet_prompt= --set mal_listing=2 --trace "--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo Over.. +# 21:49:44 > + +# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu +# builtin opt gdk_version = 1.38.4 +# builtin opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# builtin opt exec_prefix = ${prefix} +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# builtin opt gdk_vmtrim = yes +# builtin opt monet_admin = adm +# builtin opt monet_prompt = > +# builtin opt monet_welcome = yes +# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB +# builtin opt monet_daemon = no +# builtin opt host = localhost +# builtin opt mapi_port = 50000 +# builtin opt mapi_clients = 2 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_debug = 0 +# builtin opt standoff_ns = +# builtin opt standoff_start = start +# builtin opt standoff_end = end +# config opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# config opt config = ${prefix}/etc/monetdb5.conf +# config opt prefix = /ufs/niels/scratch/rc/Linux-x86_64 +# config opt exec_prefix = ${prefix} +# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm +# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin +# config opt mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list