Changeset: 932d4646f21d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/932d4646f21d
Modified Files:
sql/backends/monet5/sql_upgrades.c
sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
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.int128
sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-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.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:
Upgrade code.
diffs (209 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
@@ -4777,6 +4777,13 @@ sql_update_default(Client c, mvc *sql)
pos += snprintf(buf + pos, bufsize - pos,
"update sys.functions set system = true where system <>
true and name in ('dump_database') and schema_id = 2000 and type = %d;\n",
F_UNION);
+ /* 12_url.sql */
+ pos += snprintf(buf + pos, bufsize - pos,
+ "CREATE function
sys.url_extract_host(url string, no_www bool) RETURNS STRING\n"
+ "EXTERNAL NAME
url.\"extractURLHost\";\n"
+ "GRANT EXECUTE ON FUNCTION
url_extract_host(string, bool) TO PUBLIC;\n"
+ "update sys.functions set
system = true where system <> true and name = 'url_extract_host' and schema_id
= 2000 and type = %d;\n", F_FUNC);
+
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, buf, "update", true, false, NULL);
diff --git
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
---
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -4234,4 +4234,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git
a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -4303,4 +4303,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git
a/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -4228,4 +4228,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
@@ -4297,4 +4297,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3102,4 +3102,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3171,4 +3171,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3096,4 +3096,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3165,4 +3165,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git
a/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
b/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -4234,4 +4234,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git
a/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
b/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -4303,4 +4303,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git
a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -4228,4 +4228,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
diff --git a/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
@@ -4297,4 +4297,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3102,4 +3102,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3171,4 +3171,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3096,4 +3096,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
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
@@ -3165,4 +3165,8 @@ RETURN sys.dump_statements;
END;
update sys._tables set system = true where name in
('describe_partition_tables', 'dump_partition_tables', 'dump_sequences',
'dump_start_sequences') AND schema_id = 2000;
update sys.functions set system = true where system <> true and name in
('dump_database') and schema_id = 2000 and type = 5;
+CREATE function sys.url_extract_host(url string, no_www bool) RETURNS STRING
+EXTERNAL NAME url."extractURLHost";
+GRANT EXECUTE ON FUNCTION url_extract_host(string, bool) TO PUBLIC;
+update sys.functions set system = true where system <> true and name =
'url_extract_host' and schema_id = 2000 and type = 1;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]