Changeset: 01fe89eebcb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01fe89eebcb1
Branch: mtest
Log Message:

merged


diffs (truncated from 857 to 300 lines):

diff --git a/monetdb5/tools/Tests/mclient-t-s.MAL.py 
b/monetdb5/tools/Tests/mclient-t-s.MAL.py
--- a/monetdb5/tools/Tests/mclient-t-s.MAL.py
+++ b/monetdb5/tools/Tests/mclient-t-s.MAL.py
@@ -8,9 +8,6 @@ def client(args):
     clt = process.client('mal', args = args,
                          stdout = process.PIPE, stderr = process.PIPE)
     out, err = clt.communicate()
-    sys.stdout.write(out)
     sys.stderr.write(err)
 
-sys.stderr.write('#~BeginVariableOutput~#\n')
 client(['-s', 'io.print(123);'])
-sys.stderr.write('#~EndVariableOutput~#\n')
diff --git a/monetdb5/tools/Tests/mserver5-ipv6.py 
b/monetdb5/tools/Tests/mserver5-ipv6.py
--- a/monetdb5/tools/Tests/mserver5-ipv6.py
+++ b/monetdb5/tools/Tests/mserver5-ipv6.py
@@ -20,5 +20,5 @@ rollback;
     sys.stdout.write(sout)
     sys.stderr.write(serr)
 
-    sys.stdout.write(cout)
+#    sys.stdout.write(cout)
     sys.stderr.write(cerr)
diff --git a/sql/test/Tests/All b/sql/test/Tests/All
--- a/sql/test/Tests/All
+++ b/sql/test/Tests/All
@@ -128,3 +128,13 @@ HAVE_PYMONETDB&HAVE_LIBLZMA?hot_snapshot
 HAVE_PYTHON_LZ4&HAVE_PYMONETDB&HAVE_LIBLZ4?hot_snapshot_lz4
 !HAVE_PYTHON_LZ4&HAVE_PYMONETDB&HAVE_LIBLZ4?hot_snapshot_lz4_lite
 
+# The following tests are some old tests moved from sql/test
+## FOREIGN KEY reference to the same table
+foreign_key
+## IN operator in SELECT and type checking
+in
+## Don't know what it tests. Maybe it's no longer a challenge for MDB
+meltdown
+savepoints1
+savepoints2
+union
diff --git a/sql/test/fk.sql b/sql/test/Tests/foreign_key.sql
rename from sql/test/fk.sql
rename to sql/test/Tests/foreign_key.sql
--- a/sql/test/fk.sql
+++ b/sql/test/Tests/foreign_key.sql
@@ -1,21 +1,21 @@
 CREATE TABLE sys.maps (
-        id      int NOT NULL,
-        parent  int,
-        world   int NOT NULL,
-        imagefile       varchar(255)    NOT NULL,
-        top_left_x      double,
-        top_left_y      double,
-        bot_right_x     double,
-        bot_right_y     double,
+        id      INT NOT NULL,
+        parent  INT,
+        world   INT NOT NULL,
+        imagefile       VARCHAR(255)    NOT NULL,
+        top_left_x      DOUBLE,
+        top_left_y      DOUBLE,
+        bot_right_x     DOUBLE,
+        bot_right_y     DOUBLE,
+        PRIMARY KEY (id) );
 
-        PRIMARY KEY (id) -- c1012117
--- c1012388
--- c1012118
-);
-ALTER TABLE sys.maps add FOREIGN KEY (parent) REFERENCES sys.maps(id);
+ALTER TABLE sys.maps ADD FOREIGN KEY (parent) REFERENCES sys.maps(id);
 
-insert into maps values (1, NULL, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
--- insert into maps values (1, 0, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
-insert into maps values (2, 10, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
+INSERT INTO maps VALUES (1, NULL, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
+INSERT INTO maps VALUES (2, 1, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
+INSERT INTO maps VALUES (3, 10, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0);
 
-select * from maps;
+SELECT * FROM maps;
+
+DROP TABLE sys.maps;
+
diff --git a/sql/test/Tests/foreign_key.test b/sql/test/Tests/foreign_key.test
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/foreign_key.test
@@ -0,0 +1,48 @@
+statement ok
+CREATE TABLE sys.maps (
+        id      INT NOT NULL,
+        parent  INT,
+        world   INT NOT NULL,
+        imagefile       VARCHAR(255)    NOT NULL,
+        top_left_x      DOUBLE,
+        top_left_y      DOUBLE,
+        bot_right_x     DOUBLE,
+        bot_right_y     DOUBLE,
+        PRIMARY KEY (id) )
+
+statement ok
+ALTER TABLE sys.maps ADD FOREIGN KEY (parent) REFERENCES sys.maps(id)
+
+statement ok
+INSERT INTO maps VALUES (1, NULL, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0)
+
+statement ok
+INSERT INTO maps VALUES (2, 1, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0)
+
+statement error 40002!INSERT INTO: FOREIGN KEY constraint 
'maps.maps_parent_fkey' violated
+INSERT INTO maps VALUES (3, 10, 1, 'world-map-1600-1700.jpg', 0, 0, 0, 0)
+
+query IIITRRRR rowsort
+SELECT * FROM maps
+----
+1
+NULL
+1
+world-map-1600-1700.jpg
+0.000
+0.000
+0.000
+0.000
+2
+1
+1
+world-map-1600-1700.jpg
+0.000
+0.000
+0.000
+0.000
+
+statement ok
+DROP TABLE sys.maps
+
+
diff --git a/sql/test/Tests/in.sql b/sql/test/Tests/in.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/in.sql
@@ -0,0 +1,8 @@
+create table tmp(i int);
+insert into tmp values(1);
+insert into tmp values(null);
+select * from tmp where i in (1);
+select * from tmp where i in (2,1);
+select i in (NULL,1) from tmp;
+select i in (1,'a') from tmp;
+drop table tmp;
diff --git a/sql/test/Tests/in.test b/sql/test/Tests/in.test
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/in.test
@@ -0,0 +1,31 @@
+statement ok
+create table tmp(i int)
+
+statement ok
+insert into tmp values(1)
+
+statement ok
+insert into tmp values(null)
+
+query I rowsort
+select * from tmp where i in (1)
+----
+1
+
+query I rowsort
+select * from tmp where i in (2,1)
+----
+1
+
+query T rowsort
+select i in (NULL,1) from tmp
+----
+NULL
+True
+
+statement error 22018!conversion of string 'a' to type int failed.
+select i in (1,'a') from tmp
+
+statement ok
+drop table tmp
+
diff --git a/sql/test/meltdown.sql b/sql/test/Tests/meltdown.sql
rename from sql/test/meltdown.sql
rename to sql/test/Tests/meltdown.sql
--- a/sql/test/meltdown.sql
+++ b/sql/test/Tests/meltdown.sql
@@ -1,3 +1,5 @@
+start transaction;
+
 create table a ( id integer, var1 clob, var2 clob, var3 integer, var4 clob );
 
 INSERT INTO a (id, var1, var2, var3, var4) VALUES (1, 'aaaa',
@@ -5,16 +7,16 @@ INSERT INTO a (id, var1, var2, var3, var
 boeken lezen? De Bijbel Literatuur gesorteerd op auteur Opmerkingen en
 suggesties Introductie Wat kunt u hier in deze Nederlandse Bibliotheek
 verwachten? U', 690775351, 'hier');
+
 INSERT INTO a (id, var1, var2, var3, var4) VALUES (2, 'aaab', 'God is,
 en het welzijn van de mensen bevordert. Welke', 1686169245, 'worde');
+
 INSERT INTO a (id, var1, var2, var3, var4) VALUES (3, 'aaac', 'Wie zit
 er achter deze bibliotheek? Een zendeling die het als zijn taak ziet om
 het evangelie te verkondigen tot aan de uiterste einden van de wereld.
 Welke nieuwe boeken zijn onlangs toegevoegd? Er is een lijst met
 veranderingen beschikbaar.', 723830965, '');
 
+select * from a;
 
-select * from a;
---- drop view a;
-
-commit;
+rollback;
diff --git a/sql/test/Tests/meltdown.test b/sql/test/Tests/meltdown.test
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/meltdown.test
@@ -0,0 +1,47 @@
+statement ok
+start transaction
+
+statement ok
+create table a ( id integer, var1 clob, var2 clob, var3 integer, var4 clob )
+
+statement ok
+INSERT INTO a (id, var1, var2, var3, var4) VALUES (1, 'aaaa',
+'Bibliotheek 21 Nederlandse Bibliotheek Inhoud Introductie Hoe kunt u de
+boeken lezen? De Bijbel Literatuur gesorteerd op auteur Opmerkingen en
+suggesties Introductie Wat kunt u hier in deze Nederlandse Bibliotheek
+verwachten? U', 690775351, 'hier')
+
+statement ok
+INSERT INTO a (id, var1, var2, var3, var4) VALUES (2, 'aaab', 'God is,
+en het welzijn van de mensen bevordert. Welke', 1686169245, 'worde')
+
+statement ok
+INSERT INTO a (id, var1, var2, var3, var4) VALUES (3, 'aaac', 'Wie zit
+er achter deze bibliotheek? Een zendeling die het als zijn taak ziet om
+het evangelie te verkondigen tot aan de uiterste einden van de wereld.
+Welke nieuwe boeken zijn onlangs toegevoegd? Er is een lijst met
+veranderingen beschikbaar.', 723830965, '')
+
+query ITTIT rowsort
+select * from a
+----
+1
+aaaa
+Bibliotheek 21 Nederlandse Bibliotheek Inhoud Introductie Hoe kunt u de@boeken 
lezen? De Bijbel Literatuur gesorteerd op auteur Opmerkingen en@suggesties 
Introductie Wat kunt u hier in deze Nederlandse Bibliotheek@verwachten? U
+690775351
+hier
+2
+aaab
+God is,@en het welzijn van de mensen bevordert. Welke
+1686169245
+worde
+3
+aaac
+Wie zit@er achter deze bibliotheek? Een zendeling die het als zijn taak ziet 
om@het evangelie te verkondigen tot aan de uiterste einden van de wereld.@Welke 
nieuwe boeken zijn onlangs toegevoegd? Er is een lijst met@veranderingen 
beschikbaar.
+723830965
+(empty)
+
+statement ok
+rollback
+
+
diff --git a/sql/test/Tests/savepoints1.sql b/sql/test/Tests/savepoints1.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/savepoints1.sql
@@ -0,0 +1,70 @@
+start transaction;
+
+create table savepointtest ( id int, primary key(id));
+
+select * from savepointtest;
+
+savepoint name1;
+
+insert into savepointtest values(1), (2), (3);
+
+select * from savepointtest;
+
+savepoint name2;
+
+insert into savepointtest values(4), (5), (6);
+
+select * from savepointtest;
+
+rollback to savepoint name2;
+
+select * from savepointtest;
+
+insert into savepointtest values(7), (8), (9);
+
+savepoint name3;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to