Changeset: 783473a08491 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/783473a08491
Added Files:
        sql/test/miscellaneous/Tests/mergetable-deps-crash.test
Modified Files:
        sql/test/miscellaneous/Tests/All
        testing/sqllogictest.py
Branch: Jul2021
Log Message:

add new (crashing) test


diffs (76 lines):

diff --git a/sql/test/miscellaneous/Tests/All b/sql/test/miscellaneous/Tests/All
--- a/sql/test/miscellaneous/Tests/All
+++ b/sql/test/miscellaneous/Tests/All
@@ -21,3 +21,4 @@ vessels
 prepare
 transaction_isolation
 transaction_isolation2
+mergetable-deps-crash
diff --git a/sql/test/miscellaneous/Tests/mergetable-deps-crash.test 
b/sql/test/miscellaneous/Tests/mergetable-deps-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/miscellaneous/Tests/mergetable-deps-crash.test
@@ -0,0 +1,40 @@
+@connection(id=1, username=monetdb, password=monetdb)
+statement ok
+create table child (i int);
+
+@connection(id=1)
+statement ok
+start transaction;
+
+@connection(id=2, username=monetdb, password=monetdb)
+statement ok
+start transaction;
+
+@connection(id=1)
+statement ok
+create merge table mt (i int);
+
+@connection(id=1)
+statement ok
+alter table mt add table child;
+
+@connection(id=2)
+statement ok
+drop table child;
+
+@connection(id=1)
+statement ok
+commit;
+
+@connection(id=2)
+statement ok
+commit;
+
+@connection(id=1)
+query I rowsort
+select * from mt;
+----
+
+@connection(id=1)
+statement ok
+drop table mt;
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -575,8 +575,9 @@ class SQLLogic:
         '''parse strings like @connection(id=con1, ...)
         '''
         res = dict()
+        s = s.strip()
         if not (s.startswith('@connection(') and s.endswith(')')):
-            self.raise_error('invalid connection string!')
+            self.raise_error(f'ERROR: invalid connection string {s}!')
         params = s[12:-1].split(',')
         for p in params:
             p = p.strip()
@@ -616,7 +617,7 @@ class SQLLogic:
             conn = None
             # look for connection string
             if line.startswith('@connection'):
-                conn_params = parse_connection_string(line)
+                conn_params = self.parse_connection_string(line)
                 conn = self.get_connection(conn_params.get('conn_id')) or 
self.add_connection(**conn_params)
                 self.writeline(line)
                 line = self.readline()
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to