Changeset: a2b8b69d8c19 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2b8b69d8c19 Modified Files: gdk/gdk_bat.c sql/ChangeLog.Dec2016 sql/backends/monet5/sql_upgrades.c sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 Branch: default Log Message:
Merge with Dec2016 branch. diffs (180 lines): diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -1194,7 +1194,8 @@ BUNinplace(BAT *b, BUN p, const void *t, b->tnorevsorted = 0; if (((b->ttype != TYPE_void) & b->tkey & !b->tunique) && b->batCount > 1) { BATkey(b, FALSE); - } + } else if (!b->tkey && (b->tnokey[0] == p || b->tnokey[1] == p)) + b->tnokey[0] = b->tnokey[1] = 0; if (b->tnonil) b->tnonil = t && atom_CMP(t, ATOMnilptr(b->ttype), b->ttype) != 0; b->theap.dirty = TRUE; diff --git a/sql/ChangeLog.Dec2016 b/sql/ChangeLog.Dec2016 --- a/sql/ChangeLog.Dec2016 +++ b/sql/ChangeLog.Dec2016 @@ -1,3 +1,7 @@ # ChangeLog file for sql # This file is updated with Maddlog +* Tue Apr 11 2017 Sjoerd Mullender <sjo...@acm.org> +- Upgrade code was added for an old change in the sys.settimeout function. +- A bug was fixed with the automatic "vacuum" operation on system tables. + diff --git a/sql/backends/monet5/sql_upgrades.c b/sql/backends/monet5/sql_upgrades.c --- a/sql/backends/monet5/sql_upgrades.c +++ b/sql/backends/monet5/sql_upgrades.c @@ -1382,12 +1382,14 @@ sql_update_dec2016_sp3(Client c, mvc *sq pos += snprintf(buf + pos, bufsize - pos, "set schema \"sys\";\n" - "drop procedure sys.settimeout(bigint);" - "drop procedure sys.settimeout(bigint,bigint);" - "drop procedure sys.setsession(bigint);" - "create procedure sys.settimeout(\"query\" bigint) external name clients.settimeout;" - "create procedure sys.settimeout(\"query\" bigint, \"session\" bigint) external name clients.settimeout;" - "create procedure sys.setsession(\"timeout\" bigint) external name clients.setsession;"); + "drop procedure sys.settimeout(bigint);\n" + "drop procedure sys.settimeout(bigint,bigint);\n" + "drop procedure sys.setsession(bigint);\n" + "create procedure sys.settimeout(\"query\" bigint) external name clients.settimeout;\n" + "create procedure sys.settimeout(\"query\" bigint, \"session\" bigint) external name clients.settimeout;\n" + "create procedure sys.setsession(\"timeout\" bigint) external name clients.setsession;\n" + "insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions));\n" + "delete from systemfunctions where function_id not in (select id from functions);\n"); if (schema) pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", schema); assert(pos < bufsize); diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 --- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 +++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 @@ -26,6 +26,18 @@ stdout of test 'upgrade` in directory 's Ready. Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "sys"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out --- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out +++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out @@ -26,6 +26,18 @@ stdout of test 'upgrade` in directory 's Ready. Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "sys"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 --- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 +++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 @@ -70,6 +70,18 @@ set schema "sys"; Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "sys"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 --- a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 +++ b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 @@ -24,6 +24,18 @@ stdout of test 'upgrade` in directory 's Ready. Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "testschema"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out --- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out +++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out @@ -21,6 +21,18 @@ stdout of test 'upgrade` in directory 's Ready. Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "testschema"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 --- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 +++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 @@ -65,6 +65,18 @@ set schema "testschema"; Running database upgrade commands: set schema "sys"; +drop procedure sys.settimeout(bigint); +drop procedure sys.settimeout(bigint,bigint); +drop procedure sys.setsession(bigint); +create procedure sys.settimeout("query" bigint) external name clients.settimeout; +create procedure sys.settimeout("query" bigint, "session" bigint) external name clients.settimeout; +create procedure sys.setsession("timeout" bigint) external name clients.setsession; +insert into sys.systemfunctions (select id from sys.functions where name in ('settimeout', 'setsession') and schema_id = (select id from sys.schemas where name = 'sys') and id not in (select function_id from sys.systemfunctions)); +delete from systemfunctions where function_id not in (select id from functions); +set schema "testschema"; + +Running database upgrade commands: +set schema "sys"; delete from sys._columns where table_id = (select id from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys')); delete from sys._tables where name = 'connections' and schema_id = (select id from sys.schemas where name = 'sys'); drop function sys.malfunctions; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list