Changeset: 0e9905cfd900 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0e9905cfd900
Added Files:
        
sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.sql
        
sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.err
        
sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.out
Modified Files:
        sql/test/BugTracker-2012/Tests/All
Branch: Oct2012
Log Message:

Add test for BUG type_resolution_error_in_SQL_procedural_code Buf-3143


diffs (261 lines):

diff --git a/sql/test/BugTracker-2012/Tests/All 
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -72,3 +72,4 @@ row_number_does_not_work_in_complex_quer
 day-of-month-localization.Bug-2962
 scalar_subquery_with_alias.Bug-3093
 power_priority.Bug-2291
+type_resolution_error_in_SQL_procedural_code.Buf-3143
diff --git 
a/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.sql
 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.sql
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.sql
@@ -0,0 +1,86 @@
+-- the raw input stream received at receptor
+CREATE TABLE istream(
+       ip        INET,
+       location  VARCHAR(5),
+       kind      VARCHAR(50),
+       value     DOUBLE
+);
+
+-- collect the sensors in certain areas
+CREATE TABLE area(
+       ip INET,
+       location varchar(5),
+       primary key(ip)
+); 
+
+-- tag the events with their arrival time
+CREATE TABLE sensors(
+       like istream,
+       time timestamp default now()
+);
+
+-- administer the fire state in locations
+CREATE TABLE states(
+       location varchar(5),
+       time timestamp default now(),
+       status varchar(20) default 'normal'
+);
+
+-- warden emitter mailbox
+CREATE TABLE warden(
+       location varchar(5),
+       message  varchar(20)
+);
+
+-- observations made by the warden 
+CREATE TABLE observations(
+       location varchar(5),
+       message  varchar(20) 
+);
+
+CREATE PROCEDURE enrich_a()
+BEGIN
+    INSERT INTO sensors(ip, location, kind,value)
+        SELECT ip, substring(location,0,3), kind, value FROM istream;
+    IF TRUE
+    THEN
+        INSERT INTO area SELECT ip, substring(location,0,3) FROM
+istream;
+    END IF;
+END;
+
+CREATE PROCEDURE enrich_b()
+BEGIN
+    INSERT INTO sensors(ip, location, kind,value)
+        SELECT ip, substring(location,0,3), kind, value FROM istream;
+    IF (SELECT count(*) FROM area ) = 0
+    THEN
+        INSERT INTO area SELECT ip, substring(location,0,3) FROM
+istream;
+    END IF;
+END;
+
+
+CREATE PROCEDURE enrich_c()
+BEGIN
+    DECLARE cnt INTEGER;
+    SET cnt = (SELECT count(*) FROM area ) ;
+    INSERT INTO sensors(ip, location, kind,value)
+        SELECT ip, substring(location,0,3), kind, value FROM istream;
+    IF cnt = 0
+    THEN
+        INSERT INTO area SELECT ip, substring(location,0,3) FROM
+istream;
+    END IF;
+END;
+
+drop procedure enrich_a();
+drop procedure enrich_b();
+drop procedure enrich_c();
+
+drop TABLE istream;
+drop TABLE area;
+drop TABLE sensors;
+drop TABLE states;
+drop TABLE warden;
+drop TABLE observations;
diff --git 
a/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.err
 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.err
@@ -0,0 +1,42 @@
+stderr of test 'type_resolution_error_in_SQL_procedural_code.Buf-3143` in 
directory 'test/BugTracker-2012` itself:
+
+
+# 15:17:51 >  
+# 15:17:51 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/ufs/goncalve/scratch/MonetDB/current/debug/MonetDB/var/MonetDB" 
"--set" "mapi_open=true" "--set" "mapi_port=35055" "--set" "monet_prompt=" 
"--trace" "--forcemito" "--set" "mal_listing=2" 
"--dbname=mTests_test_BugTracker-2012" "--set" "mal_listing=0"
+# 15:17:51 >  
+
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = 
/ufs/goncalve/scratch/MonetDB/current/debug/MonetDB/var/monetdb5/dbfarm
+# builtin opt  gdk_debug = 0
+# 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  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  gdk_dbfarm = 
/ufs/goncalve/scratch/MonetDB/current/debug/MonetDB/var/MonetDB
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 35055
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2012
+# cmdline opt  mal_listing = 0
+
+# 15:17:51 >  
+# 15:17:51 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=lyon" 
"--port=35055"
+# 15:17:51 >  
+
+MAPI  = monetdb@lyon:35055
+QUERY = HERE WE SHOULD HAVE A ERROR REPORTING THAT THE CREATION OF enrich_b() 
FAILED;
+
+MAPI  = monetdb@lyon:35055
+QUERY = drop procedure enrich_b();
+
+
+# 15:17:52 >  
+# 15:17:52 >  "Done."
+# 15:17:52 >  
+
diff --git 
a/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.out
 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2012/Tests/type_resolution_error_in_SQL_procedural_code.Buf-3143.stable.out
@@ -0,0 +1,110 @@
+stdout of test 'type_resolution_error_in_SQL_procedural_code.Buf-3143` in 
directory 'test/BugTracker-2012` itself:
+
+
+# 15:17:51 >  
+# 15:17:51 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/ufs/goncalve/scratch/MonetDB/current/debug/MonetDB/var/MonetDB" 
"--set" "mapi_open=true" "--set" "mapi_port=35055" "--set" "monet_prompt=" 
"--trace" "--forcemito" "--set" "mal_listing=2" 
"--dbname=mTests_test_BugTracker-2012" "--set" "mal_listing=0"
+# 15:17:51 >  
+
+# MonetDB 5 server v11.13.6
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2012', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.629 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://lyon.ins.cwi.nl:35055/
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+# 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_history.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: 39_analytics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 15:17:51 >  
+# 15:17:51 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=lyon" 
"--port=35055"
+# 15:17:51 >  
+
+#CREATE TABLE istream(
+#      ip        INET,
+#      location  VARCHAR(5),
+#      kind      VARCHAR(50),
+#      value     DOUBLE
+#);
+#CREATE TABLE area(
+#      ip INET,
+#      location varchar(5),
+#      primary key(ip)
+#); 
+#CREATE TABLE sensors(
+#      like istream,
+#      time timestamp default now()
+#);
+#CREATE TABLE states(
+#      location varchar(5),
+#      time timestamp default now(),
+#      status varchar(20) default 'normal'
+#);
+#CREATE TABLE warden(
+#      location varchar(5),
+#      message  varchar(20)
+#);
+#CREATE TABLE observations(
+#      location varchar(5),
+#      message  varchar(20) 
+#);
+#CREATE PROCEDURE enrich_a()
+#BEGIN
+#    INSERT INTO sensors(ip, location, kind,value)
+#        SELECT ip, substring(location,0,3), kind, value FROM istream;
+#    IF TRUE
+#    THEN
+#        INSERT INTO area SELECT ip, substring(location,0,3) FROM
+#istream;
+#    END IF;
+#END;
+#CREATE PROCEDURE enrich_c()
+#BEGIN
+#    DECLARE cnt INTEGER;
+#    SET cnt = (SELECT count(*) FROM area ) ;
+#    INSERT INTO sensors(ip, location, kind,value)
+#        SELECT ip, substring(location,0,3), kind, value FROM istream;
+#    IF cnt = 0
+#    THEN
+#        INSERT INTO area SELECT ip, substring(location,0,3) FROM
+#istream;
+#    END IF;
+#END;
+#drop procedure enrich_a();
+#drop procedure enrich_b();
+#drop procedure enrich_c();
+#drop TABLE istream;
+#drop TABLE area;
+#drop TABLE sensors;
+#drop TABLE states;
+#drop TABLE warden;
+#drop TABLE observations;
+
+# 15:17:52 >  
+# 15:17:52 >  "Done."
+# 15:17:52 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to