Changeset: 67e839c04d97 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=67e839c04d97
Modified Files:
        sql/backends/monet5/sql_scenario.c
Branch: generator
Log Message:

Add upgrade code for generators.


diffs (61 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
@@ -575,8 +575,8 @@ update sys._tables\n\
 static str
 sql_update_feb2013_sp3(Client c)
 {
-       char *buf = GDKmalloc(4096), *err = NULL;
-       size_t bufsize = 4096, pos = 0;
+       char *buf = GDKmalloc(8192), *err = NULL;
+       size_t bufsize = 8192, pos = 0;
 
        /* aggregates on type WRD */
        pos += snprintf(buf + pos, bufsize - pos, "create aggregate 
sys.stddev_samp(val WRD) returns DOUBLE external name \"aggr\".\"stdev\";\n");
@@ -827,6 +827,46 @@ external name sql.analyze;\n");
        pos += snprintf(buf + pos, bufsize - pos, "drop procedure 
gzctruncate;\n");
        pos += snprintf(buf + pos, bufsize - pos, "drop procedure 
gzcexpand;\n");
 
+       pos += snprintf(buf+pos, bufsize - pos, "create function 
sys.generate_series(first tinyint, last tinyint)"
+               "returns table (value tinyint)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first tinyint, last 
tinyint, stepsize tinyint)"
+               "returns table (value tinyint)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first int, last int)"
+               "returns table (value int)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first int, last int, 
stepsize int)"
+               "returns table (value int)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first bigint, last bigint)"
+               "returns table (value bigint)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first bigint, last bigint, 
stepsize bigint)"
+               "returns table (value bigint)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first real, last real, 
stepsize real)"
+               "returns table (value real)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first double, last double, 
stepsize double)"
+               "returns table (value double)"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first decimal(10,2), last 
decimal(10,2), stepsize decimal(10,2))"
+               "returns table (value decimal(10,2))"
+               "external name generator.series;"
+               ""
+               "create function sys.generate_series(first timestamp, last 
timestamp, stepsize interval second)"
+               "returns table (value timestamp)"
+               "external name generator.series;");
+
        if (schema) {
                pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", schema);
                free(schema);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to