Changeset: 14192af45225 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=14192af45225
Added Files:
        sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.sql
        
sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.err
        
sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.sql
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.err
        
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.err.int128
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
        
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
Modified Files:
        java/tests/Test_CisValid.java
        sql/jdbc/tests/Tests/Test_CisValid.stable.err
        sql/test/BugTracker-2016/Tests/All
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Jun2016 branch.


diffs (truncated from 23166 to 300 lines):

diff --git a/java/tests/Test_CisValid.java b/java/tests/Test_CisValid.java
--- a/java/tests/Test_CisValid.java
+++ b/java/tests/Test_CisValid.java
@@ -18,15 +18,23 @@ public class Test_CisValid {
                Connection conn = DriverManager.getConnection(args[0]);
                Statement stmt = conn.createStatement();
 
-               conn.setAutoCommit(false); // start a transaction
                try {
+                       conn.setAutoCommit(false); // start a transaction
                        stmt.execute("SELECT COUNT(*) FROM doesnotexist;"); // 
let's trigger an error
                } catch (SQLException e) {
-                       e.printStackTrace();
-                       System.out.println("Validating connection: 
conn.isValid? " + conn.isValid(30)); // Can we rollback on this connection?
-                       conn.rollback();
+                       // e.printStackTrace();
+                       System.err.println("Expected error: " + e);
+
+                       try {
+                               // test calling conn.isValid()
+                               System.out.println("Validating connection: 
conn.isValid? " + conn.isValid(30));
+                               // Can we rollback on this connection without 
causing an error?
+                               conn.rollback();
+                       } catch (SQLException e2) {
+                               System.err.println("UnExpected error: " + e2);
+                       }
                }
-                       
+
                stmt.close();
                conn.close();
        }
diff --git a/sql/jdbc/tests/Tests/Test_CisValid.stable.err 
b/sql/jdbc/tests/Tests/Test_CisValid.stable.err
--- a/sql/jdbc/tests/Tests/Test_CisValid.stable.err
+++ b/sql/jdbc/tests/Tests/Test_CisValid.stable.err
@@ -35,12 +35,7 @@ stderr of test 'Test_CisValid` in direct
 # 23:03:08 >  java Test_CisValid 
"jdbc:monetdb://toulouse:36086/mTests_sql_jdbc_tests?user=monetdb&password=monetdb"
 # 23:03:08 >  
 
-java.sql.SQLException: SELECT: no such table 'doesnotexist'
-       at 
nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery(MonetConnection.java:2602)
-       at 
nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.processQuery(MonetConnection.java:2350)
-       at 
nl.cwi.monetdb.jdbc.MonetStatement.internalExecute(MonetStatement.java:507)
-       at nl.cwi.monetdb.jdbc.MonetStatement.execute(MonetStatement.java:345)
-       at Test_CisValid.main(Test_CisValid.java:23)
+Expected error: java.sql.SQLException: SELECT: no such table 'doesnotexist'
 
 # 23:03:08 >  
 # 23:03:08 >  "Done."
diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -1,3 +1,5 @@
+convert-function-test.Bug-3460
+HAVE_HGE?convert-function-test-hge.Bug-3460
 HAVE_GEOM?storagemodel
 LEFT-JOIN_with_OR_conditions_triggers_assertion.Bug-3908
 incorrect_column_name_in_OR_condition_of_LEFT-JOIN_crashes_mserver.Bug-3909
diff --git 
a/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.sql 
b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.sql
@@ -0,0 +1,97 @@
+-- test SQL functions: convert(fromType, toType) and cast(fromType as toType) 
for all SQL data types and data values
+-- See also https://www.monetdb.org/bugzilla/show_bug.cgi?id=3460
+
+-- HUGEINT  (for int128 only)
+CREATE TABLE T_hugeint (v hugeint);
+INSERT into T_hugeint VALUES (1), (0), (-1), (-127), (127), (-32767), (32767), 
(-2147483647), (2147483647);
+INSERT into T_hugeint VALUES (null);
+SELECT v FROM T_hugeint ORDER BY v;
+
+-- test convert()
+SELECT v, convert(v, boolean) from T_hugeint;
+SELECT v, convert(v, bit) from T_hugeint; -- BIT not valid data type
+SELECT v, convert(v, tinyint) from T_hugeint where v between -127 and 127;
+SELECT v, convert(v, smallint) from T_hugeint where v between -32767 and 32767;
+SELECT v, convert(v, integer) from T_hugeint;
+SELECT v, convert(v, bigint) from T_hugeint;
+SELECT v, convert(v, hugeint) from T_hugeint;
+
+SELECT v, convert(v, float) from T_hugeint;
+SELECT v, convert(v, float(24)) from T_hugeint;
+SELECT v, convert(v, real) from T_hugeint;
+SELECT v, convert(v, double) from T_hugeint;
+SELECT v, convert(v, double precision) from T_hugeint;
+
+SELECT v, convert(v, numeric) from T_hugeint;
+SELECT v, convert(v, decimal) from T_hugeint;
+SELECT v, convert(v, numeric(10)) from T_hugeint;
+SELECT v, convert(v, decimal(11)) from T_hugeint;
+SELECT v, convert(v, numeric(12,0)) from T_hugeint;
+SELECT v, convert(v, decimal(15,3)) from T_hugeint;
+
+SELECT v, convert(v, char) from T_hugeint where v between 0 and 1;
+SELECT v, convert(v, varchar) from T_hugeint; -- missing length specification
+SELECT v, convert(v, varchar(16)) from T_hugeint;
+SELECT v, convert(v, longvarchar) from T_hugeint; -- LONGVARCHAR not valid 
data type
+SELECT v, convert(v, long varchar) from T_hugeint; -- LONG VARCHAR not valid 
data type
+SELECT v, convert(v, CHARACTER LARGE OBJECT) from T_hugeint;
+SELECT v, convert(v, Clob) from T_hugeint;
+
+SELECT v, convert(v, Binary) from T_hugeint; -- BINARY not valid data type
+SELECT v, convert(v, varBinary) from T_hugeint; -- VARBINARY not valid data 
type
+SELECT v, convert(v, longvarBinary) from T_hugeint; -- LONGVARBINARY not valid 
data type
+SELECT v, convert(v, Blob) from T_hugeint; -- conversion not supported
+
+SELECT v, convert(v, date) from T_hugeint; -- conversion not supported
+SELECT v, convert(v, time) from T_hugeint; -- conversion not supported
+SELECT v, convert(v, timestamp) from T_hugeint; -- conversion not supported
+SELECT v, convert(v, time with timezone) from T_hugeint; -- data type not 
supported (parse error)
+SELECT v, convert(v, timestamp with timezone) from T_hugeint; -- data type not 
supported (parse error)
+SELECT v, convert(v, timetz) from T_hugeint; -- conversion not supported
+SELECT v, convert(v, timestamptz) from T_hugeint; -- conversion not supported
+
+-- test cast()
+SELECT v, cast(v as boolean) from T_hugeint;
+SELECT v, cast(v as bit) from T_hugeint; -- BIT not valid data type
+SELECT v, cast(v as tinyint) from T_hugeint where v between -127 and 127;
+SELECT v, cast(v as smallint) from T_hugeint where v between -32767 and 32767;
+SELECT v, cast(v as integer) from T_hugeint;
+SELECT v, cast(v as bigint) from T_hugeint;
+SELECT v, cast(v as hugeint) from T_hugeint;
+
+SELECT v, cast(v as float) from T_hugeint;
+SELECT v, cast(v as float(24)) from T_hugeint;
+SELECT v, cast(v as real) from T_hugeint;
+SELECT v, cast(v as double) from T_hugeint;
+SELECT v, cast(v as double precision) from T_hugeint;
+
+SELECT v, cast(v as numeric) from T_hugeint;
+SELECT v, cast(v as decimal) from T_hugeint;
+SELECT v, cast(v as numeric(10)) from T_hugeint;
+SELECT v, cast(v as decimal(11)) from T_hugeint;
+SELECT v, cast(v as numeric(12,0)) from T_hugeint;
+SELECT v, cast(v as decimal(15,3)) from T_hugeint;
+
+SELECT v, cast(v as char) from T_hugeint where v between 0 and 1;
+SELECT v, cast(v as varchar) from T_hugeint; -- missing length specification
+SELECT v, cast(v as varchar(16)) from T_hugeint;
+SELECT v, cast(v as longvarchar) from T_hugeint; -- LONGVARCHAR not valid data 
type
+SELECT v, cast(v as long varchar) from T_hugeint; -- LONG VARCHAR not valid 
data type
+SELECT v, cast(v as CHARACTER LARGE OBJECT) from T_hugeint;
+SELECT v, cast(v as Clob) from T_hugeint;
+
+SELECT v, cast(v as Binary) from T_hugeint; -- BINARY not valid data type
+SELECT v, cast(v as varBinary) from T_hugeint; -- VARBINARY not valid data type
+SELECT v, cast(v as longvarBinary) from T_hugeint; -- LONGVARBINARY not valid 
data type
+SELECT v, cast(v as Blob) from T_hugeint; -- conversion not supported
+
+SELECT v, cast(v as date) from T_hugeint; -- conversion not supported
+SELECT v, cast(v as time) from T_hugeint; -- conversion not supported
+SELECT v, cast(v as timestamp) from T_hugeint; -- conversion not supported
+SELECT v, cast(v as time with timezone) from T_hugeint; -- data type not 
supported (parse error)
+SELECT v, cast(v as timestamp with timezone) from T_hugeint; -- data type not 
supported (parse error)
+SELECT v, cast(v as timetz) from T_hugeint; -- conversion not supported
+SELECT v, cast(v as timestamptz) from T_hugeint; -- conversion not supported
+
+DROP TABLE T_hugeint;
+
diff --git 
a/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.err 
b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.err
@@ -0,0 +1,137 @@
+stderr of test 'convert-function-test-hge.Bug-3460` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 19:15:21 >  
+# 19:15:21 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36439" "--set" 
"mapi_usock=/var/tmp/mtest-11655/.s.monetdb.36439" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2016"
 "--set" "embedded_r=yes"
+# 19:15:21 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/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 = 36439
+# cmdline opt  mapi_usock = /var/tmp/mtest-11655/.s.monetdb.36439
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2016
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 19:15:22 >  
+# 19:15:22 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-11655" "--port=36439"
+# 19:15:22 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, bit) from T_hugeint; -- BIT not valid data type
+ERROR = !type (bit) unknown in: "select v, convert(v, bit)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, varchar) from T_hugeint; -- missing length 
specification
+ERROR = !CHARACTER VARYING needs a mandatory length specification in: "select 
v, convert(v, varchar)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, longvarchar) from T_hugeint; -- LONGVARCHAR not 
valid data type
+ERROR = !type (longvarchar) unknown in: "select v, convert(v, longvarchar)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, long varchar) from T_hugeint; -- LONG VARCHAR not 
valid data type
+ERROR = !type (long) unknown in: "select v, convert(v, long varchar"
+        !syntax error, unexpected ')' in: ")"
+MAPI  = (monetdb) /var/tmp/mtest-10564/.s.monetdb.32160
+QUERY = SELECT v, convert(v, Binary) from T_hugeint; -- BINARY not valid data 
type
+ERROR = !syntax error, unexpected ')', expecting LARGE in: "select v, 
convert(v, binary)"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, varBinary) from T_hugeint; -- VARBINARY not valid 
data type
+ERROR = !type (varbinary) unknown in: "select v, convert(v, varbinary)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, longvarBinary) from T_hugeint; -- LONGVARBINARY 
not valid data type
+ERROR = !type (longvarbinary) unknown in: "select v, convert(v, longvarbinary)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, Blob) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and blob(0,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, date) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and date(0,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, time) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and time(1,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, timestamp) from T_hugeint; -- conversion not 
supported
+ERROR = !types hugeint(128,0) and timestamp(7,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, time with timezone) from T_hugeint; -- data type 
not supported (parse error)
+ERROR = !syntax error, unexpected IDENT, expecting TIME in: "select v, 
convert(v, time with timezone"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, timestamp with timezone) from T_hugeint; -- data 
type not supported (parse error)
+ERROR = !syntax error, unexpected IDENT, expecting TIME in: "select v, 
convert(v, timestamp with timezone"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, timetz) from T_hugeint; -- conversion not 
supported
+ERROR = !types hugeint(128,0) and timetz(7,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, convert(v, timestamptz) from T_hugeint; -- conversion not 
supported
+ERROR = !types hugeint(128,0) and timestamptz(7,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as bit) from T_hugeint; -- BIT not valid data type
+ERROR = !type (bit) unknown in: "select v, cast(v as bit)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as varchar) from T_hugeint; -- missing length 
specification
+ERROR = !CHARACTER VARYING needs a mandatory length specification in: "select 
v, cast(v as varchar)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as longvarchar) from T_hugeint; -- LONGVARCHAR not 
valid data type
+ERROR = !type (longvarchar) unknown in: "select v, cast(v as longvarchar)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as long varchar) from T_hugeint; -- LONG VARCHAR not 
valid data type
+ERROR = !type (long) unknown in: "select v, cast(v as long varchar"
+        !syntax error, unexpected ')' in: ")"
+MAPI  = (monetdb) /var/tmp/mtest-10564/.s.monetdb.32160
+QUERY = SELECT v, cast(v as Binary) from T_hugeint; -- BINARY not valid data 
type
+ERROR = !syntax error, unexpected ')', expecting LARGE in: "select v, cast(v 
as binary)"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as varBinary) from T_hugeint; -- VARBINARY not valid 
data type
+ERROR = !type (varbinary) unknown in: "select v, cast(v as varbinary)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as longvarBinary) from T_hugeint; -- LONGVARBINARY 
not valid data type
+ERROR = !type (longvarbinary) unknown in: "select v, cast(v as longvarbinary)"
+        !syntax error, unexpected FROM in: "from"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as Blob) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and blob(0,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as date) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and date(0,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as time) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and time(1,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as timestamp) from T_hugeint; -- conversion not 
supported
+ERROR = !types hugeint(128,0) and timestamp(7,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as time with timezone) from T_hugeint; -- data type 
not supported (parse error)
+ERROR = !syntax error, unexpected IDENT, expecting TIME in: "select v, cast(v 
as time with timezone"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as timestamp with timezone) from T_hugeint; -- data 
type not supported (parse error)
+ERROR = !syntax error, unexpected IDENT, expecting TIME in: "select v, cast(v 
as timestamp with timezone"
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as timetz) from T_hugeint; -- conversion not supported
+ERROR = !types hugeint(128,0) and timetz(7,0) are not equal for column 'v'
+MAPI  = (monetdb) /var/tmp/mtest-11655/.s.monetdb.36439
+QUERY = SELECT v, cast(v as timestamptz) from T_hugeint; -- conversion not 
supported
+ERROR = !types hugeint(128,0) and timestamptz(7,0) are not equal for column 'v'
+
+# 19:15:22 >  
+# 19:15:22 >  "Done."
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to