Changeset: df3a6484527e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df3a6484527e 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/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.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: oscar Log Message:
Fix upgrade. diffs (truncated from 153489 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 @@ -36,6 +36,7 @@ sql_fix_system_tables(Client c, mvc *sql char *buf = GDKmalloc(bufsize), *err = NULL; node *n; sql_schema *s; + static const char *boolnames[2] = {"false", "true"}; if (buf == NULL) throw(SQL, __func__, SQLSTATE(HY013) MAL_MALLOC_FAIL); @@ -83,12 +84,12 @@ sql_fix_system_tables(Client c, mvc *sql func->base.id, func->base.name, func->imp, func->mod, (int) FUNC_LANG_INT, (int) func->type, - func->side_effect ? "true" : "false", - func->varres ? "true" : "false", - func->vararg ? "true" : "false", + boolnames[func->side_effect], + boolnames[func->varres], + boolnames[func->vararg], func->s ? func->s->base.id : s->base.id, - func->system ? "true" : "false", - func->semantics ? "true" : "false"); + boolnames[func->system], + boolnames[func->semantics]); if (func->res) { for (m = func->res->h; m; m = m->next, number++) { arg = m->data; @@ -2315,132 +2316,6 @@ sql_update_oscar(Client c, mvc *sql, con /* Move sys.degrees and sys.radians to sql_types.c definitions (I did this at the bat_logger) Remove the obsolete entries at privileges table */ pos += snprintf(buf + pos, bufsize - pos, "delete from privileges where obj_id in (select obj_id from privileges left join functions on privileges.obj_id = functions.id where functions.id is null and privileges.obj_id not in ((SELECT tables.id from tables), 0));\n"); - pos += snprintf(buf + pos, bufsize - pos, - "UPDATE sys.functions set semantics = false WHERE (name, func) IN (VALUES \n" - "('length', 'nitems'),\n" - "('octet_length', 'nitems'),\n" - "('>', '>'),\n" - "('>=', '>='),\n" - "('<', '<'),\n" - "('<=', '<='),\n" - "('min', 'min'),\n" - "('max', 'max'),\n" - "('sql_min', 'min'),\n" - "('sql_max', 'max'),\n" - "('least', 'min_no_nil'),\n" - "('greatest', 'max_no_nil'),\n" - "('sum', 'sum'),\n" - "('prod', 'prod'),\n" - "('mod', '%%'),\n" - "('and', 'and'),\n" - "('xor', 'xor'),\n" - "('not', 'not'),\n" - "('sql_mul', '*'),\n" - "('sql_div', '/'),\n" - "('sql_sub', '-'),\n" - "('sql_add', '+'),\n" - "('bit_and', 'and'),\n" - "('bit_or', 'or'),\n" - "('bit_xor', 'xor'),\n" - "('bit_not', 'not'),\n" - "('left_shift', '<<'),\n" - "('right_shift', '>>'),\n" - "('abs', 'abs'),\n" - "('sign', 'sign'),\n" - "('scale_up', '*'),\n" - "('scale_down', 'dec_round'),\n" - "('round', 'round'),\n" - "('power', 'pow'),\n" - "('floor', 'floor'),\n" - "('ceil', 'ceil'),\n" - "('ceiling', 'ceil'),\n" - "('sin', 'sin'),\n" - "('cos', 'cos'),\n" - "('tan', 'tan'),\n" - "('asin', 'asin'),\n" - "('acos', 'acos'),\n" - "('atan', 'atan'),\n" - "('atan', 'atan2'),\n" - "('sinh', 'sinh'),\n" - "('cot', 'cot'),\n" - "('cosh', 'cosh'),\n" - "('tanh', 'tanh'),\n" - "('sqrt', 'sqrt'),\n" - "('exp', 'exp'),\n" - "('log', 'log'),\n" - "('ln', 'log'),\n" - "('log10', 'log10'),\n" - "('log2', 'log2'),\n" - "('degrees', 'degrees'),\n" - "('radians', 'radians'),\n" - "('pi', 'pi'),\n" - "('curdate', 'current_date'),\n" - "('current_date', 'current_date'),\n" - "('curtime', 'current_time'),\n" - "('current_time', 'current_time'),\n" - "('current_timestamp', 'current_timestamp'),\n" - "('localtime', 'current_time'),\n" - "('localtimestamp', 'current_timestamp'),\n" - "('sql_sub', 'diff'),\n" - "('sql_sub', 'date_sub_msec_interval'),\n" - "('sql_sub', 'date_sub_month_interval'),\n" - "('sql_sub', 'time_sub_msec_interval'),\n" - "('sql_sub', 'timestamp_sub_msec_interval'),\n" - "('sql_sub', 'timestamp_sub_month_interval'),\n" - "('sql_add', 'date_add_msec_interval'),\n" - "('sql_add', 'addmonths'),\n" - "('sql_add', 'timestamp_add_msec_interval'),\n" - "('sql_add', 'timestamp_add_month_interval'),\n" - "('sql_add', 'time_add_msec_interval'),\n" - "('local_timezone', 'local_timezone'),\n" - "('century', 'century'),\n" - "('decade', 'decade'),\n" - "('year', 'year'),\n" - "('quarter', 'quarter'),\n" - "('month', 'month'),\n" - "('day', 'day'),\n" - "('dayofyear', 'dayofyear'),\n" - "('weekofyear', 'weekofyear'),\n" - "('dayofweek', 'dayofweek'),\n" - "('dayofmonth', 'day'),\n" - "('week', 'weekofyear'),\n" - "('hour', 'hours'),\n" - "('minute', 'minutes'),\n" - "('second', 'sql_seconds'),\n" - "('second', 'seconds'),\n" - "('strings', 'strings'),\n" - "('locate', 'locate'),\n" - "('charindex', 'locate'),\n" - "('splitpart', 'splitpart'),\n" - "('substring', 'substring'),\n" - "('substr', 'substring'),\n" - "('truncate', 'stringleft'),\n" - "('concat', '+'),\n" - "('ascii', 'ascii'),\n" - "('code', 'unicode'),\n" - "('length', 'length'),\n" - "('right', 'stringright'),\n" - "('left', 'stringleft'),\n" - "('upper', 'toUpper'),\n" - "('ucase', 'toUpper'),\n" - "('lower', 'toLower'),\n" - "('lcase', 'toLower'),\n" - "('trim', 'trim'),\n" - "('ltrim', 'ltrim'),\n" - "('rtrim', 'rtrim'),\n" - "('lpad', 'lpad'),\n" - "('rpad', 'rpad'),\n" - "('insert', 'insert'),\n" - "('replace', 'replace'),\n" - "('repeat', 'repeat'),\n" - "('space', 'space'),\n" - "('char_length', 'length'),\n" - "('character_length', 'length'),\n" - "('octet_length', 'nbytes'),\n" - "('soundex', 'soundex'),\n" - "('qgramnormalize', 'qgramnormalize')\n" - ") and type <> %d;\n", - F_ANALYTIC); pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", prev_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 @@ -205,11 +205,11 @@ insert into sys.args values (34886, 70, insert into sys.args values (34887, 70, 'arg_1', 'bigint', 64, 0, 1, 1); insert into sys.args values (34888, 70, 'arg_2', 'int', 32, 0, 1, 2); insert into sys.args values (34889, 70, 'arg_3', 'any', 0, 0, 1, 3); -insert into sys.functions values (71, '=', '=', 'calc', 0, 1, false, false, false, 2000, true, true); +insert into sys.functions values (71, '=', '=', 'calc', 0, 1, false, false, false, 2000, true, false); insert into sys.args values (34890, 71, 'res_0', 'boolean', 1, 0, 0, 0); insert into sys.args values (34891, 71, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34892, 71, 'arg_2', 'any', 0, 0, 1, 2); -insert into sys.functions values (72, '<>', '!=', 'calc', 0, 1, false, false, false, 2000, true, true); +insert into sys.functions values (72, '<>', '!=', 'calc', 0, 1, false, false, false, 2000, true, false); insert into sys.args values (34893, 72, 'res_0', 'boolean', 1, 0, 0, 0); insert into sys.args values (34894, 72, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34895, 72, 'arg_2', 'any', 0, 0, 1, 2); @@ -235,7 +235,7 @@ insert into sys.functions values (78, '< insert into sys.args values (34909, 78, 'res_0', 'boolean', 1, 0, 0, 0); insert into sys.args values (34910, 78, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34911, 78, 'arg_2', 'any', 0, 0, 1, 2); -insert into sys.functions values (79, 'between', 'between', 'calc', 0, 1, false, false, false, 2000, true, true); +insert into sys.functions values (79, 'between', 'between', 'calc', 0, 1, false, false, false, 2000, true, false); insert into sys.args values (34912, 79, 'res_0', 'boolean', 1, 0, 0, 0); insert into sys.args values (34913, 79, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34914, 79, 'arg_2', 'any', 0, 0, 1, 2); @@ -315,11 +315,11 @@ insert into sys.functions values (99, 's insert into sys.args values (34968, 99, 'res_0', 'any', 0, 0, 0, 0); insert into sys.args values (34969, 99, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34970, 99, 'arg_2', 'any', 0, 0, 1, 2); -insert into sys.functions values (100, 'least', 'min_no_nil', 'calc', 0, 1, false, false, false, 2000, true, false); +insert into sys.functions values (100, 'least', 'min_no_nil', 'calc', 0, 1, false, false, false, 2000, true, true); insert into sys.args values (34971, 100, 'res_0', 'any', 0, 0, 0, 0); insert into sys.args values (34972, 100, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34973, 100, 'arg_2', 'any', 0, 0, 1, 2); -insert into sys.functions values (101, 'greatest', 'max_no_nil', 'calc', 0, 1, false, false, false, 2000, true, false); +insert into sys.functions values (101, 'greatest', 'max_no_nil', 'calc', 0, 1, false, false, false, 2000, true, true); insert into sys.args values (34974, 101, 'res_0', 'any', 0, 0, 0, 0); insert into sys.args values (34975, 101, 'arg_1', 'any', 0, 0, 1, 1); insert into sys.args values (34976, 101, 'arg_2', 'any', 0, 0, 1, 2); @@ -328,5407 +328,5430 @@ insert into sys.args values (34977, 102, insert into sys.args values (34978, 102, 'arg_1', 'boolean', 1, 0, 1, 1); insert into sys.args values (34979, 102, 'arg_2', 'any', 0, 0, 1, 2); insert into sys.args values (34980, 102, 'arg_3', 'any', 0, 0, 1, 3); -insert into sys.functions values (103, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34981, 103, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (34982, 103, 'arg_1', 'tinyint', 8, 0, 1, 1); -insert into sys.functions values (104, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34983, 104, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (34984, 104, 'arg_1', 'smallint', 16, 0, 1, 1); +insert into sys.functions values (103, 'nullif', '', '', 0, 1, false, false, false, 2000, true, true); +insert into sys.args values (34981, 103, 'res_0', 'any', 0, 0, 0, 0); +insert into sys.args values (34982, 103, 'arg_1', 'any', 0, 0, 1, 1); +insert into sys.args values (34983, 103, 'arg_2', 'any', 0, 0, 1, 2); +insert into sys.functions values (104, 'coalesce', '', '', 0, 1, false, false, false, 2000, true, true); +insert into sys.args values (34984, 104, 'res_0', 'any', 0, 0, 0, 0); +insert into sys.args values (34985, 104, 'arg_1', 'any', 0, 0, 1, 1); +insert into sys.args values (34986, 104, 'arg_2', 'any', 0, 0, 1, 2); insert into sys.functions values (105, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34985, 105, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (34986, 105, 'arg_1', 'int', 32, 0, 1, 1); +insert into sys.args values (34987, 105, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (34988, 105, 'arg_1', 'tinyint', 8, 0, 1, 1); insert into sys.functions values (106, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34987, 106, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (34988, 106, 'arg_1', 'hugeint', 128, 0, 1, 1); +insert into sys.args values (34989, 106, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (34990, 106, 'arg_1', 'smallint', 16, 0, 1, 1); insert into sys.functions values (107, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34989, 107, 'res_0', 'bigint', 64, 0, 0, 0); -insert into sys.args values (34990, 107, 'arg_1', 'bigint', 64, 0, 1, 1); +insert into sys.args values (34991, 107, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (34992, 107, 'arg_1', 'int', 32, 0, 1, 1); insert into sys.functions values (108, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34991, 108, 'res_0', 'decimal', 38, 0, 0, 0); -insert into sys.args values (34992, 108, 'arg_1', 'decimal', 2, 0, 1, 1); +insert into sys.args values (34993, 108, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (34994, 108, 'arg_1', 'hugeint', 128, 0, 1, 1); insert into sys.functions values (109, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34993, 109, 'res_0', 'decimal', 38, 0, 0, 0); -insert into sys.args values (34994, 109, 'arg_1', 'decimal', 4, 0, 1, 1); +insert into sys.args values (34995, 109, 'res_0', 'bigint', 64, 0, 0, 0); +insert into sys.args values (34996, 109, 'arg_1', 'bigint', 64, 0, 1, 1); insert into sys.functions values (110, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34995, 110, 'res_0', 'decimal', 38, 0, 0, 0); -insert into sys.args values (34996, 110, 'arg_1', 'decimal', 9, 0, 1, 1); +insert into sys.args values (34997, 110, 'res_0', 'decimal', 38, 0, 0, 0); +insert into sys.args values (34998, 110, 'arg_1', 'decimal', 2, 0, 1, 1); insert into sys.functions values (111, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34997, 111, 'res_0', 'decimal', 38, 0, 0, 0); -insert into sys.args values (34998, 111, 'arg_1', 'decimal', 18, 0, 1, 1); +insert into sys.args values (34999, 111, 'res_0', 'decimal', 38, 0, 0, 0); +insert into sys.args values (35000, 111, 'arg_1', 'decimal', 4, 0, 1, 1); insert into sys.functions values (112, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (34999, 112, 'res_0', 'decimal', 38, 0, 0, 0); -insert into sys.args values (35000, 112, 'arg_1', 'decimal', 38, 0, 1, 1); -insert into sys.functions values (113, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (35001, 113, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (35002, 113, 'arg_1', 'tinyint', 8, 0, 1, 1); -insert into sys.functions values (114, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (35003, 114, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (35004, 114, 'arg_1', 'smallint', 16, 0, 1, 1); +insert into sys.args values (35001, 112, 'res_0', 'decimal', 38, 0, 0, 0); +insert into sys.args values (35002, 112, 'arg_1', 'decimal', 9, 0, 1, 1); +insert into sys.functions values (113, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); +insert into sys.args values (35003, 113, 'res_0', 'decimal', 38, 0, 0, 0); +insert into sys.args values (35004, 113, 'arg_1', 'decimal', 18, 0, 1, 1); +insert into sys.functions values (114, 'sum', 'sum', 'aggr', 0, 3, false, false, false, 2000, true, false); +insert into sys.args values (35005, 114, 'res_0', 'decimal', 38, 0, 0, 0); +insert into sys.args values (35006, 114, 'arg_1', 'decimal', 38, 0, 1, 1); insert into sys.functions values (115, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (35005, 115, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (35006, 115, 'arg_1', 'int', 32, 0, 1, 1); +insert into sys.args values (35007, 115, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (35008, 115, 'arg_1', 'tinyint', 8, 0, 1, 1); insert into sys.functions values (116, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (35007, 116, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (35008, 116, 'arg_1', 'bigint', 64, 0, 1, 1); +insert into sys.args values (35009, 116, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (35010, 116, 'arg_1', 'smallint', 16, 0, 1, 1); insert into sys.functions values (117, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); -insert into sys.args values (35009, 117, 'res_0', 'hugeint', 128, 0, 0, 0); -insert into sys.args values (35010, 117, 'arg_1', 'hugeint', 128, 0, 1, 1); -insert into sys.functions values (118, 'mod', '%', 'calc', 0, 1, false, false, false, 2000, true, false); -insert into sys.args values (35011, 118, 'res_0', 'oid', 63, 0, 0, 0); -insert into sys.args values (35012, 118, 'arg_1', 'oid', 63, 0, 1, 1); -insert into sys.args values (35013, 118, 'arg_2', 'oid', 63, 0, 1, 2); -insert into sys.functions values (119, 'mod', '%', 'calc', 0, 1, false, false, false, 2000, true, false); -insert into sys.args values (35014, 119, 'res_0', 'tinyint', 8, 0, 0, 0); -insert into sys.args values (35015, 119, 'arg_1', 'tinyint', 8, 0, 1, 1); -insert into sys.args values (35016, 119, 'arg_2', 'tinyint', 8, 0, 1, 2); +insert into sys.args values (35011, 117, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (35012, 117, 'arg_1', 'int', 32, 0, 1, 1); +insert into sys.functions values (118, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); +insert into sys.args values (35013, 118, 'res_0', 'hugeint', 128, 0, 0, 0); +insert into sys.args values (35014, 118, 'arg_1', 'bigint', 64, 0, 1, 1); +insert into sys.functions values (119, 'prod', 'prod', 'aggr', 0, 3, false, false, false, 2000, true, false); +insert into sys.args values (35015, 119, 'res_0', 'hugeint', 128, 0, 0, 0); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list