Changeset: 946795a0351f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=946795a0351f
Added Files:
        sql/test/testdb-reload/Tests/All
        sql/test/testdb-reload/Tests/reload.py
        sql/test/testdb-reload/Tests/reload.stable.err
        sql/test/testdb-reload/Tests/reload.stable.out
        sql/test/testdb-reload/Tests/reload.timeout
Modified Files:
        sql/test/testdb/Tests/dump.stable.out
Branch: Aug2018
Log Message:

Try to load the dump of a database and check that it is correct.


diffs (truncated from 101631 to 300 lines):

diff --git a/sql/test/testdb-reload/Tests/All b/sql/test/testdb-reload/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb-reload/Tests/All
@@ -0,0 +1,1 @@
+reload
diff --git a/sql/test/testdb-reload/Tests/reload.py 
b/sql/test/testdb-reload/Tests/reload.py
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb-reload/Tests/reload.py
@@ -0,0 +1,75 @@
+'''\
+Load the "dump" from the sql/test/testdb test and dump it.  Load that
+dump into a fresh database and check the result of dumping that.
+'''
+
+import os, sys, socket, shutil
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+dbfarm = os.getenv('GDK_DBFARM')
+tstdb = os.getenv('TSTDB')
+tstsrcdir = os.getenv('TSTSRCDIR')
+
+if not tstdb or not dbfarm:
+    print('No TSTDB or GDK_DBFARM in environment')
+    sys.exit(1)
+
+def freeport():
+    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    sock.bind(('', 0))
+    port = sock.getsockname()[1]
+    sock.close()
+    return port
+
+port2 = freeport()
+tstdb2 = tstdb + '-clone'
+if os.path.exists(os.path.join(dbfarm, tstdb2)):
+    shutil.rmtree(os.path.join(dbfarm, tstdb2))
+
+# start the first server
+s1 = process.server(stdin=process.PIPE,
+                    stdout=process.PIPE,
+                    stderr=process.PIPE)
+# load data into the first server's database
+c1 = process.client(lang='sql',
+                    args=[os.path.join(tstsrcdir, os.pardir, os.pardir, 
'testdb', 'Tests', 'load.sql')],
+                    stdin=process.PIPE,
+                    stdout=process.PIPE,
+                    stderr=process.PIPE)
+c1out, c1err = c1.communicate()
+# start the second server
+s2 = process.server(dbname=tstdb2,
+                    mapiport=port2,
+                    stdin=process.PIPE,
+                    stdout=process.PIPE,
+                    stderr=process.PIPE)
+# dump the first server's database
+d1 = process.client(lang='sqldump',
+                    stdin=process.PIPE,
+                    stdout='PIPE',
+                    stderr=process.PIPE)
+# and pipe it straight into the second server
+c2 = process.client(lang='sql',
+                    dbname=tstdb2,
+                    port=port2,
+                    stdin=d1.stdout,
+                    stdout=process.PIPE,
+                    stderr=process.PIPE)
+d1.stdout.close()
+d1.stdout = None
+c2out, c2err = c2.communicate()
+d1out, d1err = d1.communicate()
+s1out, s1err = s1.communicate()
+sys.stdout.write(s1out)
+sys.stderr.write(s1err)
+# dump the second server's database
+d2 = process.client(lang='sqldump',
+                    dbname=tstdb2,
+                    port=port2)
+d2out, d2err = d2.communicate()
+s2out, s2err = s2.communicate()
+sys.stdout.write(s2out)
+sys.stderr.write(s2err)
diff --git a/sql/test/testdb-reload/Tests/reload.stable.err 
b/sql/test/testdb-reload/Tests/reload.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb-reload/Tests/reload.stable.err
@@ -0,0 +1,70 @@
+stderr of test 'reload` in directory 'sql/test/testdb-reload` itself:
+
+
+# 17:34:32 >  
+# 17:34:32 >  "/usr/bin/python2" "reload.py" "reload"
+# 17:34:32 >  
+
+# builtin opt  gdk_dbpath = /ufs/sjoerd/@Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 30728
+# cmdline opt  mapi_usock = /var/tmp/mtest-14588/.s.monetdb.30728
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_testdb-reload
+# cmdline opt  gdk_debug = 553648138
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_309:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_267:bat[:str], X_279:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_310:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_268:bat[:str], X_280:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_311:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_269:bat[:str], X_281:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_312:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_270:bat[:str], X_282:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_313:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_271:bat[:str], X_283:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_314:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_272:bat[:str], X_284:bat[:str]);
+# builtin opt  gdk_dbpath = /ufs/sjoerd/@Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  monet_prompt = 
+# cmdline opt  mapi_port = 37779
+# cmdline opt  mapi_usock = /var/tmp/mtest-14588/.s.monetdb.37779
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_testdb-reload-clone
+# cmdline opt  gdk_debug = 553648138
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_309:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_267:bat[:str], X_279:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_310:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_268:bat[:str], X_280:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_311:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_269:bat[:str], X_281:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_312:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_270:bat[:str], X_282:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_313:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_271:bat[:str], X_283:bat[:str]);
+#WARNING To speedup sql.get_value a bulk operator implementation is needed
+#    X_314:bat[:lng] := mal.multiplex("sql":str, "get_value":str, 
X_272:bat[:str], X_284:bat[:str]);
+
+# 17:35:07 >  
+# 17:35:07 >  "Done."
+# 17:35:07 >  
+
diff --git a/sql/test/testdb-reload/Tests/reload.stable.out 
b/sql/test/testdb-reload/Tests/reload.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/testdb-reload/Tests/reload.stable.out
@@ -0,0 +1,101415 @@
+stdout of test 'reload` in directory 'sql/test/testdb-reload` itself:
+
+
+# 17:34:32 >  
+# 17:34:32 >  "/usr/bin/python2" "reload.py" "reload"
+# 17:34:32 >  
+
+START TRANSACTION;
+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";
+CREATE SEQUENCE "testschema"."selfref_seq" AS INTEGER;
+COMMENT ON SEQUENCE "testschema"."selfref_seq" IS 'sequence number for selfref 
table';
+CREATE SEQUENCE "testschema"."test_seq" AS INTEGER;
+COMMENT ON SEQUENCE "testschema"."test_seq" IS 'sequence number for testing';
+SET SCHEMA "testschema";
+CREATE TABLE "testschema"."smallstring" (
+       "string1" VARCHAR(5),
+       "string2" CHAR(5),
+       "string3" CHARACTER LARGE OBJECT
+);
+COMMENT ON TABLE "testschema"."smallstring" IS 'table to test small strings';
+COMMENT ON COLUMN "testschema"."smallstring"."string1" IS 'first column of 
table to test small strings';
+COMMENT ON COLUMN "testschema"."smallstring"."string2" IS 'second column of 
table to test small strings';
+COMMENT ON COLUMN "testschema"."smallstring"."string3" IS 'third column of 
table to test small strings';
+COPY 66 RECORDS INTO "testschema"."smallstring" FROM stdin USING DELIMITERS 
'\t','\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 
'\t','\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"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to