Changeset: f0127058adfb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f0127058adfb
Added Files:
        sql/test/Tests/alastair_udf_mergetable_bug.py
        sql/test/Tests/alastair_udf_mergetable_bug.stable.err
        sql/test/Tests/alastair_udf_mergetable_bug.stable.out
Branch: Jan2014
Log Message:

Add test for the bug in mergetable to deal with UDFs


diffs (163 lines):

diff --git a/sql/test/Tests/alastair_udf_mergetable_bug.py 
b/sql/test/Tests/alastair_udf_mergetable_bug.py
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/alastair_udf_mergetable_bug.py
@@ -0,0 +1,44 @@
+import sys
+import os
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+def client(input):
+    c = process.client('sql',
+                         stdin = process.PIPE,
+                         stdout = process.PIPE,
+                         stderr = process.PIPE)
+    out, err = c.communicate(input)
+    sys.stdout.write(out)
+    sys.stderr.write(err)
+
+script1 = '''\
+create table tab1 (group_by_col int, index_col int, f float);
+create table tab2 (index_col int, f float);
+
+insert into tab1 values (1,1,1),(1,2,2),(2,1,3),(2,2,4),(3,1,5),(3,2,6);
+insert into tab2 values (1,111),(2,222),(3,333),(4,444);
+
+set optimizer='default_pipe';
+select optimizer;
+select tab1.group_by_col,SUM(fuse(tab1.f,tab2.f)) from tab2 inner join tab1 on 
tab1.index_col = tab2.index_col group by tab1.group_by_col;
+
+drop table tab1;
+drop table tab2;
+
+'''
+
+def main():
+    s = process.server(args = ["--set", "gdk_nr_threads=2", "--forcemito"],
+                       stdin = process.PIPE,
+                       stdout = process.PIPE,
+                       stderr = process.PIPE)
+    client(script1)
+    out, err = s.communicate()
+    sys.stdout.write(out)
+    sys.stderr.write(err)
+
+if __name__ == '__main__':
+    main()
diff --git a/sql/test/Tests/alastair_udf_mergetable_bug.stable.err 
b/sql/test/Tests/alastair_udf_mergetable_bug.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/alastair_udf_mergetable_bug.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'alastair_udf_mergetable_bug` in directory 'sql/test` itself:
+
+
+# 14:10:49 >  
+# 14:10:49 >  "/usr/bin/python2" "alastair_udf_mergetable_bug.py" 
"alastair_udf_mergetable_bug"
+# 14:10:49 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch2/zhang/monet-install/Jan2014/debug/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 = 31835
+# cmdline opt  mapi_usock = /var/tmp/mtest-11152/.s.monetdb.31835
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch2/zhang/monet-install/Jan2014/debug/var/MonetDB/mTests_sql_test
+# cmdline opt  gdk_nr_threads = 2
+
+# 14:10:50 >  
+# 14:10:50 >  "Done."
+# 14:10:50 >  
+
diff --git a/sql/test/Tests/alastair_udf_mergetable_bug.stable.out 
b/sql/test/Tests/alastair_udf_mergetable_bug.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/alastair_udf_mergetable_bug.stable.out
@@ -0,0 +1,74 @@
+stdout of test 'alastair_udf_mergetable_bug` in directory 'sql/test` itself:
+
+
+# 14:10:49 >  
+# 14:10:49 >  "/usr/bin/python2" "alastair_udf_mergetable_bug.py" 
"alastair_udf_mergetable_bug"
+# 14:10:49 >  
+
+#create table tab1 (group_by_col int, index_col int, f float);
+#create table tab2 (index_col int, f float);
+#insert into tab1 values (1,1,1),(1,2,2),(2,1,3),(2,2,4),(3,1,5),(3,2,6);
+[ 6    ]
+#insert into tab2 values (1,111),(2,222),(3,333),(4,444);
+[ 4    ]
+#set optimizer='default_pipe';
+#select optimizer;
+% .L # table_name
+% single_value # name
+% varchar # type
+% 12 # length
+[ "default_pipe"       ]
+#select tab1.group_by_col,SUM(fuse(tab1.f,tab2.f)) from tab2 inner join tab1 
on tab1.index_col = tab2.index_col group by tab1.group_by_col;
+% sys.tab1,    sys.L1 # table_name
+% group_by_col,        L1 # name
+% int, bigint # type
+% 1,   11 # length
+[ 1,   12884902221     ]
+[ 2,   30064771405     ]
+[ 3,   47244640589     ]
+#drop table tab1;
+#drop table tab2;
+# MonetDB 5 server v11.17.14
+# This is an unreleased version
+# Serving database 'mTests_sql_test', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.591 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://riga.ins.cwi.nl:31835/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-11152/.s.monetdb.31835
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_compress.sql
+# loading sql script: 18_dictionary.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 46_gsl.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 14:10:50 >  
+# 14:10:50 >  "Done."
+# 14:10:50 >  
+
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to