Changeset: 02536bafbd83 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=02536bafbd83
Modified Files:
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/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:
Fix upgrade code.
diffs (204 lines):
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
@@ -1690,6 +1690,12 @@ sql_update_default(Client c, mvc *sql)
"insert into sys.systemfunctions (select f.id from
sys.functions f, sys.schemas s where f.name in ('createorderindex',
'droporderindex', 'storagemodelinit') and f.type = %d and f.schema_id = s.id
and s.name = 'sys');\n",
F_PROC);
pos += snprintf(buf + pos, bufsize - pos,
+ "insert into sys.systemfunctions (select f.id from
sys.functions f, sys.schemas s where f.name in ('getprofilerlimit') and f.type
= %d and f.schema_id = s.id and s.name = 'profiler');\n",
+ F_FUNC);
+ pos += snprintf(buf + pos, bufsize - pos,
+ "insert into sys.systemfunctions (select f.id from
sys.functions f, sys.schemas s where f.name in ('setprofilerlimit') and f.type
= %d and f.schema_id = s.id and s.name = 'profiler');\n",
+ F_PROC);
+ pos += snprintf(buf + pos, bufsize - pos,
"delete from systemfunctions where function_id not in
(select id from functions);\n");
if (schema)
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
@@ -190,6 +190,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
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
@@ -190,6 +190,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
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
@@ -234,6 +234,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
diff --git a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -33,6 +33,8 @@ external name sql.droporderindex;
drop function sys.zorder_decode_y;
drop function sys.zorder_decode_x;
drop function sys.zorder_encode;
+create function profiler.getprofilerlimit() returns integer external name
profiler.getprofilerlimit;
+create procedure profiler.setprofilerlimit(lim integer) external name
profiler.setprofilerlimit;
drop view sys.tablestoragemodel;
drop view sys.storagemodel;
drop function sys.storagemodel();
@@ -188,6 +190,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
@@ -232,8 +236,8 @@ set schema "sys";
# 11:37:27 >
#select 1;
-% .L1 # table_name
-% L1 # name
+% .L2 # table_name
+% L2 # name
% tinyint # type
% 1 # length
[ 1 ]
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
@@ -190,6 +190,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
@@ -234,6 +234,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "sys";
diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
--- a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
+++ b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
@@ -188,6 +188,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
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
@@ -185,6 +185,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
--- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
+++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
@@ -441,6 +441,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
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
@@ -229,6 +229,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
diff --git a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
--- a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
+++ b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
@@ -190,6 +190,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out
@@ -185,6 +185,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
@@ -429,6 +429,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
@@ -226,6 +226,8 @@ update sys._tables set system = true whe
alter table sys.statistics add column "revsorted" boolean;
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('storage', 'storagemodel') and f.type = 5 and f.schema_id =
s.id and s.name = 'sys');
insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('createorderindex', 'droporderindex', 'storagemodelinit')
and f.type = 2 and f.schema_id = s.id and s.name = 'sys');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('getprofilerlimit') and f.type = 1 and f.schema_id = s.id
and s.name = 'profiler');
+insert into sys.systemfunctions (select f.id from sys.functions f, sys.schemas
s where f.name in ('setprofilerlimit') and f.type = 2 and f.schema_id = s.id
and s.name = 'profiler');
delete from systemfunctions where function_id not in (select id from
functions);
set schema "testschema";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list