Changeset: 384b73ae03e7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=384b73ae03e7
Modified Files:
sql/backends/monet5/sql_scenario.c
Branch: default
Log Message:
Add catalog update code: function sys.zorder_slice is gone.
diffs (49 lines):
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -482,6 +482,23 @@ sql_update_jul2012(Client c)
return err; /* usually MAL_SUCCEED */
}
+static str
+sql_update_oct2012(Client c)
+{
+ char *buf = GDKmalloc(2048), *err = NULL;
+ size_t bufsize = 2048, pos = 0;
+
+ /* new function sys.alpha */
+ pos += snprintf(buf+pos, bufsize-pos, "drop function
sys.zorder_slice;\n");
+
+ assert(pos < 2048);
+
+ printf("Running database upgrade commands:\n%s\n", buf);
+ err = SQLstatementIntern(c, &buf, "update", 1, 0);
+ GDKfree(buf);
+ return err; /* usually MAL_SUCCEED */
+}
+
str
SQLinitClient(Client c)
{
@@ -627,6 +644,21 @@ SQLinitClient(Client c)
if ((err = sql_update_jul2012(c)) != NULL)
fprintf(stderr, "!%s\n", err);
}
+ /* if function sys.zorder_slice() does exist, we need
+ * to update */
+ {
+ list *l = sa_list(m->sa);
+ sql_find_subtype(&tp, "int", 0, 0);
+ list_append(l, &tp);
+ list_append(l, &tp);
+ list_append(l, &tp);
+ list_append(l, &tp);
+ if (sql_bind_func_(m->sa, mvc_bind_schema(m,"sys"),
+ "zorder_slice", l, F_FUNC )) {
+ if ((err = sql_update_oct2012(c)) != NULL)
+ fprintf(stderr, "!%s\n", err);
+ }
+ }
}
fflush(stdout);
fflush(stderr);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list