Changeset: b3c080115fb0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3c080115fb0
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.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
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.int128
Branch: default
Log Message:
Implemented upgrade of sys.corr aggregates that now return DOUBLE.
diffs (truncated from 446 to 300 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
@@ -910,6 +910,38 @@ sql_update_default(Client c, mvc *sql)
throw(SQL, "sql_update_jul2017", SQLSTATE(HY001)
MAL_MALLOC_FAIL);
pos += snprintf(buf + pos, bufsize - pos, "set schema \"sys\";\n");
+ /* 39_analytics.sql, 39_analytics_hge.sql */
+ pos += snprintf(buf + pos, bufsize - pos,
+ "drop aggregate corr(tinyint, tinyint);\n"
+ "drop aggregate corr(smallint, smallint);\n"
+ "drop aggregate corr(integer, integer);\n"
+ "drop aggregate corr(bigint, bigint);\n"
+ "drop aggregate corr(real, real);\n");
+#ifdef HAVE_HGE
+ if (have_hge)
+ pos += snprintf(buf + pos, bufsize - pos,
+ "drop aggregate corr(hugeint, hugeint);\n");
+#endif
+ pos += snprintf(buf + pos, bufsize - pos,
+ "create aggregate corr(e1 TINYINT, e2 TINYINT) returns
DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(tinyint, tinyint)
to public;\n"
+ "create aggregate corr(e1 SMALLINT, e2 SMALLINT)
returns DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(smallint,
smallint) to public;\n"
+ "create aggregate corr(e1 INTEGER, e2 INTEGER) returns
DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(integer, integer)
to public;\n"
+ "create aggregate corr(e1 BIGINT, e2 BIGINT) returns
DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(bigint, bigint) to
public;\n"
+ "create aggregate corr(e1 REAL, e2 REAL) returns
DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(real, real) to
public;\n");
+#ifdef HAVE_HGE
+ if (have_hge)
+ pos += snprintf(buf + pos, bufsize - pos,
+ "create aggregate corr(e1 HUGEINT, e2 HUGEINT)
returns DOUBLE\n\texternal name \"aggr\".\"corr\";\n"
+ "grant execute on aggregate sys.corr(hugeint, hugeint)
to public;\n");
+#endif
+ pos += snprintf(buf + pos, bufsize - pos,
+ "insert into sys.systemfunctions (select id from
sys.functions where name = 'corr' and schema_id = (select id from sys.schemas
where name = 'sys') and id not in (select function_id from
sys.systemfunctions));\n");
+
/* 60_wlcr.sql */
pos += snprintf(buf + pos, bufsize - pos,
"create procedure master()\n"
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
@@ -5309,6 +5309,31 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+drop aggregate corr(hugeint, hugeint);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(hugeint, hugeint) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -4600,6 +4600,27 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -5359,6 +5359,31 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+drop aggregate corr(hugeint, hugeint);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(hugeint, hugeint) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -5309,6 +5309,31 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+drop aggregate corr(hugeint, hugeint);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(hugeint, hugeint) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -4600,6 +4600,27 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -5359,6 +5359,31 @@ set schema "sys";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+drop aggregate corr(hugeint, hugeint);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(hugeint, hugeint) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -5307,6 +5307,31 @@ set schema "testschema";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+drop aggregate corr(hugeint, hugeint);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
+create aggregate corr(e1 BIGINT, e2 BIGINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(bigint, bigint) to public;
+create aggregate corr(e1 REAL, e2 REAL) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(real, real) to public;
+create aggregate corr(e1 HUGEINT, e2 HUGEINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(hugeint, hugeint) to public;
+insert into sys.systemfunctions (select id from sys.functions where name =
'corr' and schema_id = (select id from sys.schemas where name = 'sys') and id
not in (select function_id from sys.systemfunctions));
create procedure master()
external name wlc.master;
create procedure master(path 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
@@ -4595,6 +4595,27 @@ set schema "testschema";
Running database upgrade commands:
set schema "sys";
+drop aggregate corr(tinyint, tinyint);
+drop aggregate corr(smallint, smallint);
+drop aggregate corr(integer, integer);
+drop aggregate corr(bigint, bigint);
+drop aggregate corr(real, real);
+create aggregate corr(e1 TINYINT, e2 TINYINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(tinyint, tinyint) to public;
+create aggregate corr(e1 SMALLINT, e2 SMALLINT) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(smallint, smallint) to public;
+create aggregate corr(e1 INTEGER, e2 INTEGER) returns DOUBLE
+ external name "aggr"."corr";
+grant execute on aggregate sys.corr(integer, integer) to public;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list