Changeset: fb107b3efc35 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fb107b3efc35
Modified Files:
        sql/backends/monet5/sql_upgrades.c
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.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.32bit
        sql/test/emptydb-upgrade/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.32bit
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
        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:

Move upgrade code to correct function.


diffs (253 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
@@ -2398,8 +2398,6 @@ sql_update_jul2021(Client c, mvc *sql, c
                                                        "external name 
\"sql\".\"deltas\";\n"
                                                        "update sys.functions 
set system = true"
                                                        " where schema_id = 
2000 and name = 'deltas';\n");
-                       pos += snprintf(buf + pos, bufsize - pos, 
-                                                       "create view 
sys.malfunctions as select * from sys.malfunctions();\n");
 
                        /* 26_sysmon */
                        t = mvc_bind_table(sql, s, "queue");
@@ -3527,6 +3525,12 @@ sql_update_default(Client c, mvc *sql, c
 
        pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
 
+       /* 25_debug.sql */
+       pos += snprintf(buf + pos, bufsize - pos,
+                                       "create view sys.malfunctions as select 
* from sys.malfunctions();\n"
+                                       "update sys._tables set system = true 
where system <> true and schema_id = 2000"
+                                       " and name = 'malfunctions';\n");
+
        /* 52_describe.sql; but we need to drop most everything from
         * 76_dump.sql first */
        t = mvc_bind_table(sql, s, "dump_privileges");
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -4233,6 +4233,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git 
a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
@@ -4233,6 +4233,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -4233,6 +4233,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -4233,6 +4233,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
diff --git a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -19,6 +19,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
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
@@ -4233,6 +4233,8 @@ external name mtime.epoch;
 grant execute on function sys.epoch (DECIMAL(18,3)) to public;
 update sys.functions set system = true where system <> true and name in 
('epoch') and schema_id = 2000 and type = 1;
 set schema "sys";
+create view sys.malfunctions as select * from sys.malfunctions();
+update sys._tables set system = true where system <> true and schema_id = 2000 
and name = 'malfunctions';
 drop function sys.dump_database(boolean);
 drop procedure sys.dump_table_data();
 drop procedure sys._dump_table_data(string, string);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to