Changeset: a94f4552e0c5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/a94f4552e0c5 Modified Files: sql/backends/monet5/sql_upgrades.c Branch: Aug2024 Log Message:
Backed out changeset c03572335d0e, removing the upgrade code for #7611. There were two problems with the upgrade code: - there is no check that the newly generated names are unique; - the internal data structures are not updated. Thinking more about the problem, I now think there is no real need to change the key names. They are unique the way they are, even if not descriptive. If users want different key names, they can change (recreate) the keys. diffs (50 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 @@ -4367,35 +4367,6 @@ sql_update_aug2024(Client c, mvc *sql, s return err; } -static str -sql_update_aug2024_sp3(Client c, mvc *sql, sql_schema *s) -{ - char *err; - res_table *output; - BAT *b; - - (void) sql; - (void) s; - err = SQLstatementIntern(c, "SELECT id FROM sys.keys WHERE type = 3 AND name LIKE '%_?';\n", "update", true, false, &output); - if (err) - return err; - b = BATdescriptor(output->cols[0].b); - if (b) { - if (BATcount(b) > 0) { - /* do update */ - const char query1[] = - "UPDATE sys.keys k SET name = (SELECT t.name FROM sys._tables t WHERE t.id = k.table_id) || '_' || (SELECT group_concat(kc.name, '_' /* ORDER BY kc.nr */) FROM sys.objects kc WHERE kc.id = k.id) || '_nndunique' WHERE k.type = 3 AND (k.table_id, k.name) IN (SELECT t.id, t.name || '_?' FROM sys._tables t WHERE NOT t.system);\n"; - printf("Running database upgrade commands:\n%s\n", query1); - fflush(stdout); - err = SQLstatementIntern(c, query1, "update", true, false, NULL); - } - BBPunfix(b->batCacheid); - } - res_table_destroy(output); - - return err; -} - int SQLupgrades(Client c, mvc *m) { @@ -4454,10 +4425,6 @@ SQLupgrades(Client c, mvc *m) goto handle_error; } - if ((err = sql_update_aug2024_sp3(c, m, s)) != NULL) { - goto handle_error; - } - return 0; handle_error: _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org