Changeset: f169139660d8 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f169139660d8 Modified Files: count-count-distinct.Bug-2808.sql count-count-distinct.Bug-2808.stable.err count-count-distinct.Bug-2808.stable.out sql/backends/monet5/sql.mx sql/test/BugTracker-2011/Tests/All Branch: Apr2011 Log Message:
add test for count-count-distinct bug 2808 check variable sized types on binary copy into (solves bug 2010). diffs (138 lines): diff --git a/count-count-distinct.Bug-2808.sql b/count-count-distinct.Bug-2808.sql new file mode 100644 --- /dev/null +++ b/count-count-distinct.Bug-2808.sql @@ -0,0 +1,3 @@ +select count(name) from tables; +select count(distinct name) from tables; +select count(name) , count(distinct name) from tables; diff --git a/count-count-distinct.Bug-2808.stable.err b/count-count-distinct.Bug-2808.stable.err new file mode 100644 --- /dev/null +++ b/count-count-distinct.Bug-2808.stable.err @@ -0,0 +1,39 @@ +stderr of test 'count-count-distinct.Bug-2808` in directory 'test/BugTracker-2011` itself: + + +# 10:05:42 > +# 10:05:42 > mserver5 --debug=10 --set gdk_nr_threads=4 --set "gdk_dbfarm=/ufs/niels/scratch/MonetDB/Linux-x86_64/var/MonetDB" --set mapi_open=true --set mapi_port=30195 --set monet_prompt= --trace --forcemito --set mal_listing=2 "--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 ; echo ; echo Over.. +# 10:05:42 > + +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = /ufs/niels/scratch/MonetDB/Linux-x86_64/var/monetdb5/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# builtin opt gdk_vmtrim = yes +# 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 default_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# builtin opt minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 4 +# cmdline opt gdk_dbfarm = /ufs/niels/scratch/MonetDB/Linux-x86_64/var/MonetDB +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 30195 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_test_BugTracker-2011 +# cmdline opt mal_listing = 0 + +# 10:05:42 > +# 10:05:42 > mclient -lsql -ftest -i -e --host=alf --port=30195 +# 10:05:42 > + + +# 10:05:42 > +# 10:05:42 > Done. +# 10:05:42 > + diff --git a/count-count-distinct.Bug-2808.stable.out b/count-count-distinct.Bug-2808.stable.out new file mode 100644 --- /dev/null +++ b/count-count-distinct.Bug-2808.stable.out @@ -0,0 +1,50 @@ +stdout of test 'count-count-distinct.Bug-2808` in directory 'test/BugTracker-2011` itself: + + +# 10:05:42 > +# 10:05:42 > mserver5 --debug=10 --set gdk_nr_threads=4 --set "gdk_dbfarm=/ufs/niels/scratch/MonetDB/Linux-x86_64/var/MonetDB" --set mapi_open=true --set mapi_port=30195 --set monet_prompt= --trace --forcemito --set mal_listing=2 "--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 ; echo ; echo Over.. +# 10:05:42 > + +# MonetDB 5 server v11.4.0 +# This is an unreleased version +# Serving database 'mTests_test_BugTracker-2011', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.752 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2011 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:30195/ +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded + +Ready. + +Over.. + +# 10:05:42 > +# 10:05:42 > mclient -lsql -ftest -i -e --host=alf --port=30195 +# 10:05:42 > + +#select count(name) from tables; +% .tables # table_name +% L1 # name +% wrd # type +% 2 # length +[ 32 ] +#select count(distinct name) from tables; +% .tables # table_name +% L2 # name +% wrd # type +% 2 # length +[ 26 ] +#select count(name) , count(distinct name) from tables; +% .tables, .tables # table_name +% L3, L4 # name +% wrd, wrd # type +% 2, 2 # length +[ 32, 26 ] + +# 10:05:42 > +# 10:05:42 > Done. +# 10:05:42 > + diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx --- a/sql/backends/monet5/sql.mx +++ b/sql/backends/monet5/sql.mx @@ -3466,9 +3466,19 @@ throw(SQL,"sql", "table %s not found", tname); if (list_length(t->columns.set) != (pci->argc-3)) throw(SQL,"sql", "Not enough columns in found"); + + for (i = 3, n = t->columns.set->h; i<pci->argc && n; i++, n = n->next) { + sql_column *col = n->data; + + if (ATOMvarsized(col->type.type->localtype )) + throw(SQL, "sql", "failed to attach file %s", + *(str*)getArgReference(stk, pci, i)); + } + b = BATnew(TYPE_str, TYPE_bat, pci->argc-3); if( b == NULL) throw(SQL, "sql.import", MAL_MALLOC_FAIL); + for (i = 3, n = t->columns.set->h; i<pci->argc && n; i++, n = n->next) { sql_column *col = n->data; BAT *c; diff --git a/sql/test/BugTracker-2011/Tests/All b/sql/test/BugTracker-2011/Tests/All --- a/sql/test/BugTracker-2011/Tests/All +++ b/sql/test/BugTracker-2011/Tests/All @@ -9,3 +9,4 @@ crash_on_alias.Bug-2798 groupby_primary_key.Bug-2807 merge_range_exp.Bug-2806 +count-count-distinct.Bug-2808 _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
