Changeset: 8de156c8d9c1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8de156c8d9c1
Added Files:
        sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.sql
        sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.err
        sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.out
        sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.sql
        
sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.err
        
sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.out
Modified Files:
        buildtools/autogen/autogen/am.py
        monetdb5/optimizer/opt_mergetable.c
        sql/backends/monet5/rel_bin.c
        sql/server/rel_optimizer.c
        sql/test/BugTracker-2014/Tests/All
Branch: default
Log Message:

Merge with Jan2014 branch.


diffs (251 lines):

diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1046,7 +1046,7 @@ def am_ant(fd, var, ant, am):
     if "COND" in ant:
         fd.write("\nif " + ant["COND"][0] +"\n\n")
 
-    fd.write("\n%s_ant_target:\n\t\"$(ANT)\" -f \"`$(anttranslatepath) 
$(srcdir)/build.xml`\" -Dbuilddir=\"`$(anttranslatepath) $(PWD)/%s`\" 
-Djardir=\"`$(anttranslatepath) $(PWD)`\" -Dbasedir=\"`$(anttranslatepath) 
$(srcdir)`\" %s\n" % (target, target, target))
+    fd.write("\n%s_ant_target:\n\t\"$(ANT)\" -f \"`$(anttranslatepath) 
$(srcdir)/build.xml`\" -Dbuilddir=\"`$(anttranslatepath) $(PWD)`/%s\" 
-Djardir=\"`$(anttranslatepath) $(PWD)`\" -Dbasedir=\"`$(anttranslatepath) 
$(srcdir)`\" %s\n" % (target, target, target))
 
     for file in ant['FILES']:
         sfile = file.replace(".", "_")
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -710,18 +710,6 @@ mat_aggr(MalBlkPtr mb, InstrPtr p, mat_t
                s = pushArgument(mb, s, getArg(r,0));
                pushInstruction(mb, s);
                r = s;
-
-/* DEAD CODE FOUND BY COVERITY
-               if (isAvg) {
-                       s = newInstruction(mb,ASSIGNsymbol);
-                       setModuleId(s, algebraRef);
-                       setFunctionId(s, selectNotNilRef);
-                       getArg(s,0) = newTmpVariable(mb, battp2);
-                       s = pushArgument(mb, s, getArg(u,0));
-                       pushInstruction(mb, s);
-                       u = s;
-               }
-*/
        }
 
        /* for avg we do sum (avg*(count/sumcount) ) */
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
@@ -2516,7 +2516,9 @@ rel2bin_groupby( mvc *sql, sql_rel *rel,
 
                stmt *aggrstmt = NULL;
 
-               /* first look in the group by column list */
+               /* first look in the current aggr list (l) and group by column 
list */
+               if (l && !aggrstmt && aggrexp->type == e_column) 
+                       aggrstmt = list_find_column(sql->sa, l, aggrexp->l, 
aggrexp->r);
                if (gbexps && !aggrstmt && aggrexp->type == e_column) {
                        aggrstmt = list_find_column(sql->sa, gbexps, 
aggrexp->l, aggrexp->r);
                        if (aggrstmt && groupby)
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
@@ -19,5 +19,7 @@ in_incorrect_multi.Bug-3462
 crash_on_groupby_distinct_serial.Bug-3463
 local-temp-1.Bug-3468
 local-temp-2.Bug-3468
+varchar_conversion_crash.Bug-3506
 oid-table-assert.Bug-3514
 round-properties.Bug-3515
+union_with_subqueries.Bug-3518
diff --git a/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.sql 
b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.sql
@@ -0,0 +1,1 @@
+SELECT sum(a), sum(a) FROM (( SELECT 1 AS A ) UNION ALL (SELECT 3 AS A)) AS 
query;
diff --git 
a/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.err 
b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'union_with_subqueries.Bug-3518` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 18:48:46 >  
+# 18:48:46 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37060" "--set" 
"mapi_usock=/var/tmp/mtest-27766/.s.monetdb.37060" "--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"
+# 18:48:46 >  
+
+# 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 = 37060
+# cmdline opt  mapi_usock = /var/tmp/mtest-27766/.s.monetdb.37060
+# 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
+
+# 18:48:46 >  
+# 18:48:46 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-27766" "--port=37060"
+# 18:48:46 >  
+
+
+# 18:48:47 >  
+# 18:48:47 >  "Done."
+# 18:48:47 >  
+
diff --git 
a/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.out 
b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/union_with_subqueries.Bug-3518.stable.out
@@ -0,0 +1,38 @@
+stdout of test 'union_with_subqueries.Bug-3518` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 18:48:46 >  
+# 18:48:46 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37060" "--set" 
"mapi_usock=/var/tmp/mtest-27766/.s.monetdb.37060" "--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"
+# 18:48:46 >  
+
+# 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:37060/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-27766/.s.monetdb.37060
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 18:48:46 >  
+# 18:48:46 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-27766" "--port=37060"
+# 18:48:46 >  
+
+#SELECT sum(a), sum(a) FROM (( SELECT 1 AS A ) UNION ALL (SELECT 3 AS A)) AS 
query;
+% .L1, .L2 # table_name
+% L1,  L2 # name
+% bigint,      bigint # type
+% 1,   1 # length
+[ 4,   4       ]
+
+# 18:48:47 >  
+# 18:48:47 >  "Done."
+# 18:48:47 >  
+
diff --git 
a/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.sql 
b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.sql
@@ -0,0 +1,8 @@
+CREATE TABLE config (id SERIAL ,dataset INT NOT NULL ,section VARCHAR(100) 
,key VARCHAR(100) ,value VARCHAR(500) ,type VARCHAR(5) ,UNIQUE (dataset, 
section, key)) ;
+
+INSERT INTO config (dataset, section, key, value, type) VALUES (6, 
'quality_lofar', 'low_bound', 1.9, 'float');
+INSERT INTO config (dataset, section, key, value, type) VALUES (6, 
'quality_lofar', 'high_bound', 80, 'int');
+
+select * from config;
+
+drop table config;
diff --git 
a/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.err 
b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.err
@@ -0,0 +1,38 @@
+stderr of test 'varchar_conversion_crash.Bug-3506` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 18:58:33 >  
+# 18:58:33 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38663" "--set" 
"mapi_usock=/var/tmp/mtest-28742/.s.monetdb.38663" "--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"
+# 18:58:33 >  
+
+# 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 = 38663
+# cmdline opt  mapi_usock = /var/tmp/mtest-28742/.s.monetdb.38663
+# 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
+
+# 18:58:33 >  
+# 18:58:33 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-28742" "--port=38663"
+# 18:58:33 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-28742/.s.monetdb.38663
+QUERY = INSERT INTO config (dataset, section, key, value, type) VALUES (6, 
'quality_lofar', 'high_bound', 80, 'int');
+ERROR = !EXEC: wrong type for argument 4 of prepared statement: decimal, 
expected decimal
+
+# 18:58:33 >  
+# 18:58:33 >  "Done."
+# 18:58:33 >  
+
diff --git 
a/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.out 
b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2014/Tests/varchar_conversion_crash.Bug-3506.stable.out
@@ -0,0 +1,42 @@
+stdout of test 'varchar_conversion_crash.Bug-3506` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 18:58:33 >  
+# 18:58:33 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38663" "--set" 
"mapi_usock=/var/tmp/mtest-28742/.s.monetdb.38663" "--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"
+# 18:58:33 >  
+
+# 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:38663/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-28742/.s.monetdb.38663
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 18:58:33 >  
+# 18:58:33 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-28742" "--port=38663"
+# 18:58:33 >  
+
+#CREATE TABLE config (id SERIAL ,dataset INT NOT NULL ,section VARCHAR(100) 
,key VARCHAR(100) ,value VARCHAR(500) ,type VARCHAR(5) ,UNIQUE (dataset, 
section, key)) ;
+#INSERT INTO config (dataset, section, key, value, type) VALUES (6, 
'quality_lofar', 'low_bound', 1.9, 'float');
+[ 1    ]
+#select * from config;
+% sys.config,  sys.config,     sys.config,     sys.config,     sys.config,     
sys.config # table_name
+% id,  dataset,        section,        key,    value,  type # name
+% int, int,    varchar,        varchar,        varchar,        varchar # type
+% 1,   1,      13,     9,      3,      5 # length
+[ 1,   6,      "quality_lofar",        "low_bound",    "1.9",  "float" ]
+#drop table config;
+
+# 18:58:33 >  
+# 18:58:33 >  "Done."
+# 18:58:33 >  
+
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to