Changeset: 6a8ce351c2c9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6a8ce351c2c9
Modified Files:
sql/test/mergetables/Tests/merge-tables-limitations.test
sql/test/mergetables/Tests/mergetable00.test
sql/test/mergetables/Tests/mergetable01.test
testing/sqllogictest.py
Branch: Sep2022
Log Message:
Remove some superfluous whitespace when approving tests.
diffs (249 lines):
diff --git a/sql/test/mergetables/Tests/merge-tables-limitations.test
b/sql/test/mergetables/Tests/merge-tables-limitations.test
--- a/sql/test/mergetables/Tests/merge-tables-limitations.test
+++ b/sql/test/mergetables/Tests/merge-tables-limitations.test
@@ -72,7 +72,6 @@ ALTER TABLE tst.mtbl ADD TABLE tmp.mtbl
statement error 42000!ALTER TABLE: a MERGE TABLE can't be a child of itself
ALTER TABLE tst.mtbl ADD TABLE tst.mtbl
-
statement ok
CREATE REPLICA TABLE tmp.rtbl (c1 int)
-- this succeeds strangely
@@ -136,7 +135,6 @@ select * from tst.mtbl
statement ok
ALTER TABLE tst.mtbl DROP TABLE tst.rtbl
-
statement ok
CREATE UNLOGGED TABLE tmp.utbl (c1 int)
-- this succeeds strangely
@@ -200,7 +198,6 @@ select * from tst.mtbl
statement ok
ALTER TABLE tst.mtbl DROP TABLE tst.utbl
-
statement ok
CREATE REMOTE TABLE tmp.rmtbl (c1 int) ON 'mapi:monetdb://localhost:50000/demo'
-- this succeeds strangely
@@ -264,7 +261,6 @@ select * from tst.mtbl
statement ok
ALTER TABLE tst.mtbl DROP TABLE tst.rmtbl
-
statement ok
CREATE LOCAL TEMP TABLE tmp.lttbl (c1 int) ON COMMIT PRESERVE ROWS
@@ -293,7 +289,6 @@ ALTER TABLE tmp.mtbl ADD TABLE tmp.lttbl
statement error 42000!ALTER TABLE: can't add/drop a temporary table into a
MERGE TABLE
ALTER TABLE tst.mtbl ADD TABLE tmp.lttbl
-
statement ok
CREATE GLOBAL TEMP TABLE tmp.gttbl (c1 int) ON COMMIT PRESERVE ROWS
@@ -322,7 +317,6 @@ ALTER TABLE tmp.mtbl ADD TABLE tmp.gttbl
statement error 42000!ALTER TABLE: can't add/drop a temporary table into a
MERGE TABLE
ALTER TABLE tst.mtbl ADD TABLE tmp.gttbl
-
--cleanup
query TT rowsort
select schema, name from tst.my_tables order by 1,2
diff --git a/sql/test/mergetables/Tests/mergetable00.test
b/sql/test/mergetables/Tests/mergetable00.test
--- a/sql/test/mergetables/Tests/mergetable00.test
+++ b/sql/test/mergetables/Tests/mergetable00.test
@@ -1,8 +1,8 @@
-@connection(id=1, username=monetdb, password=monetdb)
+@connection(id=1, username=monetdb, password=monetdb)
statement ok
CREATE MERGE TABLE parent(a int)
-@connection(id=2, username=monetdb, password=monetdb)
+@connection(id=2, username=monetdb, password=monetdb)
statement ok
CREATE TABLE child1(a int)
@@ -48,7 +48,7 @@ alter table parent add table child2
@connection(id=2)
statement ok
-drop table child2;
+drop table child2
@connection(id=2)
statement ok
@@ -69,25 +69,25 @@ 6
@connection(id=1)
query I nosort
-select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent');
+select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent')
----
2
@connection(id=2)
query I nosort
-select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent');
+select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent')
----
2
-# cleanup
+# cleanup
@connection(id=1)
statement ok
-drop table parent;
+drop table parent
@connection(id=1)
statement ok
-drop table child1;
+drop table child1
#@connection(id=1)
#statement ok
@@ -95,6 +95,5 @@ drop table child1;
@connection(id=1)
statement ok
-drop table child3;
+drop table child3
-
diff --git a/sql/test/mergetables/Tests/mergetable01.test
b/sql/test/mergetables/Tests/mergetable01.test
--- a/sql/test/mergetables/Tests/mergetable01.test
+++ b/sql/test/mergetables/Tests/mergetable01.test
@@ -1,4 +1,4 @@
-@connection(id=2, username=monetdb, password=monetdb)
+@connection(id=2, username=monetdb, password=monetdb)
statement ok
CREATE TABLE child1(a int)
@@ -14,7 +14,7 @@ CREATE TABLE child2(a int)
statement ok rowcount 2
INSERT INTO child2 VALUES (3),(4)
-@connection(id=3, username=monetdb, password=monetdb)
+@connection(id=3, username=monetdb, password=monetdb)
statement ok
start transaction
@@ -22,7 +22,7 @@ start transaction
statement ok
start transaction
-@connection(id=1, username=monetdb, password=monetdb)
+@connection(id=1, username=monetdb, password=monetdb)
statement ok
start transaction
@@ -40,7 +40,7 @@ alter table parent add table child2
@connection(id=2)
statement ok
-drop table child2;
+drop table child2
@connection(id=1)
statement ok
@@ -52,20 +52,21 @@ commit
@connection(id=1)
query I nosort
-select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent');
+select count(*) from sys.objects where nr = ( select id from sys._tables where
name = 'parent')
----
2
-# cleanup
+# cleanup
@connection(id=1)
statement ok
-drop table parent;
+drop table parent
@connection(id=1)
statement ok
-drop table child1;
+drop table child1
@connection(id=1)
statement ok
-drop table child2;
+drop table child2
+
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -667,10 +667,10 @@ class SQLLogic:
if not line:
break
if line.startswith('#'): # skip mal comments
- self.writeline(line.rstrip('\n'))
+ self.writeline(line.rstrip())
continue
if self.language == 'sql' and line.startswith('--'):
- self.writeline(line.rstrip('\n'))
+ self.writeline(line.rstrip())
continue
if line == '\n':
self.writeline()
@@ -680,7 +680,7 @@ class SQLLogic:
if line.startswith('@connection'):
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)
+ self.writeline(line.rstrip())
line = self.readline()
words = line.split()
if not words:
@@ -690,13 +690,13 @@ class SQLLogic:
skipping = True
elif words[0] == 'onlyif' and words[1] != 'MonetDB':
skipping = True
- self.writeline(line)
+ self.writeline(line.rstrip())
line = self.readline()
words = line.split()
hashlabel = None
if words[0] == 'hash-threshold':
self.threshold = int(words[1])
- self.writeline(line)
+ self.writeline(line.rstrip())
self.writeline()
elif words[0] == 'statement':
expected_err_code = None
@@ -729,8 +729,13 @@ class SQLLogic:
self.writeline(' '.join(result))
else:
self.writeline(stline)
+ dostrip = True
for line in statement:
+ if dostrip:
+ line = line.rstrip()
self.writeline(line, replace=True)
+ if dostrip and '<COPY_INTO_DATA>' in line:
+ dostrip = False
self.writeline()
elif words[0] == 'query':
columns = words[1]
@@ -776,14 +781,14 @@ class SQLLogic:
result1, result2 = self.exec_query('\n'.join(query),
columns, sorting, pyscript, hashlabel, nresult, hash, expected, conn=conn,
verbose=verbose)
self.writeline(' '.join(result1))
for line in query:
- self.writeline(line, replace=True)
+ self.writeline(line.rstrip(), replace=True)
self.writeline('----')
for line in result2:
self.writeline(line)
else:
- self.writeline(qrline)
+ self.writeline(qrline.rstrip())
for line in query:
- self.writeline(line)
+ self.writeline(line.rstrip())
self.writeline('----')
if hash:
self.writeline('{} values hashing to {}'.format(
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]