Changeset: 1703c2ca58b3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1703c2ca58b3 Modified Files: gdk/gdk_bat.c sql/server/rel_optimizer.c sql/server/rel_updates.c Branch: trails Log Message:
Merged with Jun2020 diffs (156 lines): diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -750,7 +750,7 @@ COLcopy(BAT *b, int tt, bool writable, r /* make sure we use the correct capacity */ bn->batCapacity = (BUN) (bn->ttype ? bn->theap.size >> bn->tshift : 0); - } else if (BATatoms[tt].atomFix || tt != TYPE_void || ATOMextern(tt)) { + } else if (BATatoms[tt].atomFix || ATOMextern(tt)) { /* case (4): one-by-one BUN insert (really slow) */ BUN p, q, r = 0; BATiter bi = bat_iterator(b); diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -7795,6 +7795,8 @@ rel_simplify_predicates(visitor *v, sql_ if (!strcmp(inf->func->base.name, "<>")) flag = !flag; + if (e->flag == cmp_notequal) + flag = !flag; assert(list_length(args) == 2); l = args->h->data; r = args->h->next->data; diff --git a/sql/server/rel_updates.c b/sql/server/rel_updates.c --- a/sql/server/rel_updates.c +++ b/sql/server/rel_updates.c @@ -1713,7 +1713,7 @@ copyfrom(sql_query *query, dlist *qname, size_t l = strlen(cs->type.type->sqlname); char *fname = sa_alloc(sql->sa, l+8); - snprintf(fname, l+8, "str_to_%s", cs->type.type->sqlname); + snprintf(fname, l+8, "str_to_%s", strcmp(cs->type.type->sqlname, "timestamptz") == 0 ? "timestamp" : cs->type.type->sqlname); sql_find_subtype(&st, "clob", 0, 0); f = sql_bind_func_result(sql->sa, sys, fname, F_FUNC, &cs->type, 2, &st, &st); if (!f) diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql b/sql/test/SQLancer/Tests/sqlancer01.sql --- a/sql/test/SQLancer/Tests/sqlancer01.sql +++ b/sql/test/SQLancer/Tests/sqlancer01.sql @@ -319,6 +319,23 @@ create view v1(c0) as (select distinct t select max(all abs(+ (- (- (-1620427795))))) from v0, t0 join v1 on ((((v1.c0)||(t0.c1)))ilike(v1.c0)); ROLLBACK; +START TRANSACTION; +CREATE TABLE "sys"."t1" ("c0" VARCHAR(427),"c1" TIME); +COPY 5 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +"-" NULL +"0.9494786438610024" NULL +"MA4DƹXb,⻇멫ho\trYmꈋP-aR" NULL +NULL 02:45:58 +NULL 05:45:05 + +SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8); +SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING (NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE +UNION ALL +SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING NOT ((NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE) +UNION ALL +SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING ((NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE) IS NULL; +ROLLBACK; + DROP TABLE tbl_ProductSales; DROP TABLE another_T; DROP TABLE integers; diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out b/sql/test/SQLancer/Tests/sqlancer01.stable.out --- a/sql/test/SQLancer/Tests/sqlancer01.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out @@ -213,8 +213,8 @@ stdout of test 'sqlancer01` in directory % int # type % 1 # length #select 1 from another_t join integers on (cast(another_t.col4 between 1 and 2 as int)) where false; -% .%15 # table_name -% %15 # name +% .%11 # table_name +% %11 # name % tinyint # type % 1 # length #SELECT another_T.col2 FROM tbl_productsales, integers LEFT OUTER JOIN another_T ON another_T.col1 > 1 WHERE another_T.col2 > 1 GROUP BY another_T.col2 HAVING COUNT((another_T.col2) IN (another_T.col2)) > 0; @@ -272,8 +272,8 @@ stdout of test 'sqlancer01` in directory % 1 # length [ 1 ] #select 1 from t0 where (3 in (1, 2)) is null; --simplified -% .%5 # table_name -% %5 # name +% .%4 # table_name +% %4 # name % tinyint # type % 1 # length #SELECT 1 FROM t0 WHERE t0.c0 BETWEEN SYMMETRIC (1 IN (2, 1)) AND t0.c0; @@ -625,6 +625,32 @@ stdout of test 'sqlancer01` in directory % 1 # length [ NULL ] #ROLLBACK; +#START TRANSACTION; +#CREATE TABLE "sys"."t1" ("c0" VARCHAR(427),"c1" TIME); +#COPY 5 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#"-" NULL +#"0.9494786438610024" NULL +#"MA4DƹXb,⻇멫ho\trYmꈋP-aR" NULL +#NULL 02:45:58 +#NULL 05:45:05 +[ 5 ] +#SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8); +% .%2 # table_name +% %2 # name +% tinyint # type +% 1 # length +[ NULL ] +#SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING (NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE +#UNION ALL +#SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING NOT ((NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE) +#UNION ALL +#SELECT MEDIAN(ALL abs(CASE TIMESTAMP '1970-01-24 09:25:06' WHEN TIMESTAMP '1970-01-19 10:35:50' THEN 2 END)) FROM t1 GROUP BY abs(0.8) HAVING ((NOT (MIN(ALL NOT (NOT ((0.7) IS NULL))))) = TRUE) IS NULL; +% .%23 # table_name +% %2 # name +% tinyint # type +% 1 # length +[ NULL ] +#ROLLBACK; #DROP TABLE tbl_ProductSales; #DROP TABLE another_T; #DROP TABLE integers; diff --git a/testing/Mfilter.py b/testing/Mfilter.py --- a/testing/Mfilter.py +++ b/testing/Mfilter.py @@ -157,7 +157,8 @@ def mFilter (FILE, IGNORE) : ftmp = [] - ig = n = 0 + n = 0 + ig = False il = iw = ic = el = ew = ec = al = aw = ac = 0 for iline in openutf8(FILE, 'rU'): iline = iline.replace('\033[?1034h','') @@ -173,7 +174,7 @@ def mFilter (FILE, IGNORE) : iline = re.sub(r'(\d+(?:\.\d*)?e[-+]?)0*(\d+)', r'\1\2', iline) oline = xline = "" if iline == "#~BeginVariableOutput~#\n" or iline == "#~BeginProfilingOutput~#\n" or iline == "[ \"~BeginVariableOutput~\"\t]\n" or iline == "[ \"~BeginProfilingOutput~\"\t]\n": - ig = 1 + ig = True n = 0 if ig and ( len(iline) == 0 or iline[0] != "!" or iline[:9] != "ERROR = !" ): # ignore differences in "VariableOutput" or "ProfilingOutput" @@ -226,10 +227,10 @@ def mFilter (FILE, IGNORE) : else: oline = iline if iline == "#~EndVariableOutput~#\n" or iline == "[ \"~EndVariableOutput~\"\t]\n": - ig = 0 + ig = False xline = "~ " + str(n) + " ~\n" if iline == "#~EndProfilingOutput~#\n" or iline == "[ \"~EndProfilingOutput~\"\t]\n": - ig = 0 + ig = False for ln in oline, xline: if len(ln): w = len(ln.split()) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list