Changeset: 0de3cae5c463 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0de3cae5c463
Added Files:
sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.py
sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.err
sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.out
sql/test/miscellaneous/Tests/pk_fk_stress.py
sql/test/miscellaneous/Tests/pk_fk_stress.stable.err
sql/test/miscellaneous/Tests/pk_fk_stress.stable.out
Modified Files:
monetdb5/mal/Tests/tst051.stable.out
sql/rel.txt
sql/storage/bat/bat_storage.c
sql/storage/store.c
sql/test/BugTracker-2020/Tests/All
sql/test/miscellaneous/Tests/All
Branch: linear-hashing
Log Message:
Merged with Nov2019
diffs (truncated from 568 to 300 lines):
diff --git a/monetdb5/mal/Tests/tst051.stable.out
b/monetdb5/mal/Tests/tst051.stable.out
--- a/monetdb5/mal/Tests/tst051.stable.out
+++ b/monetdb5/mal/Tests/tst051.stable.out
@@ -48,10 +48,10 @@ stdout of test 'tst051` in directory 'mo
[ "orld" ]
[ 0 ]
[ 0 ]
-[ 0 ]
-[ 0 ]
-[ 0 ]
-[ 0 ]
+[ nil ]
+[ nil ]
+[ nil ]
+[ nil ]
[ "abcabcabc" ]
[ nil ]
[ "hellobrave new world" ]
diff --git a/sql/rel.txt b/sql/rel.txt
--- a/sql/rel.txt
+++ b/sql/rel.txt
@@ -63,20 +63,20 @@ GROUPBY (card ATOM (no group by exps),
-> r is list of group by expressions
TOPN (card ATOM, AGGR, or MULTI (same card as lower relation))
- -> exps (list) int limit, [ int offset ]
+ -> exps (list) lng limit, [ lng offset ]
-> l is relation
-> flag (bounds for limit can be including (1) or excluding (0)
(ie later just returns the topN, including will return atleast N)
SAMPLE (card ATOM, AGGR, or MULTI (same card as lower relation))
- -> exps int rownumbers, (todo: double between [0,1] for
percentage)
+ -> exps first is either an lng for rownumbers or double between
[0,1] for percentage. An optional second contains an int for the seed value
-> l is relation
-> flag (0) no flags
-INSERT|DELETE|UPDATE (card MULTI)
+INSERT|DELETE|UPDATE|TRUNCATE (card MULTI)
-> l is relation to modify
-> r to be inserted/deleted/updated relation
For update the ->r projection joins in current
- values for 'none' updated columns.
+ values for 'none' updated columns. Not used in truncate.
-> flag (if set don't insert (is done already))
only (UPDATE)
@@ -108,29 +108,38 @@ e_cmp
-> l left sub expression
-> r right sub expression (f second arg (->f) for range expressions)
-> flag compare type
- ( cmp_gt = 0, or [ v > l && v < h ]
- cmp_gte = 1, or [ v >= l && v < h ]
- cmp_lte = 2, or [ v > l && v <= h ]
- cmp_lt = 3, or [ v >= l && v <= h ]
+ (
+ cmp_gt = 0, or [ v > l && v < h ]
+ cmp_gte = 1, or [ v >= l && v < h ]
+ cmp_lte = 2, or [ v > l && v <= h ]
+ cmp_lt = 3, or [ v >= l && v <= h ]
uses flag&CMP_BETWEEN bit for
handling nil
open ranges and isNull
vs NULL
uses flag&CMP_SYMMETRIC bit
for symmetric
- cmp_equal = 4,
- cmp_notequal = 5,
+ cmp_equal = 4,
+ cmp_notequal = 5,
- cmp_filter = 6, filters ->r is
a list of values
- cmp_or = 7, or handling ->l/r
are both lists
- cmp_in = 8, in list handling ->r is
a list of values
+ cmp_filter = 6, filters ->r is
a list of values
+ cmp_or = 7, or handling
->l/r are both lists
+ cmp_in = 8, in list handling
->r is a list of values
cmp_notin = 9 not in list handling ->r is
a list of values
+ cmp_equal_nil = 10, special equal for equi join case,
with nil = nil, at rel_dump, it prints =*
- mark_in = 10,
- mark_not_in = 11,
- mark_exists = 12,
- mark_not_exists = 13,
+ /* mark join cases */
+ mark_in = 11,
+ mark_not_in = 12,
+ mark_exists = 13,
+ mark_not_exists = 14,
- cmp_all = 14, cross product
+ /* The followin cmp_* are only used within stmt (not
sql_exp) */
+ cmp_all = 15, /* special case for
crossproducts */
+ cmp_project = 16, /* special case for
projection joins */
+ cmp_joined = 17, /* special case already
joined */
+ cmp_left = 18, /* special case equi
join, keep left order */
+ cmp_left_project = 19 /* last step of outer join */
+
+ cmp_all = 14, cross product
cmp_project = 15, special case for projection
joins
-
)
e_func
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -2822,6 +2822,7 @@ update_table(sql_trans *tr, sql_table *f
}
}
+ oc->type = cc->type;
oc->colnr = cc->colnr;
oc->null = cc->null;
oc->unique = cc->unique;
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3272,7 +3272,6 @@ sql_trans_name_conflict( sql_trans *tr,
return sql_trans_tname_conflict(tr, s, NULL, tname,
cname);
}
return 0;
-
}
sql_column *
@@ -4500,9 +4499,10 @@ reset_column(sql_trans *tr, sql_column *
return LOG_ERR;
}
- fc->colnr = pfc->colnr;
+ fc->type = pfc->type;
fc->null = pfc->null;
fc->unique = pfc->unique;
+ fc->colnr = pfc->colnr;
fc->storage_type = NULL;
if (pfc->storage_type)
fc->storage_type = pfc->storage_type;
diff --git a/sql/test/BugTracker-2020/Tests/All
b/sql/test/BugTracker-2020/Tests/All
--- a/sql/test/BugTracker-2020/Tests/All
+++ b/sql/test/BugTracker-2020/Tests/All
@@ -1,2 +1,3 @@
median_avg-nulls.Bug-6807
ifthenelse-crash.Bug-6815
+alter-table-add-column-Bug-6816
diff --git a/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.py
b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.py
@@ -0,0 +1,31 @@
+import sys
+
+try:
+ from MonetDBtesting import process
+except ImportError:
+ import process
+
+s = process.server(args = [], stdin = process.PIPE, stdout = process.PIPE,
stderr = process.PIPE)
+c1 = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr
= process.PIPE)
+c2 = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr
= process.PIPE)
+
+out, err = c1.communicate('''\
+CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));\
+INSERT INTO "testVarcharToClob" VALUES ('value1'), ('value2');\
+ALTER TABLE "testVarcharToClob" add "clobColumn" TEXT NULL;\
+UPDATE "testVarcharToClob" SET "clobColumn" = "varcharColumn";\
+ALTER TABLE "testVarcharToClob" drop "varcharColumn";
+''')
+sys.stdout.write(out)
+sys.stderr.write(err)
+
+out, err = c2.communicate('''\
+INSERT INTO "testVarcharToClob" VALUES ('value3');\
+DROP TABLE "testVarcharToClob";
+''')
+sys.stdout.write(out)
+sys.stderr.write(err)
+
+out, err = s.communicate()
+sys.stdout.write(out)
+sys.stderr.write(err)
diff --git
a/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.err
b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.err
@@ -0,0 +1,24 @@
+stderr of test 'alter-table-add-column-Bug-6816` in directory
'sql/test/BugTracker-2020` itself:
+
+
+# 14:03:52 >
+# 14:03:52 > "/usr/bin/python3" "alter-table-add-column-Bug-6816.py"
"alter-table-add-column-Bug-6816"
+# 14:03:52 >
+
+# builtin opt gdk_dbpath =
/home/ferreira/repositories/MonetDB-Nov2019/BUILD/var/monetdb5/dbfarm/demo
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_ipv6 = 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 = 36405
+# cmdline opt mapi_usock = /var/tmp/mtest-147833/.s.monetdb.36405
+# cmdline opt gdk_dbpath =
/home/ferreira/repositories/MonetDB-Nov2019/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2020
+
+# 14:03:53 >
+# 14:03:53 > "Done."
+# 14:03:53 >
+
diff --git
a/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.out
b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2020/Tests/alter-table-add-column-Bug-6816.stable.out
@@ -0,0 +1,74 @@
+stdout of test 'alter-table-add-column-Bug-6816` in directory
'sql/test/BugTracker-2020` itself:
+
+
+# 14:03:52 >
+# 14:03:52 > "/usr/bin/python3" "alter-table-add-column-Bug-6816.py"
"alter-table-add-column-Bug-6816"
+# 14:03:52 >
+
+#CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));INSERT INTO
"testVarcharToClob" VALUES ('value1'), ('value2');ALTER TABLE
"testVarcharToClob" add "clobColumn" TEXT NULL;UPDATE "testVarcharToClob" SET
"clobColumn" = "varcharColumn";ALTER TABLE "testVarcharToClob" drop
"varcharColumn";
+#CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));INSERT INTO
"testVarcharToClob" VALUES ('value1'), ('value2');ALTER TABLE
"testVarcharToClob" add "clobColumn" TEXT NULL;UPDATE "testVarcharToClob" SET
"clobColumn" = "varcharColumn";ALTER TABLE "testVarcharToClob" drop
"varcharColumn";
+[ 2 ]
+#CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));INSERT INTO
"testVarcharToClob" VALUES ('value1'), ('value2');ALTER TABLE
"testVarcharToClob" add "clobColumn" TEXT NULL;UPDATE "testVarcharToClob" SET
"clobColumn" = "varcharColumn";ALTER TABLE "testVarcharToClob" drop
"varcharColumn";
+#CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));INSERT INTO
"testVarcharToClob" VALUES ('value1'), ('value2');ALTER TABLE
"testVarcharToClob" add "clobColumn" TEXT NULL;UPDATE "testVarcharToClob" SET
"clobColumn" = "varcharColumn";ALTER TABLE "testVarcharToClob" drop
"varcharColumn";
+[ 2 ]
+#CREATE TABLE "testVarcharToClob" ("varcharColumn" varchar(255));INSERT INTO
"testVarcharToClob" VALUES ('value1'), ('value2');ALTER TABLE
"testVarcharToClob" add "clobColumn" TEXT NULL;UPDATE "testVarcharToClob" SET
"clobColumn" = "varcharColumn";ALTER TABLE "testVarcharToClob" drop
"varcharColumn";
+#INSERT INTO "testVarcharToClob" VALUES ('value3');DROP TABLE
"testVarcharToClob";
+[ 1 ]
+#INSERT INTO "testVarcharToClob" VALUES ('value3');DROP TABLE
"testVarcharToClob";
+# MonetDB 5 server v11.35.10 (hg id: f9ad2ccd83b7)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2020', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 15.498 GiB available main-memory of which we use 12.631 GiB
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on
mapi:monetdb://localhost.localdomain:36405/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-147833/.s.monetdb.36405
+# MonetDB/GIS module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 18_index.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_views.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 40_json_hge.sql
+# loading sql script: 41_md5sum.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 46_profiler.sql
+# loading sql script: 51_sys_schema_extension.sql
+# loading sql script: 60_wlcr.sql
+# loading sql script: 61_wlcr.sql
+# loading sql script: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_lidar.sql
+# loading sql script: 75_shp.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 85_bam.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+# MonetDB/SQL module loaded
+
+# 14:03:53 >
+# 14:03:53 > "Done."
+# 14:03:53 >
+
diff --git a/sql/test/miscellaneous/Tests/All b/sql/test/miscellaneous/Tests/All
--- a/sql/test/miscellaneous/Tests/All
+++ b/sql/test/miscellaneous/Tests/All
@@ -10,4 +10,5 @@ groupby_error
alter_table_add_column
view-mul-digits
select_groupby
+HAVE_PYMONETDB?pk_fk_stress
deallocate
diff --git a/sql/test/miscellaneous/Tests/pk_fk_stress.py
b/sql/test/miscellaneous/Tests/pk_fk_stress.py
new file mode 100644
--- /dev/null
+++ b/sql/test/miscellaneous/Tests/pk_fk_stress.py
@@ -0,0 +1,121 @@
+from __future__ import print_function
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list