Changeset: 17210e4eb794 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=17210e4eb794
Modified Files:
        sql/ChangeLog.Jun2010
        sql/src/server/rel_select.mx
        sql/src/test/BugTracker-2010/Tests/All
        sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.sql
        sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.err
        sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.out
Branch: Jun2010
Log Message:

fixed bug 2643

added more defensive code in rel_aggr


diffs (156 lines):

diff -r 53e4bd97c23a -r 17210e4eb794 sql/ChangeLog.Jun2010
--- a/sql/ChangeLog.Jun2010     Fri Aug 13 00:38:50 2010 +0200
+++ b/sql/ChangeLog.Jun2010     Fri Aug 13 00:50:57 2010 +0200
@@ -2,6 +2,8 @@
 # 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
 
diff -r 53e4bd97c23a -r 17210e4eb794 sql/src/server/rel_select.mx
--- a/sql/src/server/rel_select.mx      Fri Aug 13 00:38:50 2010 +0200
+++ b/sql/src/server/rel_select.mx      Fri Aug 13 00:50:57 2010 +0200
@@ -3494,9 +3494,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 53e4bd97c23a -r 17210e4eb794 sql/src/test/BugTracker-2010/Tests/All
--- a/sql/src/test/BugTracker-2010/Tests/All    Fri Aug 13 00:38:50 2010 +0200
+++ b/sql/src/test/BugTracker-2010/Tests/All    Fri Aug 13 00:50:57 2010 +0200
@@ -49,3 +49,4 @@
 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 53e4bd97c23a -r 17210e4eb794 
sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.sql
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.sql Fri Aug 
13 00:50:57 2010 +0200
@@ -0,0 +1,3 @@
+create table test (today date);
+select sum(today) from test;
+drop table test;
diff -r 53e4bd97c23a -r 17210e4eb794 
sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.err
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.err  
Fri Aug 13 00:50:57 2010 +0200
@@ -0,0 +1,69 @@
+stderr of test 'sum_on_date_crash.Bug-2643` in directory 
'src/test/BugTracker-2010` itself:
+
+
+# 00:48:05 >  
+# 00:48:05 >   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=38743 --set 
xrpc_port=48622 --set monet_prompt= --set mal_listing=2 --trace  
"--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo 
Over..
+# 00:48:05 >  
+
+# 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 = 38743
+# cmdline opt  xrpc_port = 48622
+# 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:48:05 >  
+# 00:48:05 >  mclient -lsql -ftest -i -e --host=alf --port=38743 
+# 00:48:05 >  
+
+MAPI  = mone...@alf:38743
+QUERY = select sum(today) from test;
+ERROR = !types date(0,0) and tinyint(8,0) are not equal for column 'today'
+
+# 00:48:05 >  
+# 00:48:05 >  Done.
+# 00:48:05 >  
+
diff -r 53e4bd97c23a -r 17210e4eb794 
sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.out  
Fri Aug 13 00:50:57 2010 +0200
@@ -0,0 +1,33 @@
+stdout of test 'sum_on_date_crash.Bug-2643` in directory 
'src/test/BugTracker-2010` itself:
+
+
+# 00:48:05 >  
+# 00:48:05 >   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=38743 --set 
xrpc_port=48622 --set monet_prompt= --set mal_listing=2 --trace  
"--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo 
Over..
+# 00:48:05 >  
+
+# 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:38743/
+# MonetDB/SQL module v2.38.4 loaded
+
+Ready.
+
+Over..
+
+# 00:48:05 >  
+# 00:48:05 >  mclient -lsql -ftest -i -e --host=alf --port=38743 
+# 00:48:05 >  
+
+#create table test (today date);
+#drop table test;
+
+# 00:48:05 >  
+# 00:48:05 >  Done.
+# 00:48:05 >  
+
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to