Changeset: 2c0004946fae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2c0004946fae
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: less_explain_info
Log Message:
Upgrade code to remove PLAN keyword from keywords sys table
diffs (31 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
@@ -5167,6 +5167,27 @@ sql_update_default(Client c, mvc *sql, s
sql->session->status = 0; /* if the function was not found
clean the error */
sql->errstr[0] = '\0';
}
+
+ err = SQLstatementIntern(c, "select keyword from sys.keywords where
keyword = 'PLAN';\n",
+ "update", true, false,
&output);
+ if (err)
+ return err;
+ b = BATdescriptor(output->cols[0].b);
+ res_table_destroy(output);
+ if (b == NULL)
+ throw(SQL, "sql.catalog", SQLSTATE(HY013) MAL_MALLOC_FAIL);
+ BATiter bi = bat_iterator(b);
+ if (BATcount(b) > 0) {
+ bat_iterator_end(&bi);
+ sql_table *t = mvc_bind_table(sql, s, "keywords");
+ t->access = TABLE_WRITABLE; /* make it writable else the delete
will fail */
+ err = SQLstatementIntern(c, "delete from sys.keywords where
keyword = 'PLAN';",
+ "update",
true, false, NULL);
+ t->system = TABLE_READONLY;
+ if (err)
+ return err;
+ }
+
return err;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]