Changeset: e6faf3c438e6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e6faf3c438e6
Branch: default
Log Message:

Merged with Jan2022


diffs (truncated from 56514 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -6351,7 +6351,7 @@
 [ "batsql",    "diff", "pattern batsql.diff(X_0:bit, 
X_1:bat[:any_1]):bat[:bit] ",     "SQLdiff;",     "return true if cur != prev 
row"        ]
 [ "batsql",    "first_value",  "pattern batsql.first_value(X_0:bat[:any_1], 
X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:any_1] ",        
"SQLfirst_value;",      "return the first value of groups"      ]
 [ "batsql",    "get_value",    "pattern batsql.get_value(X_0:bat[:str], 
X_1:bat[:str]):bat[:lng] ",    "mvc_get_value_bulk;",  "return the current 
value of the sequence (ie the next to be used value)"       ]
-[ "batsql",    "get_value",    "pattern batsql.get_value(X_0:bat[:str], 
X_1:bat[:str], X_2:bat[:oid], X_3:bat[:oid]):bat[:lng] ",      
"mvc_get_value_bulk;",  "return the current value of the sequence (ie the next 
to be used value)"       
+[ "batsql",    "get_value",    "pattern batsql.get_value(X_0:bat[:str], 
X_1:bat[:str], X_2:bat[:oid], X_3:bat[:oid]):bat[:lng] ",      
"mvc_get_value_bulk;",  "return the current value of the sequence (ie the next 
to be used value)"       ]
 [ "batsql",    "index",        "command batsql.index(X_0:bat[:str], 
X_1:bit):bat[:bte] ",      "BATSTRindex_bte;",     "Return the offsets as an 
index bat"    ]
 [ "batsql",    "index",        "command batsql.index(X_0:bat[:str], 
X_1:bit):bat[:int] ",      "BATSTRindex_int;",     "Return the offsets as an 
index bat"    ]
 [ "batsql",    "index",        "command batsql.index(X_0:bat[:str], 
X_1:bit):bat[:sht] ",      "BATSTRindex_sht;",     "Return the offsets as an 
index bat"    ]
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1162,8 +1162,6 @@ BUNappendmulti(BAT *b, const void *value
        if (values && b->ttype) {
                int (*atomcmp) (const void *, const void *) = 
ATOMcompare(b->ttype);
                const void *atomnil = ATOMnilptr(b->ttype);
-               MT_lock_set(&b->theaplock);
-               MT_lock_unset(&b->theaplock);
                const void *minvalp = NULL, *maxvalp = NULL;
                BATiter bi = bat_iterator_nolock(b);
                if (bi.minpos != BUN_NONE)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1174,14 +1174,7 @@ BATappend_or_update(BAT *b, BAT *p, cons
                                        bat_iterator_end(&ni);
                                        return GDK_FAIL;
                                }
-                               {
-                                       /* save and restore minpos/maxpos */
-                                       BUN minpos = bi.minpos;
-                                       BUN maxpos = bi.maxpos;
-                                       bi = bat_iterator_nolock(b);
-                                       bi.minpos = minpos;
-                                       bi.maxpos = maxpos;
-                               }
+                               bi = bat_iterator_nolock(b);
                                continue;
                        }
 
@@ -1505,14 +1498,7 @@ BATappend_or_update(BAT *b, BAT *p, cons
                                        bat_iterator_end(&ni);
                                        return GDK_FAIL;
                                }
-                               {
-                                       /* save and restore minpos/maxpos */
-                                       BUN minpos = bi.minpos;
-                                       BUN maxpos = bi.maxpos;
-                                       bi = bat_iterator_nolock(b);
-                                       bi.minpos = minpos;
-                                       bi.maxpos = maxpos;
-                               }
+                               bi = bat_iterator_nolock(b);
                                continue;
                        }
 
diff --git a/geom/sql/conformance/Tests/T48.test 
b/geom/sql/conformance/Tests/T48.test
--- a/geom/sql/conformance/Tests/T48.test
+++ b/geom/sql/conformance/Tests/T48.test
@@ -1,5 +1,5 @@
 query T rowsort
 SELECT ST_AsText(ST_Difference(named_places.boundary, forests.boundary)) FROM 
named_places, forests WHERE named_places.name = 'Ashton' AND forests.name = 
'Green Forest'
 ----
-POLYGON ((62 48, 84 48, 84 42, 56 34, 62 48))
+POLYGON ((84 48, 84 42, 56 34, 62 48, 84 48))
 
diff --git a/geom/sql/pg_regression/Tests/dump.test 
b/geom/sql/pg_regression/Tests/dump.test
--- a/geom/sql/pg_regression/Tests/dump.test
+++ b/geom/sql/pg_regression/Tests/dump.test
@@ -89,14 +89,12 @@ FROM ST_Dump(ST_WKTToSQL('
                MULTILINESTRING EMPTY,
                MULTIPOLYGON EMPTY,
                GEOMETRYCOLLECTION (GEOMETRYCOLLECTION EMPTY))'))
+WHERE id <> '7' OFFSET 1 -- avoid difference between geos libraries < 3.10 vs. 
>= 3.10
 ----
 t11
 1
 GEOMETRYCOLLECTION EMPTY
 t11
-1
-GEOMETRYCOLLECTION EMPTY
-t11
 2
 LINESTRING EMPTY
 t11
@@ -112,9 +110,6 @@ t11
 6
 MULTIPOLYGON EMPTY
 t11
-7
-GEOMETRYCOLLECTION EMPTY
-t11
 7,1
 GEOMETRYCOLLECTION EMPTY
 
diff --git a/monetdb5/ChangeLog.Jan2022 b/monetdb5/ChangeLog.Jan2022
--- a/monetdb5/ChangeLog.Jan2022
+++ b/monetdb5/ChangeLog.Jan2022
@@ -3,5 +3,5 @@
 
 * Wed Dec 15 2021 Pedro Ferreira <pedro.ferre...@monetdbsolutions.com>
 - The storage cleanup in the 11.41.5 (Jul2021) release made the OLTP
-  optimizer pipeline absolete, thus it was removed.
+  optimizer pipeline obsolete, thus it was removed.
 
diff --git a/sql/backends/monet5/for.c b/sql/backends/monet5/for.c
--- a/sql/backends/monet5/for.c
+++ b/sql/backends/monet5/for.c
@@ -92,6 +92,7 @@ FORcompress_intern(char **comp_min_val, 
        char buf[64];
        int tt = b->ttype;
        ptr mn = NULL, mx = NULL;
+       BUN cnt = BATcount(b);
 
        if (
 #ifdef HAVE_HGE
@@ -99,6 +100,8 @@ FORcompress_intern(char **comp_min_val, 
 #endif
                        tt != TYPE_lng && tt != TYPE_int)
                throw(SQL, "for.compress", SQLSTATE(3F000) "for compress: 
invalid column type");
+       if (cnt == 0)
+               throw(SQL, "for.compress", SQLSTATE(42000) "for compress: 
cannot compute range of values on empty columns");
 
        /* For now we only handle hge, lng, and int -> sht and bte */
        if (!(mn = BATmin(b, NULL)))
@@ -108,12 +111,15 @@ FORcompress_intern(char **comp_min_val, 
                throw(SQL, "for.compress", GDK_EXCEPTION);
        }
 
-       BUN cnt = BATcount(b);
        if (tt == TYPE_lng) {
                lng min_val = *(lng*)mn;
                lng max_val = *(lng*)mx;
+
                GDKfree(mn);
                GDKfree(mx);
+               /* defensive line, if there are 'holes' on b, 'for' compression 
cannot be done */
+               if (is_lng_nil(min_val) || is_lng_nil(max_val))
+                       throw(SQL, "for.compress", SQLSTATE(3F000) "for 
compress: for 'for' compression column's cannot have NULL's");
                if ((max_val-min_val) > GDK_sht_max)
                        throw(SQL, "for.compress", SQLSTATE(3F000) "for 
compress: too large value spread for 'for' compression");
                if ((max_val-min_val) < GDK_bte_max/2) {
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -378,7 +378,7 @@ is_subtype(sql_subtype *sub, sql_subtype
        if (super->digits > 0 && sub->digits > super->digits)
                return 0;
        /* while binding a function, 'char' types match each other */
-       if (super->digits == 0 && 
+       if (super->digits == 0 &&
                ((super->type->eclass == EC_STRING && 
EC_VARCHAR(sub->type->eclass)) ||
                 (super->type->eclass == EC_CHAR && sub->type->eclass == 
EC_CHAR)))
                return 1;
@@ -1439,7 +1439,6 @@ sqltypeinit( sql_allocator *sa)
        for (t = strings; t < numerical; t++) {
                sql_create_func(sa, "next_value_for", "sql", "next_value", 
TRUE, SCALE_NONE, 0, LNG, 2, *t, *t);
                sql_create_func(sa, "get_value_for", "sql", "get_value", TRUE, 
SCALE_NONE, 0, LNG, 2, *t, *t);
-               sql_create_func(sa, "peak_next_value_for", "sql", 
"peak_next_value", TRUE, SCALE_NONE, 0, LNG, 2, *t, *t);
                sql_create_func(sa, "restart", "sql", "restart", TRUE, 
SCALE_NONE, 0, LNG, 3, *t, *t, LNG);
 
                sql_create_func(sa, "index", "sql", "index", TRUE, SCALE_NONE, 
0, BTE, 2, *t, BIT);
diff --git a/sql/jdbc/tests/Tests/OnClientDownloadData.sql 
b/sql/jdbc/tests/Tests/OnClientDownloadData.sql
--- a/sql/jdbc/tests/Tests/OnClientDownloadData.sql
+++ b/sql/jdbc/tests/Tests/OnClientDownloadData.sql
@@ -11,18 +11,20 @@ COPY SELECT * FROM sys.tables ORDER BY i
 -- test error handling
 COPY SELECT * FROM sys.tables ORDER BY id INTO '' ON CLIENT USING DELIMITERS 
',' , E'\n' , '"' NULL AS '';
 -- Error [22000] Missing file name
-COPY SELECT * FROM sys.tables ORDER BY id INTO '.' ON CLIENT USING DELIMITERS 
',' , E'\n' , '"' NULL AS '';
+
+-- next tests are disabled due to variable path in error msg
+--COPY SELECT * FROM sys.tables ORDER BY id INTO '.' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
 -- Error [22000] File already exists: /home/dinther/csvfiles
-COPY SELECT * FROM sys.tables ORDER BY id INTO '..' ON CLIENT USING DELIMITERS 
',' , E'\n' , '"' NULL AS '';
+--COPY SELECT * FROM sys.tables ORDER BY id INTO '..' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
 -- Error [22000] File is not in download directory: /home/dinther/csvfiles
-COPY SELECT * FROM sys.tables ORDER BY id INTO '../b' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
+--COPY SELECT * FROM sys.tables ORDER BY id INTO '../b' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
 -- Error [22000] File is not in download directory: /home/dinther/csvfiles
-COPY SELECT * FROM sys.tables ORDER BY id INTO 
'/home/Doesnotexist/sys_tables_by_id.dsv' ON CLIENT;
+--COPY SELECT * FROM sys.tables ORDER BY id INTO 
'/home/Doesnotexist/sys_tables_by_id.dsv' ON CLIENT;
 -- Error [22000] File is not in download directory: /home/dinther/csvfiles
 
-COPY SELECT * FROM sys.tables ORDER BY id INTO 'sys_tables_by_id.dsv' ON 
CLIENT;
+--COPY SELECT * FROM sys.tables ORDER BY id INTO 'sys_tables_by_id.dsv' ON 
CLIENT;
 -- Error [22000] File already exists: 
/home/dinther/csvfiles/sys_tables_by_id.dsv
-COPY SELECT * FROM sys.tables ORDER BY id INTO 'sys_tables_by_id.csv.gz' ON 
CLIENT USING DELIMITERS ',' , E'\n' , '"' NULL AS '';
+--COPY SELECT * FROM sys.tables ORDER BY id INTO 'sys_tables_by_id.csv.gz' ON 
CLIENT USING DELIMITERS ',' , E'\n' , '"' NULL AS '';
 -- Error [22000] File already exists: 
/home/dinther/csvfiles/sys_tables_by_id.csv.gz
 
 COPY SELECT * FROM sys.tables ORDER BY id INTO 'sys_tables_by_id.csv.bz2' ON 
CLIENT USING DELIMITERS ',' , E'\n' , '"' NULL AS '';
diff --git a/sql/jdbc/tests/Tests/OnClientUploadData.sql 
b/sql/jdbc/tests/Tests/OnClientUploadData.sql
--- a/sql/jdbc/tests/Tests/OnClientUploadData.sql
+++ b/sql/jdbc/tests/Tests/OnClientUploadData.sql
@@ -32,10 +32,11 @@ TRUNCATE importedFileData;
 
 
 -- other compression formats are NOT supported
-COPY INTO importedFileData FROM 'sys_tables_by_id.csv.bz2' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
-COPY INTO importedFileData FROM 'sys_tables_by_id.csv.lz4' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
-COPY INTO importedFileData FROM 'sys_tables_by_id.csv.xz' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
-COPY INTO importedFileData FROM 'sys_tables_by_id.csv.zip' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
+-- next tests are disabled due to variable path in error msg
+--COPY INTO importedFileData FROM 'sys_tables_by_id.csv.bz2' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
+--COPY INTO importedFileData FROM 'sys_tables_by_id.csv.lz4' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
+--COPY INTO importedFileData FROM 'sys_tables_by_id.csv.xz' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
+--COPY INTO importedFileData FROM 'sys_tables_by_id.csv.zip' ON CLIENT USING 
DELIMITERS ',' , E'\n' , '"' NULL AS '';
 
 DROP TABLE IF EXISTS importedFileData;
 
diff --git a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py 
b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py
--- a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py
+++ b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py
@@ -18,12 +18,26 @@ if __name__ == '__main__':
     cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, '--help']
     try:
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "":
+            print(perr)
+        if pout != "Usage java -jar jdbcclient.jre8.jar\n\t\t[-h host[:port]] 
[-p port] [-f file] [-u user]\n\t\t[-l language] [-d database] [-e] [-D 
[table]]\n\t\t[--csvdir /path/to/csvfiles]] [-X<opt>]\n\t\t| [--help] | 
[--version]\nor using long option equivalents --host --port --file --user 
--language\n--dump --echo --database.\nArguments may be written directly after 
the option like -p50000.\n\nIf no host and port are given, localhost and 50000 
are assumed.\nAn .monetdb file may exist in the user's home directory.  This 
file can contain\npreferences to use each time JdbcClient is started.  Options 
given on the\ncommand line override the preferences file.  The .monetdb file 
syntax is\n<option>=<value> where option is one of the options host, port, 
file, mode\ndebug, or password.  Note that the last one is perilous and 
therefore not\navailable as command line option.\nIf no input file is given 
using the -f flag, an interactive session is\nstarted on the 
terminal.\n\nOPTIONS\n-h -
 -host     The hostname of the host that runs the MonetDB database.  A port\n   
           number can be supplied by use of a colon, i.e. -h 
somehost:12345.\n-p --port     The port number to connect to.\n-f --file     A 
file name to use either for reading or writing.  The file will\n              
be used for writing when dump mode is used (-D --dump).  In read\n              
mode, the file can also be an URL pointing to a plain text file\n              
that is optionally gzip compressed.\n-u --user     The username to use when 
connecting to the database.\n-d --database Try to connect to the given database 
(only makes sense if\n              connecting to monetdbd).\n-l --language Use 
the given language, defaults to 'sql'.\n--csvdir      The directory path where 
csv data files are read or written when\n              using ON CLIENT clause 
of COPY command.\n--help        This help screen.\n--version     Display driver 
version and exit.\n-e --echo     Also outputs the contents of the in
 put file, if any.\n-q --quiet    Suppress printing the welcome header.\n-D 
--dump     Dumps the given table(s), or the complete database if none 
given.\n-Xoutput      The output mode when dumping.  Default is sql, xml may be 
used for\n              an experimental XML output.\n-Xhash        Use the 
given hash algorithm during challenge response. Supported\n              
algorithm names: SHA512, SHA384, SHA256 and SHA1.\n-Xdebug       Writes a 
transmission log to disk for debugging purposes. If a\n              file name 
is given, it is used, otherwise a file called\n              
monet<timestamp>.log is created.  A given file never be\n              
overwritten; instead a unique variation of the file is used.\n-Xbatching    
Indicates that a batch should be used instead of direct\n              
communication with the server for each statement.  If a number is\n             
 given, it is used as batch size.  i.e. 8000 would execute the\n              
contents on the batch after each 8
 000 statements read.  Batching\n              can greatly speedup the process 
of restoring a database dump.\n":
+            print(pout)
+            print("--help difference detected")
     except CalledProcessError as e:
         raise SystemExit(e.stderr)
 
     cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, '-f', 
os.path.join(TSTSRCBASE, TSTDIR, 'Tests', 'JdbcClient_create_tables.sql')]
     try:
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "":
+            print(perr)
+        if pout != "Operation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation successful\n":
+            print(pout)
+            print("create tables difference detected")
     except CalledProcessError as e:
         print(e.stderr, file=sys.stderr)
         raise SystemExit('ERROR: failed to create tables!')
@@ -31,6 +45,13 @@ if __name__ == '__main__':
     cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, '-f', 
os.path.join(TSTSRCBASE, TSTDIR, 'Tests', 'JdbcClient_inserts_selects.sql')]
     try:
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "":
+            print(perr)
+        if pout != "Operation successful\n1 affected row\n1 affected row\n1 
affected row\n1 affected row\n1 affected row\n1 affected row\n1 affected row\n1 
affected row\n1 affected row\n1 affected row\n1 affected row\n1 affected row\n1 
affected row\n1 affected 
row\n+------+---------+-----------+--------+----------+\n| id   | subject | 
predicate | object | explicit 
|\n+======+=========+===========+========+==========+\n|    1 |       1 |       
  1 |      1 | false    |\n|    2 |       1 |         1 |      2 | false    
|\n|    3 |       1 |         2 |      1 | false    |\n|    4 |       2 |       
  1 |      1 | false    |\n|    5 |       1 |         2 |      2 | false    
|\n|    6 |       2 |         2 |      1 | false    |\n|    7 |       2 |       
  2 |      2 | false    
|\n+------+---------+-----------+--------+----------+\n7 
rows\n+------+---------+-----------+--------+\n| id   | subject | predicate | 
object |\n+======+=========+===========+========+\n|    1 |       1 |         1
  |      1 |\n|    2 |       2 |         2 |      2 |\n|    3 |       1 |       
  2 |      2 |\n|    4 |       2 |         2 |      1 |\n|    5 |       2 |     
    1 |      1 |\n|    6 |       1 |         2 |      1 |\n|    7 |       1 |   
      1 |      2 |\n+------+---------+-----------+--------+\n7 rows\n7 affected 
rows\n+------+---------+-----------+--------+----------+\n| id   | subject | 
predicate | object | explicit 
|\n+======+=========+===========+========+==========+\n|    1 |       1 |       
  1 |      1 | false    |\n|    2 |       1 |         1 |      2 | false    
|\n|    3 |       1 |         2 |      1 | false    |\n|    4 |       2 |       
  1 |      1 | false    |\n|    5 |       1 |         2 |      2 | false    
|\n|    6 |       2 |         2 |      1 | false    |\n|    7 |       2 |       
  2 |      2 | false    
|\n+------+---------+-----------+--------+----------+\n7 
rows\n+---------+--------+-----------+-----------+\n| subject | counts | 
min_value | max_value |\n
 +=========+========+===========+===========+\n|       1 |      4 |         1 | 
        1 |\n|       2 |      3 |         2 |         2 
|\n+---------+--------+-----------+-----------+\n2 
rows\n+-----------+--------+-----------+-----------+\n| predicate | counts | 
min_value | max_value |\n+===========+========+===========+===========+\n|      
   1 |      3 |         1 |         1 |\n|         2 |      4 |         2 |     
    2 |\n+-----------+--------+-----------+-----------+\n2 
rows\n+--------+--------+-----------+-----------+\n| object | counts | 
min_value | max_value |\n+========+========+===========+===========+\n|      1 
|      4 |         1 |         1 |\n|      2 |      3 |         2 |         2 
|\n+--------+--------+-----------+-----------+\n2 rows\nOperation successful\n":
+            print(pout)
+            print("inserts selects difference detected")
     except CalledProcessError as e:
         print(e.stderr, file=sys.stderr)
         raise SystemExit('ERROR: failed to insert!')
@@ -38,12 +59,26 @@ if __name__ == '__main__':
     cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, '-D']
     try:
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "":
+            print(perr)
+        if pout != 'START TRANSACTION;\n\nSET SCHEMA "sys";\n\nCREATE MERGE 
TABLE "sys"."mt" (\n\t"id" INTEGER       NOT NULL,\n\t"nm" VARCHAR(123)  NOT 
NULL,\n\tCONSTRAINT "mt_id_pkey" PRIMARY KEY ("id")\n);\n\nCREATE REMOTE TABLE 
"sys"."remt" (\n\t"id" INTEGER       NOT NULL,\n\t"nm" VARCHAR(123)  NOT 
NULL,\n\tCONSTRAINT "remt_id_pkey" PRIMARY KEY ("id")\n) ON 
\'mapi:monetdb://localhost:42001/mdb3\';\n\nCREATE REPLICA TABLE "sys"."replt" 
(\n\t"id" INTEGER       NOT NULL,\n\t"nm" VARCHAR(123)  NOT NULL,\n\tCONSTRAINT 
"replt_id_pkey" PRIMARY KEY ("id")\n);\n\nCREATE TABLE "sys"."allnewtriples" 
(\n\t"id"        INTEGER       NOT NULL,\n\t"subject"   INTEGER       NOT 
NULL,\n\t"predicate" INTEGER       NOT NULL,\n\t"object"    INTEGER       NOT 
NULL,\n\t"explicit"  BOOLEAN       NOT NULL,\n\tCONSTRAINT 
"allnewtriples_id_pkey" PRIMARY KEY ("id"),\n\tCONSTRAINT "unique_key" UNIQUE 
("subject", "predicate", "object")\n);\nCREATE INDEX "allnewtriples_object_idx" 
ON "sys"."allnewtriples" ("
 object");\nCREATE INDEX "allnewtriples_predicate_idx" ON "sys"."allnewtriples" 
("predicate");\nCREATE INDEX "allnewtriples_subject_idx" ON 
"sys"."allnewtriples" ("subject");\n\nINSERT INTO "sys"."allnewtriples" VALUES 
(1, 1, 1, 1, false);\nINSERT INTO "sys"."allnewtriples" VALUES (2, 1, 1, 2, 
false);\nINSERT INTO "sys"."allnewtriples" VALUES (3, 1, 2, 1, false);\nINSERT 
INTO "sys"."allnewtriples" VALUES (4, 2, 1, 1, false);\nINSERT INTO 
"sys"."allnewtriples" VALUES (5, 1, 2, 2, false);\nINSERT INTO 
"sys"."allnewtriples" VALUES (6, 2, 2, 1, false);\nINSERT INTO 
"sys"."allnewtriples" VALUES (7, 2, 2, 2, false);\n\nCREATE TABLE 
"sys"."foreign" (\n\t"id"        INTEGER       NOT NULL,\n\t"subject"   INTEGER 
      NOT NULL,\n\t"predicate" INTEGER       NOT NULL,\n\t"object"    INTEGER   
    NOT NULL,\n\tCONSTRAINT "foreign_id_fkey" FOREIGN KEY ("id") REFERENCES 
"sys"."allnewtriples" ("id") ON UPDATE RESTRICT ON DELETE 
RESTRICT,\n\tCONSTRAINT "foreign_subject_predicate_object_fkey" FOREIG
 N KEY ("subject", "predicate", "object") REFERENCES "sys"."allnewtriples" 
("subject", "predicate", "object") ON UPDATE RESTRICT ON DELETE 
RESTRICT\n);\n\nINSERT INTO "sys"."foreign" VALUES (1, 1, 1, 1);\nINSERT INTO 
"sys"."foreign" VALUES (2, 2, 2, 2);\nINSERT INTO "sys"."foreign" VALUES (3, 1, 
2, 2);\nINSERT INTO "sys"."foreign" VALUES (4, 2, 2, 1);\nINSERT INTO 
"sys"."foreign" VALUES (5, 2, 1, 1);\nINSERT INTO "sys"."foreign" VALUES (6, 1, 
2, 1);\nINSERT INTO "sys"."foreign" VALUES (7, 1, 1, 2);\n\nCREATE TABLE 
"sys"."triples" (\n\t"id"        INTEGER       NOT NULL,\n\t"subject"   INTEGER 
      NOT NULL,\n\t"predicate" INTEGER       NOT NULL,\n\t"object"    INTEGER   
    NOT NULL,\n\t"explicit"  BOOLEAN       NOT NULL,\n\tCONSTRAINT 
"triples_subject_predicate_object_unique" UNIQUE ("subject", "predicate", 
"object")\n);\nCREATE INDEX "triples_object_idx" ON "sys"."triples" 
("object");\nCREATE INDEX "triples_predicate_idx" ON "sys"."triples" 
("predicate");\nCREATE INDEX "triples_pr
 edicate_object_idx" ON "sys"."triples" ("predicate", "object");\nCREATE INDEX 
"triples_subject_idx" ON "sys"."triples" ("subject");\nCREATE INDEX 
"triples_subject_object_idx" ON "sys"."triples" ("subject", "object");\nCREATE 
INDEX "triples_subject_predicate_idx" ON "sys"."triples" ("subject", 
"predicate");\n\nINSERT INTO "sys"."triples" VALUES (1, 1, 1, 1, 
false);\nINSERT INTO "sys"."triples" VALUES (2, 1, 1, 2, false);\nINSERT INTO 
"sys"."triples" VALUES (3, 1, 2, 1, false);\nINSERT INTO "sys"."triples" VALUES 
(4, 2, 1, 1, false);\nINSERT INTO "sys"."triples" VALUES (5, 1, 2, 2, 
false);\nINSERT INTO "sys"."triples" VALUES (6, 2, 2, 1, false);\nINSERT INTO 
"sys"."triples" VALUES (7, 2, 2, 2, false);\n\ncreate or replace view 
object_stats as select "object", cast(count(*) as bigint) as counts, 
min("object") as min_value, max("object") as max_value from "triples" group by 
"object" order by "object"\n;\n\ncreate view predicate_stats as select 
"predicate", cast(count(*) as bigint) as co
 unts, min("predicate") as min_value, max("predicate") as max_value from 
"triples" group by "predicate" order by "predicate"\n;\n\ncreate view 
subject_stats as select "subject", cast(count(*) as bigint) as counts, 
min("subject") as min_value, max("subject") as max_value from "triples" group 
by "subject" order by "subject"\n;\n\nCOMMIT;\n':
+            print(pout)
+            print("-D difference detected")
     except CalledProcessError as e:
         raise SystemExit(e.stderr)
 
     cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, '-f', 
os.path.join(TSTSRCBASE, TSTDIR, 'Tests', 'JdbcClient_drop_tables.sql')]
     try:
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "":
+            print(perr)
+        if pout != "Operation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\nOperation successful\nOperation 
successful\nOperation successful\n":
+            print(pout)
+            print("drop tables difference detected")
     except CalledProcessError as e:
         raise SystemExit(e.stderr)
 
@@ -51,13 +86,30 @@ if __name__ == '__main__':
         # test the ON CLIENT download/export functionality via JdbcClient with 
--csvdir argument (to enable the ON CLIENT functionality)
         cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, 
'--csvdir', os.path.join(TSTSRCBASE, TSTDIR, 'Tests'), '-f', 
os.path.join(TSTSRCBASE, TSTDIR, 'Tests', 'OnClientDownloadData.sql')]
         p = run(cmd, stdout=PIPE, stderr=PIPE, check=True, encoding='utf-8')
+        pout = str(p.stdout)
+        perr = str(p.stderr)
+        if perr != "Error on line 12: [22000] Missing file name\nError on line 
30: [22000] Requested file compression format .bz2 is not supported. Use .gz 
instead.\nError on line 32: [22000] Requested file compression format .lz4 is 
not supported. Use .gz instead.\nError on line 34: [22000] Requested file 
compression format .xz is not supported. Use .gz instead.\nError on line 36: 
[22000] Requested file compression format .zip is not supported. Use .gz 
instead.\n":
+            print(perr)
+            print("OnClientDownloadData err difference detected")
+        if pout != "":
+            print(pout)
+            print("OnClientDownloadData out difference detected")
+
         # test the ON CLIENT upload/import functionality via JdbcClient with 
--csvdir argument (to enable the ON CLIENT functionality)
         cmd = ['java', CLIENT, '-h', HOST, '-p', MAPIPORT, '-d', TSTDB, 
'--csvdir', os.path.join(TSTSRCBASE, TSTDIR, 'Tests'), '-f', 
os.path.join(TSTSRCBASE, TSTDIR, 'Tests', 'OnClientUploadData.sql')]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to