Changeset: 5475f8e38df7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5475f8e38df7
Added Files:
        sql/test/testdb/Tests/dump-nogeom.SQL.py.src
        sql/test/testdb/Tests/dump.SQL.py
Removed Files:
        sql/test/testdb/Tests/dump-nogeom.sql
        sql/test/testdb/Tests/dump.sql
        sql/test/testdb/Tests/load-geom.sql
        sql/test/testdb/Tests/load.sql
Modified Files:
        sql/test/testdb/Tests/dump-nogeom.stable.out
        sql/test/testdb/Tests/dump.stable.out
Branch: mtest
Log Message:

Converted sql/test/testdb.


diffs (truncated from 101493 to 300 lines):

diff --git a/sql/test/testdb/Tests/dump-nogeom.SQL.py.src 
b/sql/test/testdb/Tests/dump-nogeom.SQL.py.src
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb/Tests/dump-nogeom.SQL.py.src
@@ -0,0 +1,1 @@
+$RELSRCDIR/dump.SQL.py
diff --git a/sql/test/testdb/Tests/dump-nogeom.sql 
b/sql/test/testdb/Tests/dump-nogeom.sql
deleted file mode 100644
--- a/sql/test/testdb/Tests/dump-nogeom.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-SET TIME ZONE INTERVAL '+00:00' HOUR TO MINUTE;
-\D
diff --git a/sql/test/testdb/Tests/dump-nogeom.stable.out 
b/sql/test/testdb/Tests/dump-nogeom.stable.out
--- a/sql/test/testdb/Tests/dump-nogeom.stable.out
+++ b/sql/test/testdb/Tests/dump-nogeom.stable.out
@@ -1,28 +1,3 @@
-stdout of test 'dump-nogeom` in directory 'sql/test/testdb` itself:
-
-
-# 14:28:43 >  
-# 14:28:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36999" "--set" 
"mapi_usock=/var/tmp/mtest-22828/.s.monetdb.36999" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/sjoerd/@Monet-candidate/var/MonetDB/mTests_sql_test_testdb" 
"--set" "embedded_c=true"
-# 14:28:43 >  
-
-# MonetDB 5 server v11.32.0# MonetDB5 server v11.32.0 (hg id: a7009c1117bd+)
-# This is an unreleased version
-# Serving database 'mTests_sql_test_testdb', using 8 threads
-# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
-# Found 62.694 GiB available main-memory.
-# Copyright (c) 1993 - July 2008 CWI.
-# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
-# Visit https://www.monetdb.org/ for further information
-# Listening for connection requests on 
mapi:monetdb://methuselah.da.cwi.nl:36999/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-22828/.s.monetdb.36999
-# MonetDB/SQL module loaded
-
-
-# 14:28:43 >  
-# 14:28:43 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-22828" "--port=36999"
-# 14:28:43 >  
-
-#SET TIME ZONE INTERVAL '+00:00' HOUR TO MINUTE;
 START TRANSACTION;
 CREATE USER "testuser" WITH ENCRYPTED PASSWORD 
'e9e633097ab9ceb3e48ec3f70ee2beba41d05d5420efee5da85f97d97005727587fda33ef4ff2322088f4c79e8133cc9cd9f3512f4d3a303cbdb5bc585415a00'
 NAME 'Test User' SCHEMA "sys";
 CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
@@ -101445,8 +101420,3 @@ ALTER SEQUENCE "testschema"."test_seq" R
 GRANT EXECUTE ON FUNCTION "testschema"."keyjoin" TO "public";
 SET SCHEMA "sys";
 COMMIT;
-
-# 14:28:45 >  
-# 14:28:45 >  "Done."
-# 14:28:45 >  
-
diff --git a/sql/test/testdb/Tests/dump.SQL.py 
b/sql/test/testdb/Tests/dump.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb/Tests/dump.SQL.py
@@ -0,0 +1,24 @@
+import sys
+
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+with process.client('sqldump',
+                    stdin=process.PIPE,
+                    stdout=process.PIPE,
+                    stderr=process.PIPE) as clt:
+    out, err = clt.communicate()
+
+if len(sys.argv) == 2 and sys.argv[1] in ('dump', 'dump-nogeom'):
+    output = ''.join(out).splitlines(keepends=True)
+    while len(output) > 0 and output[0].startswith('--'):
+        del output[0]
+    stableout = '{}.stable.out'.format(sys.argv[1])
+    stable = open(stableout).readlines()
+    import difflib
+    for line in difflib.unified_diff(stable, output, fromfile='test', 
tofile=stableout):
+        sys.stderr.write(line)
+else:
+    sys.stdout.writelines(out)
diff --git a/sql/test/testdb/Tests/dump.sql b/sql/test/testdb/Tests/dump.sql
deleted file mode 100644
--- a/sql/test/testdb/Tests/dump.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-SET TIME ZONE INTERVAL '+00:00' HOUR TO MINUTE;
-\D
diff --git a/sql/test/testdb/Tests/dump.stable.out 
b/sql/test/testdb/Tests/dump.stable.out
--- a/sql/test/testdb/Tests/dump.stable.out
+++ b/sql/test/testdb/Tests/dump.stable.out
@@ -1,27 +1,3 @@
-stdout of test 'dump` in directory 'sql/test/testdb` itself:
-
-
-# 11:29:34 >  
-# 11:29:34 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/ufs/manegold/_/Monet/HG/Apr2012/prefix/--disable-debug_--enable-assert_--enable-optimize/var/MonetDB"
 "--set" "mapi_open=true" "--set" "mapi_port=32118" "--set" "monet_prompt=" 
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_test_testdb" 
"--set" "mal_listing=0"
-# 11:29:34 >  
-
-# MonetDB 5 server v11.9.8
-# This is an unreleased version
-# Serving database 'mTests_test_testdb', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Found 15.629 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://rome.ins.cwi.nl:32118/
-# MonetDB/GIS module loaded
-# MonetDB/SQL module loaded
-
-
-# 11:29:34 >  
-# 11:29:34 >  "/usr/bin/python" "testdb-dump.SQL.py" "testdb-dump"
-# 11:29:34 >  
-
 START TRANSACTION;
 CREATE USER "testuser" WITH ENCRYPTED PASSWORD 
'e9e633097ab9ceb3e48ec3f70ee2beba41d05d5420efee5da85f97d97005727587fda33ef4ff2322088f4c79e8133cc9cd9f3512f4d3a303cbdb5bc585415a00'
 NAME 'Test User' SCHEMA "sys";
 CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
@@ -101462,8 +101438,3 @@ ALTER SEQUENCE "testschema"."test_seq" R
 GRANT EXECUTE ON FUNCTION "testschema"."keyjoin" TO "public";
 SET SCHEMA "sys";
 COMMIT;
-
-# 11:31:35 >  
-# 11:31:35 >  "Done."
-# 11:31:35 >  
-
diff --git a/sql/test/testdb/Tests/load-geom.sql 
b/sql/test/testdb/Tests/load-geom.sql
deleted file mode 100644
--- a/sql/test/testdb/Tests/load-geom.sql
+++ /dev/null
@@ -1,20 +0,0 @@
--- geometry test in separate transaction (in case geom is not available)
-START TRANSACTION;
-CREATE TABLE testschema.geomtest (
-       p   GEOMETRY(POINT),
-       c   GEOMETRY(LINESTRING), --was CURVE but is not supported anymore,
-       ls  GEOMETRY(LINESTRING),
-       s   GEOMETRY(POLYGON), -- was SURFACE but is not supported anymore,
-       pg  GEOMETRY(POLYGON),
-       mp  GEOMETRY(MULTIPOINT),
-       mc  GEOMETRY(MULTILINESTRING), -- was MULTICURVE but is not supported 
anymore,
-       mls GEOMETRY(MULTILINESTRING),
-       ms  GEOMETRY(MULTIPOLYGON), --was MULTISURFACE but is not supported 
anymore,
-       mpg GEOMETRY(MULTIPOLYGON),
-       g   GEOMETRY,
-       gc  GEOMETRY(GEOMETRYCOLLECTION),
-       m   MBR
-);
-insert into testschema.geomtest values('POINT(10.5 12.3)', 'LINESTRING(10 10, 
20 20, 30 40)', 'LINESTRING(10 10, 20 20, 30 40)', 'POLYGON((10 10, 10 20, 20 
20, 20 15, 10 10))', 'POLYGON((10 10, 10 20, 20 20, 20 15, 10 10))', 
'MULTIPOINT(20 80, 110 160, 20 160)', 'MULTILINESTRING((0 0,0 80,60 80,60 0,0 
0))', 'MULTILINESTRING((0 0,0 80,60 80,60 0,0 0))', 'MULTIPOLYGON(((140 110, 
260 110, 170 20, 50 20, 140 110)), ((300 270, 420 270, 340 190, 220 190, 300 
270)))', 'MULTIPOLYGON(((140 110, 260 110, 170 20, 50 20, 140 110)), ((300 270, 
420 270, 340 190, 220 190, 300 270)))', 'POLYGON((10 10, 10 20, 20 20, 20 15, 
10 10))', 'GEOMETRYCOLLECTION (POLYGON ((0 0, 0 100, 100 100, 100 0, 0 0)), 
LINESTRING(10 10, 20 20, 30 40))', sys.mbr('POLYGON((10 10, 10 20, 20 20, 20 
15, 10 10))'));
-insert into testschema.geomtest values(NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-COMMIT;
diff --git a/sql/test/testdb/Tests/load.sql b/sql/test/testdb/Tests/load.sql
deleted file mode 100644
--- a/sql/test/testdb/Tests/load.sql
+++ /dev/null
@@ -1,101333 +0,0 @@
--- msqldump dump database Fri Aug 19 10:15:39 2011
--- MonetDB v11.5.0, 'demo'
--- modified by hand to add table selfref (bug 2862).
-START TRANSACTION;
--- CREATE USER "testuser" WITH PASSWORD 'testpassword' NAME 'Test User' SCHEMA 
"sys";
-CREATE USER "testuser" WITH ENCRYPTED PASSWORD 
'e9e633097ab9ceb3e48ec3f70ee2beba41d05d5420efee5da85f97d97005727587fda33ef4ff2322088f4c79e8133cc9cd9f3512f4d3a303cbdb5bc585415a00'
 NAME 'Test User' SCHEMA "sys";
-CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
-COMMENT ON SCHEMA testschema IS 'a schema used for testing';
-ALTER USER "testuser" SET SCHEMA "testschema";
-SET SCHEMA "testschema";
-CREATE SEQUENCE "testschema"."selfref_seq" AS INTEGER;
-COMMENT ON SEQUENCE selfref_seq IS 'sequence number for selfref table';
-CREATE SEQUENCE "testschema"."test_seq" AS INTEGER;
-COMMENT ON SEQUENCE test_seq IS 'sequence number for testing';
-CREATE TABLE "testschema"."smallstring" (
-       "string1" VARCHAR(5),
-       "string2" CHAR(5),
-       "string3" CHARACTER LARGE OBJECT
-);
-COMMENT ON TABLE smallstring IS 'table to test small strings';
-COMMENT ON COLUMN smallstring.string1 IS 'first column of table to test small 
strings';
-COMMENT ON COLUMN smallstring.string2 IS 'second column of table to test small 
strings';
-COMMENT ON COLUMN smallstring.string3 IS 'third column of table to test small 
strings';
-COPY 66 RECORDS INTO "testschema"."smallstring" FROM stdin USING DELIMITERS 
E'\t',E'\n','"';
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-"a0"   "b0"    "c0"
-"a1"   "b1"    "c1"
-"a2"   "b2"    "c2"
-"a3"   "b3"    "c3"
-"a4"   "b4"    "c4"
-"a5"   "b5"    "c5"
-"a6"   "b6"    "c6"
-"a7"   "b7"    "c7"
-"a8"   "b8"    "c8"
-"a9"   "b9"    "c9"
-"a10"  "b10"   "c10"
-
-CREATE TABLE "testschema"."mediumstring" (
-       "string1" VARCHAR(20),
-       "string2" CHAR(20),
-       "string3" CHARACTER LARGE OBJECT
-);
-COPY 1001 RECORDS INTO "testschema"."mediumstring" FROM stdin USING DELIMITERS 
E'\t',E'\n','"';
-"a222833216428103"     "b222833216428103"      "c222833216428103"
-"a22462275706708"      "b22462275706708"       "c22462275706708"
-"a207961069219280"     "b207961069219280"      "c207961069219280"
-"a1430667456508"       "b1430667456508"        "c1430667456508"
-"a143912596726204"     "b143912596726204"      "c143912596726204"
-"a35882931026608"      "b35882931026608"       "c35882931026608"
-"a12630311241498"      "b12630311241498"       "c12630311241498"
-"a1147528919691"       "b1147528919691"        "c1147528919691"
-"a2463126399106"       "b2463126399106"        "c2463126399106"
-"a26499139713669"      "b26499139713669"       "c26499139713669"
-"a1248634873065"       "b1248634873065"        "c1248634873065"
-"a78212594930635"      "b78212594930635"       "c78212594930635"
-"a14529139788559"      "b14529139788559"       "c14529139788559"
-"a10412828415305"      "b10412828415305"       "c10412828415305"
-"a754999078504"        "b754999078504" "c754999078504"
-"a985134955047"        "b985134955047" "c985134955047"
-"a27593261253403"      "b27593261253403"       "c27593261253403"
-"a29091483332322"      "b29091483332322"       "c29091483332322"
-"a29783294642194"      "b29783294642194"       "c29783294642194"
-"a61212319516165"      "b61212319516165"       "c61212319516165"
-"a9790291319652"       "b9790291319652"        "c9790291319652"
-"a128551073512834"     "b128551073512834"      "c128551073512834"
-"a107222526426812"     "b107222526426812"      "c107222526426812"
-"a192822630622328"     "b192822630622328"      "c192822630622328"
-"a1819108732235"       "b1819108732235"        "c1819108732235"
-"a10323207312962"      "b10323207312962"       "c10323207312962"
-"a15370296666320"      "b15370296666320"       "c15370296666320"
-"a187742599011153"     "b187742599011153"      "c187742599011153"
-"a18328230057849"      "b18328230057849"       "c18328230057849"
-"a205222912631044"     "b205222912631044"      "c205222912631044"
-"a392061491190"        "b392061491190" "c392061491190"
-"a235721900411925"     "b235721900411925"      "c235721900411925"
-"a3638297274421"       "b3638297274421"        "c3638297274421"
-"a304501624130727"     "b304501624130727"      "c304501624130727"
-"a200101806031815"     "b200101806031815"      "c200101806031815"
-"a19477283831120"      "b19477283831120"       "c19477283831120"
-"a324401098630786"     "b324401098630786"      "c324401098630786"
-"a59922976024008"      "b59922976024008"       "c59922976024008"
-"a171451532014245"     "b171451532014245"      "c171451532014245"
-"a24994307510604"      "b24994307510604"       "c24994307510604"
-"a23270699516753"      "b23270699516753"       "c23270699516753"
-"a24460305672989"      "b24460305672989"       "c24460305672989"
-"a3617143832716"       "b3617143832716"        "c3617143832716"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to