Changeset: 0fab3241760f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0fab3241760f
Added Files:
        sql/test/prepare/Tests/bind_with_cast.SF-1720934.test
        sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.test
        sql/test/prepare/Tests/decimal_prepare.SF-1655818.test
        sql/test/prepare/Tests/insert-prepare.Bug-7230.test
Removed Files:
        sql/test/prepare/Tests/bind_with_cast.SF-1720934.SQL.py
        sql/test/prepare/Tests/bind_with_cast.SF-1720934.sql
        sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out
        sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.SQL.py
        sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.sql
        sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out
        sql/test/prepare/Tests/decimal_prepare.SF-1655818.SQL.py
        sql/test/prepare/Tests/decimal_prepare.SF-1655818.sql
        sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out
        sql/test/prepare/Tests/insert-prepare.Bug-7230.SQL.py
        sql/test/prepare/Tests/insert-prepare.Bug-7230.sql
        sql/test/prepare/Tests/insert-prepare.Bug-7230.stable.out
Modified Files:
        sql/test/prepare/Tests/prepare_statements_crash_server.Bug-2599.test
        testing/sqllogictest.py
Branch: Mar2025
Log Message:

Convert tests to .test format.
New feature in .test format: the string <LAST_PREPARE_ID> is replaced
with the prepare ID of the last PREPARE query (like ** in the old .sql
test files).


diffs (truncated from 1044 to 300 lines):

diff --git a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.SQL.py 
b/sql/test/prepare/Tests/bind_with_cast.SF-1720934.SQL.py
deleted file mode 100644
--- a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.SQL.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
-
-with SQLTestCase() as tc:
-    # optional or default connection
-    tc.connect()
-    with open('bind_with_cast.SF-1720934.sql') as f:
-        tc.execute(query=None, client='mclient', stdin=f)\
-            .assertSucceeded()\
-            .assertMatchStableOut(fout='bind_with_cast.SF-1720934.stable.out')
diff --git a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.sql 
b/sql/test/prepare/Tests/bind_with_cast.SF-1720934.sql
deleted file mode 100644
--- a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE data_1mto10m (
-id      INTEGER,
-col1   INTEGER,
-col2   VARCHAR(5)
-) ;
-PREPARE select id from data_1mto10m where id > CAST(? AS INTEGER) limit 10;
-exec **('100');
diff --git a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out 
b/sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out
deleted file mode 100644
--- a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out
+++ /dev/null
@@ -1,18 +0,0 @@
-#CREATE TABLE data_1mto10m (
-#id      INTEGER,
-#col1   INTEGER,
-#col2   VARCHAR(5)
-#) ;
-#PREPARE select id from data_1mto10m where id > CAST(? AS INTEGER) limit 10;
-#PREPARE select id from data_1mto10m where id > CAST(? AS INTEGER) limit 10;
-% .prepare,    .prepare,       .prepare,       .prepare,       .prepare,       
.prepare # table_name
-% type,        digits, scale,  schema, table,  column # name
-% varchar,     int,    int,    varchar,        varchar,        varchar # type
-% 3,   2,      1,      0,      12,     2 # length
-[ "int",       31,     0,      "",     "data_1mto10m", "id"    ]
-[ "int",       31,     0,      NULL,   NULL,   NULL    ]
-#exec  0('100');
-% sys.data_1mto10m # table_name
-% id # name
-% int # type
-% 1 # length
diff --git a/sql/test/prepare/Tests/bind_with_cast.SF-1720934.test 
b/sql/test/prepare/Tests/bind_with_cast.SF-1720934.test
new file mode 100644
--- /dev/null
+++ b/sql/test/prepare/Tests/bind_with_cast.SF-1720934.test
@@ -0,0 +1,27 @@
+statement ok
+CREATE TABLE data_1mto10m (
+id      INTEGER,
+col1   INTEGER,
+col2   VARCHAR(5)
+)
+
+query TIITTT nosort
+PREPARE select id from data_1mto10m where id > CAST(? AS INTEGER) limit 10
+----
+int
+31
+0
+(empty)
+data_1mto10m
+id
+int
+31
+0
+NULL
+NULL
+NULL
+
+query I nosort
+exec <LAST_PREPARE_ID>('100')
+----
+
diff --git a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.SQL.py 
b/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.SQL.py
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.SQL.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
-
-with SQLTestCase() as tc:
-    # optional or default connection
-    tc.connect()
-    tc.drop()
-    with open('decimal_needs_truncation.SF-2605686.sql') as f:
-        tc.execute(query=None, client='mclient', stdin=f)\
-            .assertSucceeded()\
-            
.assertMatchStableOut(fout='decimal_needs_truncation.SF-2605686.stable.out')
diff --git a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.sql 
b/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.sql
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-
-create table testdec(testdec decimal(4,4));
-drop table testdec;
-
-create table testdec(testdec decimal(5,4));
-insert into testdec values (0.12345);
-select * from testdec;
-
-PREPARE INSERT INTO testdec (testdec) values (?);
-exec **(0.12345);
-
-select * from testdec;
-
-drop table testdec;
diff --git 
a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out 
b/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out
+++ /dev/null
@@ -1,28 +0,0 @@
-#create table testdec(testdec decimal(4,4));
-#drop table testdec;
-#create table testdec(testdec decimal(5,4));
-#insert into testdec values (0.12345);
-[ 1    ]
-#select * from testdec;
-% sys.testdec # table_name
-% testdec # name
-% decimal # type
-% 7 # length
-[ 0.1235       ]
-#PREPARE INSERT INTO testdec (testdec) values (?);
-#PREPARE INSERT INTO testdec (testdec) values (?);
-% .prepare,    .prepare,       .prepare,       .prepare,       .prepare,       
.prepare # table_name
-% type,        digits, scale,  schema, table,  column # name
-% varchar,     int,    int,    varchar,        varchar,        varchar # type
-% 7,   1,      1,      0,      0,      0 # length
-[ "decimal",   5,      4,      NULL,   NULL,   NULL    ]
-#exec  0(0.12345);
-[ 1    ]
-#select * from testdec;
-% sys.testdec # table_name
-% testdec # name
-% decimal # type
-% 7 # length
-[ 0.1235       ]
-[ 0.1235       ]
-#drop table testdec;
diff --git a/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.test 
b/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.test
new file mode 100644
--- /dev/null
+++ b/sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.test
@@ -0,0 +1,39 @@
+statement ok
+create table testdec(testdec decimal(4,4))
+
+statement ok
+drop table testdec
+
+statement ok
+create table testdec(testdec decimal(5,4))
+
+statement ok
+insert into testdec values (0.12345)
+
+query R nosort
+select * from testdec
+----
+0.123
+
+query TIITTT nosort
+PREPARE INSERT INTO testdec (testdec) values (?)
+----
+decimal
+5
+4
+NULL
+NULL
+NULL
+
+statement ok
+exec <LAST_PREPARE_ID>(0.12345)
+
+query R nosort
+select * from testdec
+----
+0.123
+0.123
+
+statement ok
+drop table testdec
+
diff --git a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.SQL.py 
b/sql/test/prepare/Tests/decimal_prepare.SF-1655818.SQL.py
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.SQL.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
-
-with SQLTestCase() as tc:
-    # optional or default connection
-    tc.connect()
-    with open('decimal_prepare.SF-1655818.sql') as f:
-        tc.execute(query=None, client='mclient', stdin=f)\
-            .assertSucceeded()\
-            .assertMatchStableOut(fout='decimal_prepare.SF-1655818.stable.out')
diff --git a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.sql 
b/sql/test/prepare/Tests/decimal_prepare.SF-1655818.sql
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- origin: Anders Blaagaard
-
-START TRANSACTION;
-
-create table P1655818 (
-       time timestamp not null,
-       x numeric(5,2) not null,
-       y numeric(5,2) not null
-);
-
-PREPARE insert into P1655818 (time,x,y) values (?,?,?);
-
-exec **(timestamp '2003-01-30 18:03:35.0', 71.91, 71.98);
-
-ROLLBACK;
diff --git a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out 
b/sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out
deleted file mode 100644
--- a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out
+++ /dev/null
@@ -1,18 +0,0 @@
-#START TRANSACTION;
-#create table P1655818 (
-#      time timestamp not null,
-#      x numeric(5,2) not null,
-#      y numeric(5,2) not null
-#);
-#PREPARE insert into P1655818 (time,x,y) values (?,?,?);
-#PREPARE insert into P1655818 (time,x,y) values (?,?,?);
-% .prepare,    .prepare,       .prepare,       .prepare,       .prepare,       
.prepare # table_name
-% type,        digits, scale,  schema, table,  column # name
-% varchar,     int,    int,    varchar,        varchar,        varchar # type
-% 9,   1,      1,      0,      0,      0 # length
-[ "timestamp", 7,      0,      NULL,   NULL,   NULL    ]
-[ "decimal",   5,      2,      NULL,   NULL,   NULL    ]
-[ "decimal",   5,      2,      NULL,   NULL,   NULL    ]
-#exec  0(timestamp '2003-01-30 18:03:35.0', 71.91, 71.98);
-[ 1    ]
-#ROLLBACK;
diff --git a/sql/test/prepare/Tests/decimal_prepare.SF-1655818.test 
b/sql/test/prepare/Tests/decimal_prepare.SF-1655818.test
new file mode 100644
--- /dev/null
+++ b/sql/test/prepare/Tests/decimal_prepare.SF-1655818.test
@@ -0,0 +1,40 @@
+-- origin: Anders Blaagaard
+
+statement ok
+START TRANSACTION
+
+statement ok
+create table P1655818 (
+       time timestamp not null,
+       x numeric(5,2) not null,
+       y numeric(5,2) not null
+)
+
+query TIITTT nosort
+PREPARE insert into P1655818 (time,x,y) values (?,?,?)
+----
+timestamp
+7
+0
+NULL
+NULL
+NULL
+decimal
+5
+2
+NULL
+NULL
+NULL
+decimal
+5
+2
+NULL
+NULL
+NULL
+
+statement ok
+exec <LAST_PREPARE_ID>(timestamp '2003-01-30 18:03:35.0', 71.91, 71.98)
+
+statement ok
+ROLLBACK
+
diff --git a/sql/test/prepare/Tests/insert-prepare.Bug-7230.SQL.py 
b/sql/test/prepare/Tests/insert-prepare.Bug-7230.SQL.py
deleted file mode 100644
--- a/sql/test/prepare/Tests/insert-prepare.Bug-7230.SQL.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to