Changeset: 241249759ced for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=241249759ced Modified Files: gdk/gdk_unique.c sql/backends/monet5/sql_result.c sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql Branch: default Log Message:
Merge with Dec2016 branch. diffs (64 lines): diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c --- a/gdk/gdk_unique.c +++ b/gdk/gdk_unique.c @@ -172,7 +172,7 @@ BATunique(BAT *b, BAT *s) s ? BATgetId(s) : "NULL", s ? BATcount(s) : 0); assert(vars == NULL); - seen = GDKzalloc(256 / 16); + seen = GDKzalloc((256 / 16) * sizeof(seen[0])); if (seen == NULL) goto bunins_failed; for (;;) { @@ -209,7 +209,7 @@ BATunique(BAT *b, BAT *s) s ? BATgetId(s) : "NULL", s ? BATcount(s) : 0); assert(vars == NULL); - seen = GDKzalloc(65536 / 16); + seen = GDKzalloc((65536 / 16) * sizeof(seen[0])); if (seen == NULL) goto bunins_failed; for (;;) { diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -1758,21 +1758,16 @@ mvc_export_head(backend *b, stream *s, i for (i = 0; i < t->nr_cols; i++) { res_col *c = t->cols + i; - if (strchr(c->name, ',') || strchr(c->name, ' ') || strchr(c->name , '\t') || strchr(c->name, '#')) { + if (strpbrk(c->name, ", \t#\"\\")) { + char *p; if (mnstr_write(s, "\"", 1, 1) != 1) return -1; - if (strchr(c->name, '"')) { - char *p; - for (p = c->name; *p; p++) { - if (*p == '"') { - if (mnstr_write(s, "\\", 1, 1) != 1) - return -1; - } - if (mnstr_write(s, p, 1, 1) != 1) + for (p = c->name; *p; p++) { + if (*p == '"' || *p == '\\') { + if (mnstr_write(s, "\\", 1, 1) != 1) return -1; } - } else { - if (mnstr_write(s, c->name, strlen(c->name), 1) != 1) + if (mnstr_write(s, p, 1, 1) != 1) return -1; } if (mnstr_write(s, "\"", 1, 1) != 1) diff --git a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql --- a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql +++ b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.sql @@ -3,7 +3,7 @@ set optimizer='sequential_pipe'; start transaction; --- only explain output because not like's give to many rows. +-- only explain output because not like's give too many rows. explain select name,func from functions where name like '%optimizers%'; explain select name,func from functions where name not like '%optimizers%'; explain select name,func from functions where name ilike '%optimizers%'; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list