MonetDB: default - Removed unused conditional execution interfaces.
Changeset: 98cb9fe6b870 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98cb9fe6b870 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out gdk/gdk_aggr.c gdk/gdk_calc.c gdk/gdk_calc.h gdk/gdk_calc_compare.h gdk/gdk_string.c monetdb5/modules/mal/batcalc.c sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/backends/monet5/sql_cast.c sql/backends/monet5/sql_cast.h sql/backends/monet5/sql_cast_impl_down_from_flt.h sql/backends/monet5/sql_cast_impl_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_round_impl.h sql/backends/monet5/sql_time.c Branch: default Log Message: Removed unused conditional execution interfaces. diffs (truncated from 12216 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -5991,7 +5991,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "bit_noerror", "pattern batcalc.bit_noerror(X_1:bat[:str], X_2:bat[:oid]):bat[:bit] ", "CMDconvert_bit;", "" ] [ "batcalc", "bit_noerror", "pattern batcalc.bit_noerror(X_1:bat[:str], X_2:bat[:oid], X_3:bat[:bit]):bat[:bit] ", "CMDconvert_bit;", "" ] [ "batcalc", "blob", "command batcalc.blob(X_1:bat[:str]):bat[:blob] ", "batstr_2_blob;", "" ] -[ "batcalc", "blob", "command batcalc.blob(X_1:bat[:str], X_2:bat[:bit]):bat[:blob] ", "batstr_ce_2_blob;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bit]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bit], X_2:bat[:bit]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bit], X_2:bat[:oid]):bat[:bte] ", "CMDconvertsignal_bte;","" ] @@ -6568,7 +6567,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "date", "command batcalc.date(X_1:bat[:str]):bat[:date] ", "MTIMEdate_fromstr_bulk;", "" ] [ "batcalc", "date", "command batcalc.date(X_1:bat[:timestamp]):bat[:date] ","MTIMEtimestamp_extract_date_bulk;","" ] [ "batcalc", "date", "command batcalc.date(X_1:bat[:str]):bat[:date] ", "batstr_2_date;", "" ] -[ "batcalc", "date", "command batcalc.date(X_1:bat[:str], X_2:bat[:bit]):bat[:date] ", "batstr_ce_2_date;","" ] [ "batcalc", "date", "pattern batcalc.date(X_1:bat[:oid]):bat[:date] ", "nil_2_date;", "" ] [ "batcalc", "date", "pattern batcalc.date(X_1:bat[:oid], X_2:bat[:bit]):bat[:date] ", "nil_2_date;", "" ] [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:daytime]):bat[:daytime] ", "MTIMEdaytime_daytime_bulk;", "" ] diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -4801,7 +4801,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "bit_noerror", "pattern batcalc.bit_noerror(X_1:bat[:str]):bat[:bit] ","CMDconvert_bit;", "" ] [ "batcalc", "bit_noerror", "pattern batcalc.bit_noerror(X_1:bat[:str], X_2:bat[:oid]):bat[:bit] ", "CMDconvert_bit;", "" ] [ "batcalc", "blob", "command batcalc.blob(X_1:bat[:str]):bat[:blob] ", "batstr_2_blob;", "" ] -[ "batcalc", "blob", "command batcalc.blob(X_1:bat[:str], X_2:bat[:bit]):bat[:blob] ", "batstr_ce_2_blob;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bit]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bit], X_2:bat[:oid]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:bte]):bat[:bte] ", "CMDconvertsignal_bte;","" ] @@ -4822,44 +4821,26 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:sht], X_2:bat[:oid]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:str]):bat[:bte] ", "CMDconvertsignal_bte;","" ] [ "batcalc", "bte", "pattern batcalc.bte(X_1:bat[:str], X_2:bat[:oid]):bat[:bte] ", "CMDconvertsignal_bte;","" ] -[ "batcalc", "bte", "command batcalc.bte(X_1:int, X_2:bat[:bte], X_3:bat[:bit]):bat[:bte] ","batbte_ce_dec2_bte;", "" ] -[ "batcalc", "bte", "command batcalc.bte(X_1:int, X_2:bat[:bte], X_3:int, X_4:int, X_5:bat[:bit]):bat[:bte] ", "batbte_ce_dec2dec_bte;", "" ] -[
MonetDB: default - Approved output
Changeset: 1d68d6e8052a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d68d6e8052a Modified Files: sql/test/SQLancer/Tests/sqlancer03.stable.out sql/test/SQLancer/Tests/sqlancer04.stable.err sql/test/SQLancer/Tests/sqlancer04.stable.out Branch: default Log Message: Approved output diffs (66 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer03.stable.out b/sql/test/SQLancer/Tests/sqlancer03.stable.out --- a/sql/test/SQLancer/Tests/sqlancer03.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer03.stable.out @@ -637,7 +637,7 @@ stdout of test 'sqlancer03` in directory #0.369 [ 8] #SELECT ALL CASE t0.c0 WHEN VAR_POP(ALL t0.c0) THEN (t0.c0) BETWEEN SYMMETRIC (t0.c0) AND (t0.c0) END FROM t0 GROUP BY t0.c0; -% sys.%2 # table_name +% .%2 # table_name % %2 # name % boolean # type % 5 # length diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.err b/sql/test/SQLancer/Tests/sqlancer04.stable.err --- a/sql/test/SQLancer/Tests/sqlancer04.stable.err +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.err @@ -5,14 +5,22 @@ stderr of test 'sqlancer04` in directory # 09:44:50 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-36890" "--port=30177" # 09:44:50 > -MAPI = (monetdb) /var/tmp/mtest-297969/.s.monetdb.30789 +MAPI = (monetdb) /var/tmp/mtest-394778/.s.monetdb.37947 +QUERY = SELECT covar_samp(1, - (COALESCE(1, 2)||5)); --error on default, covar_samp between integer and string not possible +ERROR = !types sec_interval(0,0) and tinyint(8,0) are not equal +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-394778/.s.monetdb.37947 QUERY = select case covar_samp(all - (coalesce (cast(-5 as int), coalesce (((cast(0.4 as int))-(coalesce (5, 5))), + (case -3 when 0.5 then 5 else 3 end, - (- (((coalesce (cast(0.2 as int), coalesce (5, 3, -747176383), ((6)%(3)), ((-2)<<(3||(-5) when case t0.c0 when case coalesce (coalesce (0.2, 0.3, 0.7), 0.5, cast(t0.c2 as decimal)) when cast(interval '-4' month as interval second) then cast(case 0.3 when t0.c1 then 0.6 when interval '-3' month then 0.3 end as interval second) end then coalesce (abs(0.6), -ERROR = !SELECT: cannot use non GROUP BY column 't0.c0' in query results without an aggregate function +ERROR = !types sec_interval(0,0) and tinyint(8,0) are not equal +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-394778/.s.monetdb.37947 +QUERY = SELECT CASE '5'^3 WHEN COUNT(TRUE) THEN 1 END FROM t0 GROUP BY 2 IN ((CAST(INTERVAL '-2' SECOND AS INT))%2); --error on default: types sec_interval(13,0) and int(32,0) are not equal +ERROR = !types sec_interval(13,0) and int(32,0) are not equal CODE = 42000 # 09:44:50 > diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.out b/sql/test/SQLancer/Tests/sqlancer04.stable.out --- a/sql/test/SQLancer/Tests/sqlancer04.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.out @@ -29,22 +29,11 @@ stdout of test 'sqlancer04` in directory % double # type % 24 # length #ROLLBACK; -#SELECT covar_samp(1, - (COALESCE(1, 2)||5)); --error on default, covar_samp between integer and string not possible -% .%1 # table_name -% %1 # name -% double # type -% 24 # length -[ NULL ] #START TRANSACTION; #CREATE TABLE "sys"."t0"("c0" DATE, "c1" DATE, "c2" INTERVAL SECOND NOT NULL,"c3" TIME NOT NULL); #ROLLBACK; #START TRANSACTION; #CREATE TABLE "sys"."t0" ("c0" INTERVAL SECOND NOT NULL); -#SELECT CASE '5'^3 WHEN COUNT(TRUE) THEN 1 END FROM t0 GROUP BY 2 IN ((CAST(INTERVAL '-2' SECOND AS INT))%2); -% .%7 # table_name -% %7 # name -% tinyint # type -% 1 # length #ROLLBACK; # 09:44:50 > ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - SQLancer algebra.projection undefined
Changeset: bcaf2710cfe0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bcaf2710cfe0 Modified Files: sql/test/SQLancer/Tests/sqlancer04.sql Branch: Jun2020 Log Message: SQLancer algebra.projection undefined diffs (31 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer04.sql b/sql/test/SQLancer/Tests/sqlancer04.sql --- a/sql/test/SQLancer/Tests/sqlancer04.sql +++ b/sql/test/SQLancer/Tests/sqlancer04.sql @@ -46,3 +46,27 @@ START TRANSACTION; CREATE TABLE "sys"."t0" ("c0" INTERVAL SECOND NOT NULL); SELECT CASE '5'^3 WHEN COUNT(TRUE) THEN 1 END FROM t0 GROUP BY 2 IN ((CAST(INTERVAL '-2' SECOND AS INT))%2); --error on default: types sec_interval(13,0) and int(32,0) are not equal ROLLBACK; + +START TRANSACTION; +CREATE TABLE "sys"."t0" ("c0" CHARACTER LARGE OBJECT NOT NULL,"c1" BIGINT NOT NULL,CONSTRAINT "t0_c1_pkey" PRIMARY KEY ("c1")); +CREATE TABLE "sys"."t1" ("c0" CHARACTER LARGE OBJECT,"c1" BIGINT); +COPY 3 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +"-216073164" NULL +"-2044926527" NULL +NULL 1 + +SELECT 1 FROM t1 LEFT OUTER JOIN t0 ON TRUE +LEFT OUTER JOIN (SELECT 1 FROM t0) AS sub0 ON TRUE +WHERE (TIME '00:25:07') IN (TIME '07:29:34', CASE 2 WHEN 2 THEN TIME '17:23:46' ELSE TIME '05:14:30' END); + -- empty + +SELECT 1 FROM t1 LEFT OUTER JOIN t0 ON TRUE +LEFT OUTER JOIN (SELECT 1 FROM t0) AS sub0 ON TRUE +WHERE t0.c0 <= t0.c0 AND (TIME '00:25:07') IN (TIME '07:29:34', CASE 2 WHEN 2 THEN TIME '17:23:46' ELSE TIME '05:14:30' END); + -- empty + +SELECT ALL COUNT(TIME '06:32:50') FROM t1 LEFT OUTER JOIN t0 ON TRUE +LEFT OUTER JOIN (SELECT t1.c1, t0.c1, 0.43 FROM t0, t1) AS sub0 ON TRUE +WHERE ((NOT ((TIME '00:25:07') IN (TIME '07:29:34', TIME '05:21:58', CASE 0.54 WHEN 0.65 THEN TIME '17:23:46' ELSE TIME '05:14:30' END +GROUP BY TIMESTAMP '1969-12-08 01:47:58'; +ROLLBACK; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: noce - Closing branch noce.
Changeset: 296ab4e52283 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=296ab4e52283 Branch: noce Log Message: Closing branch noce. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with noce branch.
Changeset: cf35a6c26c5e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cf35a6c26c5e Branch: default Log Message: Merge with noce branch. diffs (truncated from 15762 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -9364,221 +9364,113 @@ stdout of test 'MAL-signatures` in direc [ "batmal","multiplex","pattern batmal.multiplex(X_1:str, X_2:str, X_3:any...):any... ", "MANIFOLDremapMultiplex;", "" ] [ "batmkey", "hash", "command batmkey.hash(X_1:bat[:any_1]):bat[:lng] ", "MKEYbathash;", "" ] [ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:dbl]):bat[:dbl] ", "CMDscience_bat_acos;", "" ] -[ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:dbl], X_2:bat[:bit]):bat[:dbl] ", "CMDscience_bat_acos;", "" ] [ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:dbl], X_2:bat[:oid]):bat[:dbl] ", "CMDscience_bat_acos;", "" ] -[ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:dbl], X_2:bat[:oid], X_3:bat[:bit]):bat[:dbl] ","CMDscience_bat_acos;", "" ] [ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:flt]):bat[:flt] ", "CMDscience_bat_acos;", "" ] -[ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:flt], X_2:bat[:bit]):bat[:flt] ", "CMDscience_bat_acos;", "" ] [ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:flt], X_2:bat[:oid]):bat[:flt] ", "CMDscience_bat_acos;", "" ] -[ "batmmath", "acos", "pattern batmmath.acos(X_1:bat[:flt], X_2:bat[:oid], X_3:bat[:bit]):bat[:flt] ","CMDscience_bat_acos;", "" ] [ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:dbl]):bat[:dbl] ", "CMDscience_bat_asin;", "" ] -[ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:dbl], X_2:bat[:bit]):bat[:dbl] ", "CMDscience_bat_asin;", "" ] [ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:dbl], X_2:bat[:oid]):bat[:dbl] ", "CMDscience_bat_asin;", "" ] -[ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:dbl], X_2:bat[:oid], X_3:bat[:bit]):bat[:dbl] ","CMDscience_bat_asin;", "" ] [ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:flt]):bat[:flt] ", "CMDscience_bat_asin;", "" ] -[ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:flt], X_2:bat[:bit]):bat[:flt] ", "CMDscience_bat_asin;", "" ] [ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:flt], X_2:bat[:oid]):bat[:flt] ", "CMDscience_bat_asin;", "" ] -[ "batmmath", "asin", "pattern batmmath.asin(X_1:bat[:flt], X_2:bat[:oid], X_3:bat[:bit]):bat[:flt] ","CMDscience_bat_asin;", "" ] [ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:dbl]):bat[:dbl] ", "CMDscience_bat_atan;", "" ] -[ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:dbl], X_2:bat[:bit]):bat[:dbl] ", "CMDscience_bat_atan;", "" ] [ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:dbl], X_2:bat[:oid]):bat[:dbl] ", "CMDscience_bat_atan;", "" ] -[ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:dbl], X_2:bat[:oid], X_3:bat[:bit]):bat[:dbl] ","CMDscience_bat_atan;", "" ] [ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:flt]):bat[:flt] ", "CMDscience_bat_atan;", "" ] -[ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:flt], X_2:bat[:bit]):bat[:flt] ", "CMDscience_bat_atan;", "" ] [ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:flt], X_2:bat[:oid]):bat[:flt] ", "CMDscience_bat_atan;", "" ] -[ "batmmath", "atan", "pattern batmmath.atan(X_1:bat[:flt], X_2:bat[:oid], X_3:bat[:bit]):bat[:flt] ","CMDscience_bat_atan;", "" ] [ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:dbl], X_2:dbl):bat[:dbl] ","CMDscience_bat_atan2;","" ] -[ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:dbl], X_2:dbl, X_3:bat[:bit]):bat[:dbl] ", "CMDscience_bat_atan2;","" ] [ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:dbl], X_2:dbl, X_3:bat[:oid]):bat[:dbl] ", "CMDscience_bat_atan2;","" ] -[ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:dbl], X_2:dbl, X_3:bat[:oid], X_4:bat[:bit]):bat[:dbl] ", "CMDscience_bat_atan2;", "" ] [ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:flt], X_2:flt):bat[:flt] ","CMDscience_bat_atan2;","" ] -[ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:flt], X_2:flt, X_3:bat[:bit]):bat[:flt] ", "CMDscience_bat_atan2;","" ] [ "batmmath", "atan2","pattern batmmath.atan2(X_1:bat[:flt], X_2:flt, X_3:bat[:oid]):bat[:flt] ", "CMDscience_bat_atan2;","" ] -[ "batmmath", "atan2","pattern
MonetDB: noce - Merge with default branch.
Changeset: f10cf4b23480 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f10cf4b23480 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/server/rel_select.c Branch: noce Log Message: Merge with default branch. diffs (truncated from 2028 to 300 lines): diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -319,11 +319,6 @@ BATcalcnot(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -449,11 +444,6 @@ BATcalcnegate(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -589,11 +579,6 @@ BATcalcabsolute(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -728,11 +713,6 @@ BATcalciszero(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -871,11 +851,6 @@ BATcalcsign(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -3809,15 +3784,6 @@ BATcalcincrdecr(BAT *b, BAT *s, BAT *r, bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - if (nils == 0 && !b->tnonil) { - b->tnonil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "%s: b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", func, ALGOBATPAR(b), ALGOOPTBATPAR(s), diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c --- a/monetdb5/modules/mal/sysmon.c +++ b/monetdb5/modules/mal/sysmon.c @@ -31,13 +31,14 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, bat *w = getArgReference_bat(stk,pci,7); bat *m = getArgReference_bat(stk,pci,8); lng qtag; - int wrk, mem, sz; + int wrk, mem; + BUN sz; timestamp tsn; str msg = MAL_SUCCEED; (void) cntxt; (void) mb; - sz = qsize; // reserve space for all tuples in QRYqueue + sz = (BUN) qsize; // reserve space for all tuples in QRYqueue tag = COLnew(0, TYPE_lng, sz, TRANSIENT); sessionid = COLnew(0, TYPE_int, sz, TRANSIENT); user = COLnew(0, TYPE_str, sz, TRANSIENT); diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -779,7 +779,8 @@ exp_bin(backend *be, sql_exp *e, stmt *l } assert(!e->r); if (exps) { - int nrcols = 0, single_value = (fe->card <= CARD_ATOM); + unsigned nrcols = 0; + int single_value = (fe->card <= CARD_ATOM); int push_cond_exec = 0, coalesce = 0; stmt *ncond = NULL; diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -2625,7 +2625,7 @@ stmt_catalog(backend *be, int type, stmt void stmt_set_nrcols(stmt *s) { - int nrcols = 0; + unsigned nrcols = 0; int key = 1; node *n; list *l = s->op4.lval; diff --git a/sql/common/sql_types.c
MonetDB: default - Merge with oscar branch.
Changeset: 2be78b2193b5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2be78b2193b5 Modified Files: sql/server/rel_dump.c sql/server/rel_select.c Branch: default Log Message: Merge with oscar branch. diffs (212 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1054,9 +1054,11 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (zero_if_empty) set_zero_if_empty(exp); } else { + int nops = list_length(exps); list *ops = sa_list(sql->sa); for( n = exps->h; n; n = n->next) append(ops, exp_subtype(n->data)); + f = sql_bind_func_(sql->sa, s, cname, ops, F_FUNC); if (!f) f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); @@ -1095,7 +1097,7 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (f) exp = exp_op( sql->sa, exps, f); else - return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, list_length(ops)); + return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, nops); } } diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -3635,6 +3635,7 @@ static sql_exp * sql_exp *r = exps->h->next->data, *or = r; sql_subtype *t2 = exp_subtype(r); + a = NULL; /* reset a */ if (rel_convert_types(sql, *rel, *rel, , , 1/*fix scale*/, type_equal) >= 0){ list *tps = sa_list(sql->sa); @@ -4037,15 +4038,18 @@ rel_group_column(sql_query *query, sql_r if (!e) { char buf[ERRSIZE]; + int status = sql->session->status; + strcpy(buf, sql->errstr); /* reset error */ sql->session->status = 0; - strcpy(buf, sql->errstr); sql->errstr[0] = '\0'; e = rel_selection_ref(query, rel, grp, selection); if (!e) { - if (sql->errstr[0] == 0) + if (sql->errstr[0] == 0) { + sql->session->status = status; strcpy(sql->errstr, buf); + } return NULL; } } diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -15,4 +15,4 @@ select-and.Bug-6878 copy-decimal-with-space.Bug-6917 isauuid.Bug-6934 tpch-cube.Bug-6938 -HAVE_PYMONETDB?remote-table-like.Bug-6641 +HAVE_PYMONETDB?remote-table-like.Bug-6841 diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err @@ -1,4 +1,4 @@ -stderr of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stderr of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out @@ -1,4 +1,4 @@ -stdout of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stdout of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > diff --git a/sql/test/SQLancer/Tests/sqlancer04.sql b/sql/test/SQLancer/Tests/sqlancer04.sql ---
MonetDB: oscar - Merge with Jun2020 branch.
Changeset: d99ad520c8de for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d99ad520c8de Modified Files: sql/server/rel_dump.c sql/server/rel_select.c sql/test/BugTracker-2020/Tests/All Branch: oscar Log Message: Merge with Jun2020 branch. diffs (212 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1059,9 +1059,11 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (zero_if_empty) set_zero_if_empty(exp); } else { + int nops = list_length(exps); list *ops = sa_list(sql->sa); for( n = exps->h; n; n = n->next) append(ops, exp_subtype(n->data)); + f = sql_bind_func_(sql->sa, s, cname, ops, F_FUNC); if (!f) f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); @@ -1100,7 +1102,7 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (f) exp = exp_op( sql->sa, exps, f); else - return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, list_length(ops)); + return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, nops); } } diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -3617,6 +3617,7 @@ static sql_exp * sql_exp *r = exps->h->next->data, *or = r; sql_subtype *t2 = exp_subtype(r); + a = NULL; /* reset a */ if (rel_convert_types(sql, *rel, *rel, , , 1/*fix scale*/, type_equal) >= 0){ list *tps = sa_list(sql->sa); @@ -4019,15 +4020,18 @@ rel_group_column(sql_query *query, sql_r if (!e) { char buf[ERRSIZE]; + int status = sql->session->status; + strcpy(buf, sql->errstr); /* reset error */ sql->session->status = 0; - strcpy(buf, sql->errstr); sql->errstr[0] = '\0'; e = rel_selection_ref(query, rel, grp, selection); if (!e) { - if (sql->errstr[0] == 0) + if (sql->errstr[0] == 0) { + sql->session->status = status; strcpy(sql->errstr, buf); + } return NULL; } } diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -15,4 +15,4 @@ select-and.Bug-6878 copy-decimal-with-space.Bug-6917 isauuid.Bug-6934 tpch-cube.Bug-6938 -HAVE_PYMONETDB?remote-table-like.Bug-6641 +HAVE_PYMONETDB?remote-table-like.Bug-6841 diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err @@ -1,4 +1,4 @@ -stderr of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stderr of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out @@ -1,4 +1,4 @@ -stdout of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stdout of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > diff --git a/sql/test/SQLancer/Tests/sqlancer04.sql b/sql/test/SQLancer/Tests/sqlancer04.sql
MonetDB: Jun2020 - Making SQLancer happy. Save session status be...
Changeset: c0d9d579e3d8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0d9d579e3d8 Modified Files: sql/server/rel_select.c sql/test/SQLancer/Tests/sqlancer04.sql sql/test/SQLancer/Tests/sqlancer04.stable.out Branch: Jun2020 Log Message: Making SQLancer happy. Save session status before computing a grouping column diffs (54 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -4048,15 +4048,18 @@ rel_group_column(sql_query *query, sql_r if (!e) { char buf[ERRSIZE]; + int status = sql->session->status; + strcpy(buf, sql->errstr); /* reset error */ sql->session->status = 0; - strcpy(buf, sql->errstr); sql->errstr[0] = '\0'; e = rel_selection_ref(query, rel, grp, selection); if (!e) { - if (sql->errstr[0] == 0) + if (sql->errstr[0] == 0) { + sql->session->status = status; strcpy(sql->errstr, buf); + } return NULL; } } diff --git a/sql/test/SQLancer/Tests/sqlancer04.sql b/sql/test/SQLancer/Tests/sqlancer04.sql --- a/sql/test/SQLancer/Tests/sqlancer04.sql +++ b/sql/test/SQLancer/Tests/sqlancer04.sql @@ -41,3 +41,8 @@ else r'*' end then 0.8 end when sql_min( 0.9) when coalesce (cast(t0.c1 as double), 0.2) then 0.0 else 0.0 end, 0.2) end from t0 where (interval '6' month) is not null group by cast(dayofmonth(t0.c0) as string(679)), 0.2; --error, on Jun2020 t0.c0 is not aggregated, on default ROLLBACK; + +START TRANSACTION; +CREATE TABLE "sys"."t0" ("c0" INTERVAL SECOND NOT NULL); +SELECT CASE '5'^3 WHEN COUNT(TRUE) THEN 1 END FROM t0 GROUP BY 2 IN ((CAST(INTERVAL '-2' SECOND AS INT))%2); --error on default: types sec_interval(13,0) and int(32,0) are not equal +ROLLBACK; diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.out b/sql/test/SQLancer/Tests/sqlancer04.stable.out --- a/sql/test/SQLancer/Tests/sqlancer04.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.out @@ -38,6 +38,14 @@ stdout of test 'sqlancer04` in directory #START TRANSACTION; #CREATE TABLE "sys"."t0"("c0" DATE, "c1" DATE, "c2" INTERVAL SECOND NOT NULL,"c3" TIME NOT NULL); #ROLLBACK; +#START TRANSACTION; +#CREATE TABLE "sys"."t0" ("c0" INTERVAL SECOND NOT NULL); +#SELECT CASE '5'^3 WHEN COUNT(TRUE) THEN 1 END FROM t0 GROUP BY 2 IN ((CAST(INTERVAL '-2' SECOND AS INT))%2); +% .%7 # table_name +% %7 # name +% tinyint # type +% 1 # length +#ROLLBACK; # 09:44:50 > # 09:44:50 > "Done." ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - Calculate reduces free size for msk bats.
Changeset: 79ac406ced98 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=79ac406ced98 Modified Files: gdk/gdk_bbp.c Branch: unlock Log Message: Calculate reduces free size for msk bats. diffs (20 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1471,8 +1471,14 @@ static inline int heap_entry(FILE *fp, BAT *b, BUN size) { size_t free = b->theap->free; - if (b->twidth > 0 && free / b->twidth > size) - free = size * b->twidth; + if (size < BUN_NONE) { + if (ATOMstorage(b->ttype) == TYPE_msk) { + BUN bytes = ((size + 31) / 32) * 4; + if (free > bytes) + free = bytes; + } else if (b->twidth > 0 && free / b->twidth > size) + free = size * b->twidth; + } return fprintf(fp, " %s %d %d %d " BUNFMT " " BUNFMT " " BUNFMT " " BUNFMT " " OIDFMT " %zu %zu %d", b->ttype >= 0 ? BATatoms[b->ttype].name : ATOMunknown_name(b->ttype), ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Making SQLancer happy, reset found aggregate,...
Changeset: 1ad0de6d8738 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1ad0de6d8738 Modified Files: sql/server/rel_select.c sql/test/SQLancer/Tests/sqlancer04.sql sql/test/SQLancer/Tests/sqlancer04.stable.err sql/test/SQLancer/Tests/sqlancer04.stable.out Branch: Jun2020 Log Message: Making SQLancer happy, reset found aggregate, before testing equality of types, so in case of failure the aggregate has to be found again diffs (77 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -3645,6 +3645,7 @@ static sql_exp * sql_exp *r = exps->h->next->data, *or = r; sql_subtype *t2 = exp_subtype(r); + a = NULL; /* reset a */ if (rel_convert_types(sql, *rel, *rel, , , 1/*fix scale*/, type_equal) >= 0){ list *tps = sa_list(sql->sa); diff --git a/sql/test/SQLancer/Tests/sqlancer04.sql b/sql/test/SQLancer/Tests/sqlancer04.sql --- a/sql/test/SQLancer/Tests/sqlancer04.sql +++ b/sql/test/SQLancer/Tests/sqlancer04.sql @@ -20,3 +20,24 @@ HAVING NOT (MIN(ALL ((r'946496923')LIKE( UNION ALL SELECT ALL SUM(ALL 0.12830007105673624234754015560611151158) FROM t0 WHERE ((sql_min(t0.c0, t0.c0))<>(COALESCE (t0.c0, sql_min(abs(t0.c0), nullif(t0.c0, t0.c0) GROUP BY 0.1 HAVING (MIN(ALL ((r'946496923')LIKE(CAST(nullif(0.5, 0.03) AS STRING(538)) IS NULL; ROLLBACK; + +SELECT covar_samp(1, - (COALESCE(1, 2)||5)); --error on default, covar_samp between integer and string not possible + +START TRANSACTION; +CREATE TABLE "sys"."t0"("c0" DATE, "c1" DATE, "c2" INTERVAL SECOND NOT NULL,"c3" TIME NOT NULL); + +select case covar_samp(all - (coalesce (cast(-5 as int), coalesce (((cast(0.4 as int))-(coalesce (5, 5))), + +(case -3 when 0.5 then 5 else 3 end, - (- (((coalesce (cast(0.2 as int), +coalesce (5, 3, -747176383), ((6)%(3)), ((-2)<<(3||(-5) when case t0.c0 when +case coalesce (coalesce (0.2, 0.3, 0.7), 0.5, +cast(t0.c2 as decimal)) when cast(interval '-4' month as interval second) then cast(case 0.3 when t0.c1 then 0.6 +when interval '-3' month then 0.3 end as interval second) end then coalesce (abs(0.6), +cast(lower(r'') as decimal), 0.4) end then abs(0.5) when abs(-1.4) +then coalesce (sql_min(case t0.c0 when t0.c1 then 0.5 else 0.4 end, +case 0.5 when t0.c2 then 0.6 when 0.5 then 0.2 else 0.7 end), abs(coalesce (0.3, 0.5, 0.3))) +else coalesce (case coalesce (dayofmonth(timestamp '1970-01-15 10:08:18'), coalesce (-5, 3, 5)) when coalesce (cast(timestamp '1970-01-18 00:15:34' as double), +cast(t0.c3 as double)) then case least(t0.c1, t0.c1) when case t0.c2 when interval '5' month then r'*pf6/+}öq壚,j2\302\205K]sNKk,_%Tu' when 1016331084 then r'0.4' +else r'*' end then 0.8 end when sql_min(t0.c3, t0.c3) then coalesce (cast(t0.c2 as decimal), "second"(t0.c3), cast(t0.c2 as decimal), +0.9) when coalesce (cast(t0.c1 as double), 0.2) then 0.0 else 0.0 end, 0.2) end from t0 where (interval '6' month) +is not null group by cast(dayofmonth(t0.c0) as string(679)), 0.2; --error, on Jun2020 t0.c0 is not aggregated, on default +ROLLBACK; diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.err b/sql/test/SQLancer/Tests/sqlancer04.stable.err --- a/sql/test/SQLancer/Tests/sqlancer04.stable.err +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.err @@ -5,6 +5,15 @@ stderr of test 'sqlancer04` in directory # 09:44:50 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-36890" "--port=30177" # 09:44:50 > +MAPI = (monetdb) /var/tmp/mtest-297969/.s.monetdb.30789 +QUERY = select case covar_samp(all - (coalesce (cast(-5 as int), coalesce (((cast(0.4 as int))-(coalesce (5, 5))), + +(case -3 when 0.5 then 5 else 3 end, - (- (((coalesce (cast(0.2 as int), +coalesce (5, 3, -747176383), ((6)%(3)), ((-2)<<(3||(-5) when case t0.c0 when +case coalesce (coalesce (0.2, 0.3, 0.7), 0.5, +cast(t0.c2 as decimal)) when cast(interval '-4' month as interval second) then cast(case 0.3 when t0.c1 then 0.6 +when interval '-3' month then 0.3 end as interval second) end then coalesce (abs(0.6), +ERROR = !SELECT: cannot use non GROUP BY column 't0.c0' in query results without an aggregate function +CODE = 42000 # 09:44:50 > # 09:44:50 > "Done." diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.out b/sql/test/SQLancer/Tests/sqlancer04.stable.out --- a/sql/test/SQLancer/Tests/sqlancer04.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.out @@ -29,6 +29,15 @@ stdout of test 'sqlancer04` in directory % double # type % 24 # length #ROLLBACK; +#SELECT covar_samp(1, - (COALESCE(1, 2)||5)); --error on default, covar_samp between integer and string not possible +% .%1 # table_name +% %1 # name +% double # type +% 24 # length +[ NULL ] +#START
MonetDB: unlock - Set bat capacity correctly for msk bats.
Changeset: 538443a75e82 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=538443a75e82 Modified Files: gdk/gdk_storage.c Branch: unlock Log Message: Set bat capacity correctly for msk bats. diffs (18 lines): diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c --- a/gdk/gdk_storage.c +++ b/gdk/gdk_storage.c @@ -839,8 +839,12 @@ BATload_intern(bat bid, bool lock) assert(0); return NULL; } - assert(b->theap->size >> b->tshift <= BUN_MAX); - b->batCapacity = (BUN) (b->theap->size >> b->tshift); + if (ATOMstorage(b->ttype) == TYPE_msk) { + b->batCapacity = (BUN) (b->theap->size * 8); + } else { + assert(b->theap->size >> b->tshift <= BUN_MAX); + b->batCapacity = (BUN) (b->theap->size >> b->tshift); + } } else { b->theap->base = NULL; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: trails - Minor code cleaning
Changeset: 95f3bc06fce3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=95f3bc06fce3 Modified Files: sql/backends/monet5/sql_basket.c Branch: trails Log Message: Minor code cleaning diffs (68 lines): diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c --- a/sql/backends/monet5/sql_basket.c +++ b/sql/backends/monet5/sql_basket.c @@ -54,7 +54,8 @@ BSKTlocate(str sch, str tbl) } // Find an empty slot in the basket catalog -static int BSKTnewEntry(void) +static int +BSKTnewEntry(void) { int i = bsktTop; BasketRec *bnew; @@ -90,8 +91,7 @@ BSKTclean(int idx) { int i; if( idx && baskets[idx].table){ - if(baskets[idx].error) - GDKfree(baskets[idx].error); + GDKfree(baskets[idx].error); baskets[idx].table = NULL; baskets[idx].error = NULL; baskets[idx].window = 0; @@ -120,7 +120,6 @@ BSKTregisterInternal(Client cntxt, MalBl BAT *b; node *o; str msg = getSQLContext(cntxt, mb, , NULL); - timestamp tseen; if ( msg != MAL_SUCCEED) return msg; @@ -131,7 +130,6 @@ BSKTregisterInternal(Client cntxt, MalBl return MAL_SUCCEED; } - tseen = timestamp_current(); if ((msg = checkSQLContext(cntxt)) != MAL_SUCCEED) return msg; @@ -152,7 +150,7 @@ BSKTregisterInternal(Client cntxt, MalBl baskets[idx].window = t->stream->window; baskets[idx].stride = t->stream->stride; baskets[idx].error = MAL_SUCCEED; - baskets[idx].seen = tseen; + baskets[idx].seen = timestamp_current(); // Check the column types first for (o = t->columns.set->h; o ; o = o->next){ @@ -217,9 +215,6 @@ BSKTwindow(Client cntxt, MalBlkPtr mb, M (void) cntxt; (void) mb; - msg= BSKTregisterInternal(cntxt, mb, sch, tbl, ); - if( msg != MAL_SUCCEED) - return msg; if( window < 0) throw(MAL,"basket.window",SQLSTATE(42000) "negative window not allowed\n"); if( pci->argc == 5) { @@ -229,6 +224,9 @@ BSKTwindow(Client cntxt, MalBlkPtr mb, M if( window < stride) throw(MAL,"basket.window",SQLSTATE(42000) "the window size must not be smaller than the stride size\n"); } + msg= BSKTregisterInternal(cntxt, mb, sch, tbl, ); + if( msg != MAL_SUCCEED) + return msg; baskets[idx].window = window; if( pci->argc == 5) { baskets[idx].stride = stride; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - small fixes for msk type
Changeset: 045b3102bfe4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=045b3102bfe4 Modified Files: gdk/gdk_bat.c gdk/gdk_logger.c Branch: unlock Log Message: small fixes for msk type diffs (32 lines): diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -1489,7 +1489,7 @@ BUNinplace(BAT *b, BUN p, const void *t, BATkey(b, false); } else if (!b->tkey && (b->tnokey[0] == p || b->tnokey[1] == p)) b->tnokey[0] = b->tnokey[1] = 0; - if (b->tnonil) + if (b->tnonil && ATOMstorage(b->ttype) != TYPE_msk) b->tnonil = t && ATOMcmp(b->ttype, t, ATOMnilptr(b->ttype)) != 0; b->theap->dirty = true; if (b->tvheap) diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -519,13 +519,15 @@ la_bat_updates(logger *lg, logaction *la BUN cnt = BATcount(b); if (!lg->flushing) { + int is_msk = (b->ttype == TYPE_msk); /* handle offset 0 ie clear */ if (/* DISABLES CODE */ (0) && la->offset == 0 && cnt) BATclear(b, true); /* handle offset */ if (cnt <= (BUN)la->offset) { + msk t = 1; if (cnt < (BUN)la->offset) { /* insert nils */ - const void *tv = ATOMnilptr(b->ttype); + const void *tv = (is_msk)?:ATOMnilptr(b->ttype); lng i, d = la->offset - BATcount(b); for(i=0;ihttps://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - small steps towards using msk for deleted rows
Changeset: 6b5dde41eb6b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b5dde41eb6b Modified Files: sql/backends/monet5/sql.c sql/storage/bat/bat_storage.c sql/storage/bat/bat_table.c Branch: unlock Log Message: small steps towards using msk for deleted rows diffs (158 lines): diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c --- a/sql/backends/monet5/sql.c +++ b/sql/backends/monet5/sql.c @@ -2244,9 +2244,8 @@ SQLtid(Client cntxt, MalBlkPtr mb, MalSt BBPunfix(uv->batCacheid); d = nd; } - bit *deleted = (bit*)Tloc(d, 0); for(BUN p = sb; p < sb+nr; p++) { - if (deleted[p]) { + if (mskGetVal(d,p)) { oid id = p; if (BUNappend(del_ids, , false) != GDK_SUCCEED) { BBPreclaim(del_ids); diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c --- a/sql/storage/bat/bat_storage.c +++ b/sql/storage/bat/bat_storage.c @@ -174,32 +174,33 @@ count_deletes(storage *d) { /* needs to be optimized */ BAT *b = temp_descriptor(d->cs.bid); - bit t = TRUE; - BAT *s = BATselect(b, NULL, , NULL, true, false, false); - size_t cnt = 0; - - bat_destroy(b); - if (d->cs.ucnt) { - BAT *ui, *uv, *cminu; + lng cnt = 0; - if (cs_real_update_bats(>cs, , ) == LOG_ERR) + if (d->cs.ucnt) { + if (BATsum(, TYPE_lng, b, NULL, true, false, false) != GDK_SUCCEED) { + bat_destroy(b); return 0; - cminu = BATdiff(s, ui, NULL, NULL, false, false, BUN_NONE); - BBPunfix(s->batCacheid); - BBPunfix(ui->batCacheid); - if (!cminu) { - BBPunfix(uv->batCacheid); + } + } else { + BAT *ui, *uv, *c; + + if (cs_real_update_bats(>cs, , ) == LOG_ERR) { + bat_destroy(b); return 0; } - cnt = BATcount(cminu); - BBPunfix(cminu->batCacheid); - s = BATselect(uv, NULL, , NULL, true, false, false); + c = COLcopy(b, b->ttype, true, TRANSIENT); + bat_destroy(b); + if (BATreplace(c, ui, uv, true) != GDK_SUCCEED) { + BBPunfix(c->batCacheid); + return 0; + } + BBPunfix(ui->batCacheid); BBPunfix(uv->batCacheid); - if (!s) + if (BATsum(, TYPE_lng, c, NULL, true, false, false) != GDK_SUCCEED) { + BBPunfix(c->batCacheid); return 0; + } } - cnt += BATcount(s); - bat_destroy(s); return cnt; } @@ -329,7 +330,7 @@ bind_del(sql_trans *tr, sql_table *t, in t->base.rtime = t->s->base.rtime = tr->stime; storage *s = t->data; if (access == RD_UPD_ID || access == RD_UPD_VAL) { - return cs_bind_ubat( >cs, access, TYPE_bit); + return cs_bind_ubat( >cs, access, TYPE_msk); } else { return cs_bind_bat( >cs, access, s->end); } @@ -740,7 +741,7 @@ dup_dbat(storage *obat, storage *bat, in MT_lock_unset(_lock); assert(bat->end <= bat->segs->end); } - return dup_cs(>cs, >cs, TYPE_bit, is_new, temp); + return dup_cs(>cs, >cs, TYPE_msk, is_new, temp); } static int @@ -808,8 +809,8 @@ static int delta_delete_bat( storage *bat, BAT *i, int is_new) { /* update ids */ - bit T = TRUE; - BAT *t = BATconstant(i->hseqbase, TYPE_bit, , BATcount(i), TRANSIENT); + msk T = TRUE; + BAT *t = BATconstant(i->hseqbase, TYPE_msk, , BATcount(i), TRANSIENT); int ok = LOG_OK; if (t) { @@ -823,7 +824,7 @@ static int delta_delete_val( storage *bat, oid rid, int is_new) { /* update pos */ - bit T = TRUE; + msk T = TRUE; return cs_update_val(>cs, rid, , is_new); } @@ -973,7 +974,7 @@ claim_tab(sql_trans *tr, sql_table *t, s assert(isNew(t) || isTempTable(t) || s->cs.cleared || BATcount(b) == slot); - bit deleted = FALSE; + msk deleted = FALSE; lng i; /* general case, write deleted in the central bat (ie others don't see these values) and @@ -1291,7 +1292,7 @@ log_create_idx(sql_trans *tr, sql_idx *n static int load_storage(storage *bat, sqlid id) { - int ok = load_cs(>cs, TYPE_bit, id); + int ok = load_cs(>cs, TYPE_msk, id); if (ok == LOG_OK) { bat->segs = new_segments(BATcount(quick_descriptor(bat->cs.bid))); @@ -1325,7 +1326,7 @@ create_del(sql_trans *tr, sql_table *t)
MonetDB: trails - BBPunfix more bat descriptors by error
Changeset: 6a099cab0aba for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a099cab0aba Modified Files: sql/backends/monet5/sql_basket.c Branch: trails Log Message: BBPunfix more bat descriptors by error diffs (47 lines): diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c --- a/sql/backends/monet5/sql_basket.c +++ b/sql/backends/monet5/sql_basket.c @@ -580,19 +580,28 @@ BSKTappend(Client cntxt, MalBlkPtr mb, M value = *(ptr*) value; bskt = BSKTlocate(sname,tname); - if( bskt == 0) + if( bskt == 0) { + if (binsert) + BBPunfix(((BAT *) binsert)->batCacheid); throw(SQL, "basket.append",SQLSTATE(HY005) "Cannot access basket descriptor %s.%s\n",sname,tname); + } bn = BSKTbindColumn(sname,tname,cname); if( bn){ if (binsert){ - if( BATappend(bn, binsert, NULL, TRUE) != GDK_SUCCEED) + if( BATappend(bn, binsert, NULL, TRUE) != GDK_SUCCEED) { + BBPunfix(((BAT *) binsert)->batCacheid); throw(MAL,"basket.append",SQLSTATE(HY005) "insertion failed\n"); + } } else if( BUNappend(bn, value, TRUE) != GDK_SUCCEED) throw(MAL,"basket.append",SQLSTATE(HY005) "insertion failed\n"); BATsettrivprop(bn); - } else throw(SQL, "basket.append",SQLSTATE(3F000) "Cannot access target column %s.%s.%s\n",sname,tname,cname); + } else { + if (binsert) + BBPunfix(((BAT *) binsert)->batCacheid); + throw(SQL, "basket.append",SQLSTATE(3F000) "Cannot access target column %s.%s.%s\n",sname,tname,cname); + } if (binsert ) BBPunfix(((BAT *) binsert)->batCacheid); @@ -669,8 +678,10 @@ BSKTdelete(Client cntxt, MalBlkPtr mb, M throw(SQL, "basket.delete",SQLSTATE(3F000) "Cannot access source oid descriptor\n"); idx = BSKTlocate(sname,tname); - if( idx == 0) + if( idx == 0) { + BBPunfix(rid->batCacheid); throw(SQL, "basket.delete",SQLSTATE(3F000) "Cannot access basket descriptor %s.%s\n",sname,tname); + } for( i=0; i < baskets[idx].ncols; i++){ b = baskets[idx].bats[i]; if(b){ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: trails - Don't leak bat descriptors
Changeset: d2e0fab0d429 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2e0fab0d429 Modified Files: sql/backends/monet5/sql_basket.c Branch: trails Log Message: Don't leak bat descriptors diffs (32 lines): diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c --- a/sql/backends/monet5/sql_basket.c +++ b/sql/backends/monet5/sql_basket.c @@ -625,15 +625,25 @@ BSKTupdate(Client cntxt, MalBlkPtr mb, M } bskt = BSKTlocate(sname,tname); - if( bskt == 0) + if( bskt == 0) { + BBPunfix(rid->batCacheid); + BBPunfix(bval->batCacheid); throw(SQL, "basket.update",SQLSTATE(HY005) "Cannot access basket descriptor %s.%s\n",sname,tname); + } bn = BSKTbindColumn(sname,tname,cname); if( bn){ - if( BATreplace(bn, rid, bval, TRUE) != GDK_SUCCEED) + if( BATreplace(bn, rid, bval, TRUE) != GDK_SUCCEED) { + BBPunfix(rid->batCacheid); + BBPunfix(bval->batCacheid); throw(SQL, "basket.update",SQLSTATE(HY005) "Cannot access basket descriptor %s.%s\n",sname,tname); + } BATsettrivprop(bn); - } else throw(SQL, "basket.update",SQLSTATE(3F000) "Cannot access target column %s.%s.%s\n",sname,tname,cname); + } else { + BBPunfix(rid->batCacheid); + BBPunfix(bval->batCacheid); + throw(SQL, "basket.update",SQLSTATE(3F000) "Cannot access target column %s.%s.%s\n",sname,tname,cname); + } BBPunfix(rid->batCacheid); BBPunfix(bval->batCacheid); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Wrong test number and don't loose number of a...
Changeset: 32ee69396753 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32ee69396753 Added Files: sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out Removed Files: sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out Modified Files: sql/server/rel_dump.c sql/test/BugTracker-2020/Tests/All Branch: Jun2020 Log Message: Wrong test number and don't loose number of arguments count diffs (58 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1041,9 +1041,11 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (zero_if_empty) set_zero_if_empty(exp); } else { + int nops = list_length(exps); list *ops = sa_list(sql->sa); for( n = exps->h; n; n = n->next) append(ops, exp_subtype(n->data)); + f = sql_bind_func_(sql->sa, s, cname, ops, F_FUNC); if (!f) f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); @@ -1082,7 +1084,7 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (f) exp = exp_op( sql->sa, exps, f); else - return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, list_length(ops)); + return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, nops); } } diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -15,4 +15,4 @@ select-and.Bug-6878 copy-decimal-with-space.Bug-6917 isauuid.Bug-6934 tpch-cube.Bug-6938 -HAVE_PYMONETDB?remote-table-like.Bug-6641 +HAVE_PYMONETDB?remote-table-like.Bug-6841 diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.err @@ -1,4 +1,4 @@ -stderr of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stderr of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out rename from sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out rename to sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.stable.out @@ -1,4 +1,4 @@ -stdout of test 'remote-table-like.Bug-6641` in directory 'sql/test/BugTracker-2020` itself: +stdout of test 'remote-table-like.Bug-6841` in directory 'sql/test/BugTracker-2020` itself: # 10:29:34 > ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merged with oscar
Changeset: bd15c5848d40 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd15c5848d40 Modified Files: sql/server/rel_dump.c sql/server/rel_select.c sql/server/rel_unnest.c sql/test/subquery/Tests/subquery6.sql Branch: default Log Message: Merged with oscar diffs (truncated from 860 to 300 lines): diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -319,11 +319,6 @@ BATcalcnot(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -449,11 +444,6 @@ BATcalcnegate(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -589,11 +579,6 @@ BATcalcabsolute(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -728,11 +713,6 @@ BATcalciszero(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -871,11 +851,6 @@ BATcalcsign(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -3809,15 +3784,6 @@ BATcalcincrdecr(BAT *b, BAT *s, BAT *r, bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - if (nils == 0 && !b->tnonil) { - b->tnonil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "%s: b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", func, ALGOBATPAR(b), ALGOOPTBATPAR(s), diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -924,10 +924,22 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (!(rexps = read_exps(sql, lrel, rrel, pexps, r, pos, '(', 0))) return NULL; if (filter) { - sql_subfunc *func = sql_find_func(sql->sa, mvc_bind_schema(sql, "sys"), fname, 1+list_length(exps), F_FILT, NULL); - if (!func) + sql_subfunc *func = NULL; + list *tl = sa_list(sql->sa); + + for (node *n = lexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + for (node *n = rexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + + if (!(func = sql_bind_func_(sql->sa, mvc_bind_schema(sql, "sys"), fname, tl, F_FILT))) return sql_error(sql, -1, SQLSTATE(42000) "Filter: missing function '%s'\n", fname); - return exp_filter(sql->sa, lexps, rexps, func, anti); } return exp_or(sql->sa, lexps, rexps, anti); @@ -1028,12 +1040,16 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (tname && !s) return sql_error(sql, -1, SQLSTATE(42000) "Schema %s not found\n", tname);
MonetDB: oscar - Merged with Jun2020
Changeset: 8339385d201d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8339385d201d Modified Files: gdk/gdk_calc.c sql/server/rel_dump.c sql/server/rel_select.c sql/server/rel_unnest.c sql/test/BugTracker-2020/Tests/All sql/test/BugTracker-2020/Tests/tpch-cube.Bug-6938.stable.out sql/test/SQLancer/Tests/All Branch: oscar Log Message: Merged with Jun2020 diffs (truncated from 860 to 300 lines): diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -319,11 +319,6 @@ BATcalcnot(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -449,11 +444,6 @@ BATcalcnegate(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -589,11 +579,6 @@ BATcalcabsolute(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -728,11 +713,6 @@ BATcalciszero(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -871,11 +851,6 @@ BATcalcsign(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -3809,15 +3784,6 @@ BATcalcincrdecr(BAT *b, BAT *s, BAT *r, bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - if (nils == 0 && !b->tnonil) { - b->tnonil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "%s: b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", func, ALGOBATPAR(b), ALGOOPTBATPAR(s), diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -929,10 +929,22 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (!(rexps = read_exps(sql, lrel, rrel, pexps, r, pos, '(', 0))) return NULL; if (filter) { - sql_subfunc *func = sql_find_func(sql->sa, mvc_bind_schema(sql, "sys"), fname, 1+list_length(exps), F_FILT, NULL); - if (!func) + sql_subfunc *func = NULL; + list *tl = sa_list(sql->sa); + + for (node *n = lexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + for (node *n = rexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + + if (!(func = sql_bind_func_(sql->sa, mvc_bind_schema(sql, "sys"), fname, tl, F_FILT))) return sql_error(sql, -1, SQLSTATE(42000) "Filter: missing function '%s'\n", fname); - return exp_filter(sql->sa, lexps, rexps, func, anti); } return exp_or(sql->sa, lexps, rexps, anti); @@ -1033,12 +1045,16 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if
MonetDB: Jun2020 - Add option for printing extra information in ...
Changeset: 2df0d79b7268 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2df0d79b7268 Modified Files: testing/sqllogictest.py Branch: Jun2020 Log Message: Add option for printing extra information in error message. diffs (43 lines): diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py --- a/testing/sqllogictest.py +++ b/testing/sqllogictest.py @@ -29,12 +29,12 @@ class SQLLogicSyntaxError(Exception): pass class SQLLogic: -def __init__(self, database=None, out=sys.stdout): +def __init__(self, report=None, out=sys.stdout): self.dbh = None self.crs = None self.out = out self.res = None -self.dbs = database +self.rpt = report def connect(self, username='monetdb', password='monetdb', hostname='localhost', port=None, database='demo'): @@ -109,8 +109,8 @@ class SQLLogic: return ndata def query_error(self, query, message, exception=None): -if self.dbs is not None: -print('On database {}:'.format(self.dbs), file=self.out) +if self.rpt: +print(self.rpt, file=self.out) print(message, file=self.out) if exception: print(exception.rstrip('\n'), file=self.out) @@ -280,10 +280,12 @@ if __name__ == '__main__': parser.add_argument('--results', action='store', type=argparse.FileType('w'), help='file to store results of queries') +parser.add_argument('--report', action='store', default='', +help='information to add to any error messages') parser.add_argument('tests', nargs='*', help='tests to be run') opts = parser.parse_args() args = opts.tests -sql = SQLLogic(database=opts.database) +sql = SQLLogic(report=opts.report) sql.res = opts.results sql.connect(hostname=opts.host, port=opts.port, database=opts.database) for test in args: ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - Make sure there is space, and allocate the spa...
Changeset: 73bc677e69b4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=73bc677e69b4 Modified Files: gdk/gdk_batop.c Branch: unlock Log Message: Make sure there is space, and allocate the space in the theap. diffs (22 lines): diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -513,6 +513,10 @@ append_msk_bat(BAT *b, BAT *n, struct ca if (ci->ncand == 0) return GDK_SUCCEED; + if (BATextend(b, BATcount(b) + ci->ncand) != GDK_SUCCEED) + return GDK_FAIL; + b->batCount += ci->ncand; + b->theap->free = ((b->batCount + 31) / 32) * 4; if (ci->tpe == cand_dense) { uint32_t *np; uint32_t noff, mask; @@ -520,7 +524,6 @@ append_msk_bat(BAT *b, BAT *n, struct ca noff = (ci->seq - n->hseqbase) % 32; cnt = ci->ncand; np = (uint32_t *) n->theap->base + (ci->seq - n->hseqbase) / 32; - b->batCount += cnt; if (boff == noff) { /* words of b and n are aligned, so we don't * need to shift bits around */ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Pymonetdb is required for the test
Changeset: 4a00b52dd870 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a00b52dd870 Modified Files: sql/test/BugTracker-2020/Tests/All Branch: Jun2020 Log Message: Pymonetdb is required for the test diffs (9 lines): diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -15,4 +15,4 @@ select-and.Bug-6878 copy-decimal-with-space.Bug-6917 isauuid.Bug-6934 tpch-cube.Bug-6938 -remote-table-like.Bug-6641 +HAVE_PYMONETDB?remote-table-like.Bug-6641 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Some analytic functions don't include the bou...
Changeset: 8feb70662cd8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8feb70662cd8 Modified Files: sql/server/rel_dump.c sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out sql/test/subquery/Tests/subquery6.sql Branch: Jun2020 Log Message: Some analytic functions don't include the bounds on their definition. Also a new crash :( diffs (60 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1047,6 +1047,11 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re f = sql_bind_func_(sql->sa, s, cname, ops, F_FUNC); if (!f) f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); + if (!f && list_length(ops) > 1) { + list_remove_node(ops, ops->t); + list_remove_node(ops, ops->t); /* some window functions require don't include the bounds on their definition, ugh */ + f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); + } /* fix scale of mul function, other type casts are explicit */ if (f && f->func->fix_scale == SCALE_MUL && list_length(exps) == 2) { diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py @@ -57,6 +57,12 @@ with tempfile.TemporaryDirectory() as fa print(node2_cur.fetchall()) node2_cur.execute("select name like 'N%' from remote_data") print(node2_cur.fetchall()) +node2_cur.execute("select corr(1,1) from remote_data") +print(node2_cur.fetchall()) +node2_cur.execute("select corr(1,1) over () from remote_data") +print(node2_cur.fetchall()) +node2_cur.execute("select count(*) over (), max(name) over (), min(name) over (partition by name order by name rows between 3 preceding and 2 preceding) from remote_data") +print(node2_cur.fetchall()) # cleanup: shutdown the monetdb servers and remove tempdir out, err = node1_proc.communicate() diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out @@ -11,6 +11,9 @@ stdout of test 'remote-table-like.Bug-66 [(1, 'Name 1')] [(1,)] [(True,)] +[(None,)] +[(None,)] +[(1, 'Name 1', None)] # 10:29:37 > # 10:29:37 > "Done." diff --git a/sql/test/subquery/Tests/subquery6.sql b/sql/test/subquery/Tests/subquery6.sql --- a/sql/test/subquery/Tests/subquery6.sql +++ b/sql/test/subquery/Tests/subquery6.sql @@ -189,6 +189,12 @@ DROP FUNCTION debugme6; select rank() over (), min(TotalSales) from tbl_ProductSales; -- 1 100 +select count(*) over (), max(Product_Name) from tbl_ProductSales; + -- 1 Shorts + +select corr(1,1), corr(1,1) over () from tbl_ProductSales; + -- NULL NULL + DROP TABLE tbl_ProductSales; DROP TABLE another_T; DROP TABLE integers; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - New bug, I think the rank function hack has i...
Changeset: e034be3fd811 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e034be3fd811 Modified Files: sql/test/subquery/Tests/subquery6.sql Branch: Jun2020 Log Message: New bug, I think the rank function hack has issues :( diffs (13 lines): diff --git a/sql/test/subquery/Tests/subquery6.sql b/sql/test/subquery/Tests/subquery6.sql --- a/sql/test/subquery/Tests/subquery6.sql +++ b/sql/test/subquery/Tests/subquery6.sql @@ -186,6 +186,9 @@ SELECT debugme6(); --NULL DROP FUNCTION debugme6; +select rank() over (), min(TotalSales) from tbl_ProductSales; + -- 1 100 + DROP TABLE tbl_ProductSales; DROP TABLE another_T; DROP TABLE integers; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Find analytic functions at rel_read and use a...
Changeset: 097a1facd950 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=097a1facd950 Modified Files: sql/server/rel_dump.c sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out Branch: Jun2020 Log Message: Find analytic functions at rel_read and use all input types to find an aggregate diffs (68 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1027,12 +1027,16 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (tname && !s) return sql_error(sql, -1, SQLSTATE(42000) "Schema %s not found\n", tname); if (grp) { - if (exps && exps->h) - a = sql_bind_func(sql->sa, s, cname, exp_subtype(exps->h->data), NULL, F_AGGR); - else + if (exps && exps->h) { + list *ops = sa_list(sql->sa); + for( n = exps->h; n; n = n->next) + append(ops, exp_subtype(n->data)); + a = sql_bind_func_(sql->sa, s, cname, ops, F_AGGR); + } else { a = sql_bind_func(sql->sa, s, cname, sql_bind_localtype("void"), NULL, F_AGGR); /* count(*) */ + } if (!a) - return sql_error(sql, -1, SQLSTATE(42000) "Aggregate %s%s%s not found\n", tname ? tname : "", tname ? "." : "", cname); + return sql_error(sql, -1, SQLSTATE(42000) "Aggregate '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, list_length(exps)); exp = exp_aggr( sql->sa, exps, a, unique, no_nils, CARD_ATOM, 1); if (zero_if_empty) set_zero_if_empty(exp); @@ -1041,6 +1045,8 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re for( n = exps->h; n; n = n->next) append(ops, exp_subtype(n->data)); f = sql_bind_func_(sql->sa, s, cname, ops, F_FUNC); + if (!f) + f = sql_bind_func_(sql->sa, s, cname, ops, F_ANALYTIC); /* fix scale of mul function, other type casts are explicit */ if (f && f->func->fix_scale == SCALE_MUL && list_length(exps) == 2) { @@ -1071,7 +1077,7 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (f) exp = exp_op( sql->sa, exps, f); else - return sql_error(sql, -1, SQLSTATE(42000) "Function: missing '%s.%s %d'\n", tname, cname, list_length(ops)); + return sql_error(sql, -1, SQLSTATE(42000) "Function '%s%s%s %d' not found\n", tname ? tname : "", tname ? "." : "", cname, list_length(ops)); } } diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py @@ -53,6 +53,10 @@ with tempfile.TemporaryDirectory() as fa print(node2_cur.fetchall()) node2_cur.execute("select * from remote_data where name like 'N%'") print(node2_cur.fetchall()) +node2_cur.execute("select rank() over () from remote_data where name like 'N%'") +print(node2_cur.fetchall()) +node2_cur.execute("select name like 'N%' from remote_data") +print(node2_cur.fetchall()) # cleanup: shutdown the monetdb servers and remove tempdir out, err = node1_proc.communicate() diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out --- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out @@ -9,6 +9,8 @@ stdout of test 'remote-table-like.Bug-66 [(1, 'Name 1')] [(1, 'Name 1')] [(1, 'Name 1')] +[(1,)] +[(True,)] # 10:29:37 > # 10:29:37 > "Done." ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - First check for msk type, only then for dense ...
Changeset: 1b7c9ab2a295 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b7c9ab2a295 Modified Files: gdk/gdk_batop.c Branch: unlock Log Message: First check for msk type, only then for dense positions. diffs (49 lines): diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -1224,6 +1224,22 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool #endif } } + } else if (ATOMstorage(b->ttype) == TYPE_msk) { + for (BUN i = 0, j = BATcount(p); i < j; i++) { + oid updid = BUNtoid(p, i); + + if (updid < b->hseqbase || updid >= hseqend) { + GDKerror("id out of range\n"); + return GDK_FAIL; + } + updid -= b->hseqbase; + if (!force && updid < b->batInserted) { + GDKerror("updating committed value\n"); + return GDK_FAIL; + } + + mskSetVal(b, updid, mskGetVal(n, i)); + } } else if (BATtdense(p)) { oid updid = BUNtoid(p, 0); @@ -1305,22 +1321,6 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool BATtseqbase(b, n->tseqbase); } } - } else if (ATOMstorage(b->ttype) == TYPE_msk) { - for (BUN i = 0, j = BATcount(p); i < j; i++) { - oid updid = BUNtoid(p, i); - - if (updid < b->hseqbase || updid >= hseqend) { - GDKerror("id out of range\n"); - return GDK_FAIL; - } - updid -= b->hseqbase; - if (!force && updid < b->batInserted) { - GDKerror("updating committed value\n"); - return GDK_FAIL; - } - - mskSetVal(b, updid, mskGetVal(n, i)); - } } else { for (BUN i = 0, j = BATcount(p); i < j; i++) { oid updid = BUNtoid(p, i); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Added test and fix for Bug 6641, ie use the r...
Changeset: 6218f107b2bb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6218f107b2bb Added Files: sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.err sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.stable.out Modified Files: sql/server/rel_dump.c sql/server/rel_select.c sql/test/BugTracker-2020/Tests/All Branch: Jun2020 Log Message: Added test and fix for Bug 6641, ie use the right lists to find the filter function at rel_read. Small cleanup diffs (203 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -911,10 +911,22 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re if (!(rexps = read_exps(sql, lrel, rrel, pexps, r, pos, '(', 0))) return NULL; if (filter) { - sql_subfunc *func = sql_find_func(sql->sa, mvc_bind_schema(sql, "sys"), fname, 1+list_length(exps), F_FILT, NULL); - if (!func) + sql_subfunc *func = NULL; + list *tl = sa_list(sql->sa); + + for (node *n = lexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + for (node *n = rexps->h; n; n = n->next){ + sql_exp *e = n->data; + + list_append(tl, exp_subtype(e)); + } + + if (!(func = sql_bind_func_(sql->sa, mvc_bind_schema(sql, "sys"), fname, tl, F_FILT))) return sql_error(sql, -1, SQLSTATE(42000) "Filter: missing function '%s'\n", fname); - return exp_filter(sql->sa, lexps, rexps, func, anti); } return exp_or(sql->sa, lexps, rexps, anti); diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -1401,20 +1401,16 @@ rel_filter(mvc *sql, sql_rel *rel, list sql_exp *L = l->h->data, *R = r->h->data, *e = NULL; sql_subfunc *f = NULL; sql_schema *s = cur_schema(sql); - list *tl, *exps; - - exps = sa_list(sql->sa); - tl = sa_list(sql->sa); + list *tl = sa_list(sql->sa); + for (n = l->h; n; n = n->next){ sql_exp *e = n->data; - list_append(exps, e); list_append(tl, exp_subtype(e)); } for (n = r->h; n; n = n->next){ sql_exp *e = n->data; - list_append(exps, e); list_append(tl, exp_subtype(e)); } if (sname && !(s = mvc_bind_schema(sql, sname))) @@ -1423,7 +1419,7 @@ rel_filter(mvc *sql, sql_rel *rel, list f = sql_bind_func_(sql->sa, s, filter_op, tl, F_FILT); if (!f) - f = find_func(sql, s, filter_op, list_length(exps), F_FILT, NULL); + f = find_func(sql, s, filter_op, list_length(tl), F_FILT, NULL); if (f) { node *n,*m = f->func->ops->h; list *nexps = sa_list(sql->sa); diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -15,3 +15,4 @@ select-and.Bug-6878 copy-decimal-with-space.Bug-6917 isauuid.Bug-6934 tpch-cube.Bug-6938 +remote-table-like.Bug-6641 diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6641.py @@ -0,0 +1,62 @@ +import os +import socket +import sys +import tempfile +import threading + +import pymonetdb + +try: +from MonetDBtesting import process +except ImportError: +import process + + +# Find a free network port +def freeport(): +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.bind(('', 0)) +port = sock.getsockname()[1] +sock.close() +return port + + +with tempfile.TemporaryDirectory() as farm_dir: +os.mkdir(os.path.join(farm_dir, 'node1')) +os.mkdir(os.path.join(farm_dir, 'node2')) + +node1_port = freeport() +with process.server(mapiport=node1_port, dbname='node1', +dbfarm=os.path.join(farm_dir, 'node1'), +stdin=process.PIPE, stdout=process.PIPE, +stderr=process.PIPE) as node1_proc: +node1_conn = pymonetdb.connect(database='node1', port=node1_port, autocommit=True) +node1_cur =
MonetDB: unlock - Manipulate hseqbase, not tseqbase.
Changeset: 8487ebba7aa0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8487ebba7aa0 Modified Files: gdk/gdk_batop.c Branch: unlock Log Message: Manipulate hseqbase, not tseqbase. diffs (15 lines): diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -517,9 +517,9 @@ append_msk_bat(BAT *b, BAT *n, struct ca uint32_t *np; uint32_t noff, mask; BUN cnt; - noff = (ci->seq - n->tseqbase) % 32; + noff = (ci->seq - n->hseqbase) % 32; cnt = ci->ncand; - np = (uint32_t *) n->theap->base + (ci->seq - n->tseqbase) / 32; + np = (uint32_t *) n->theap->base + (ci->seq - n->hseqbase) / 32; b->batCount += cnt; if (boff == noff) { /* words of b and n are aligned, so we don't ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: trails - Don't unclock baskets[0]. It's never used, hen...
Changeset: 232f7f1d1c59 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=232f7f1d1c59 Modified Files: sql/backends/monet5/sql_basket.c Branch: trails Log Message: Don't unclock baskets[0]. It's never used, hence never locked diffs (15 lines): diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c --- a/sql/backends/monet5/sql_basket.c +++ b/sql/backends/monet5/sql_basket.c @@ -515,10 +515,8 @@ BSKTunlock(Client cntxt, MalBlkPtr mb, M (void) mb; idx = BSKTlocate(sch, tbl); - if( idx ==0) { - MT_lock_unset([idx].lock); + if( idx ==0) throw(SQL,"basket.lock",SQLSTATE(3F000) "Stream table %s.%s not accessible\n",sch,tbl); - } /* this is also the place to administer the size of the basket */ b = BSKTbindColumn(sch,tbl, baskets[idx].cols[0]->base.name); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Approved output
Changeset: 1be2855f5d97 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1be2855f5d97 Added Files: sql/test/SQLancer/Tests/sqlancer04.stable.err sql/test/SQLancer/Tests/sqlancer04.stable.out Branch: Jun2020 Log Message: Approved output diffs (58 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.err b/sql/test/SQLancer/Tests/sqlancer04.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.err @@ -0,0 +1,12 @@ +stderr of test 'sqlancer04` in directory 'sql/test/SQLancer` itself: + + +# 09:44:50 > +# 09:44:50 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-36890" "--port=30177" +# 09:44:50 > + + +# 09:44:50 > +# 09:44:50 > "Done." +# 09:44:50 > + diff --git a/sql/test/SQLancer/Tests/sqlancer04.stable.out b/sql/test/SQLancer/Tests/sqlancer04.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/SQLancer/Tests/sqlancer04.stable.out @@ -0,0 +1,36 @@ +stdout of test 'sqlancer04` in directory 'sql/test/SQLancer` itself: + + +# 09:44:50 > +# 09:44:50 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-36890" "--port=30177" +# 09:44:50 > + +#START TRANSACTION; +#CREATE TABLE "sys"."t0" ("c0" INTERVAL MONTH NOT NULL); +#COPY 3 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#150184010 +#332127116 +#2136089006 +[ 3] +#SELECT SUM(ALL 0.12830007105673624234754015560611151158) FROM t0 WHERE ((sql_min(t0.c0, t0.c0))<>(COALESCE (t0.c0, sql_min(abs(t0.c0), nullif(t0.c0, t0.c0) GROUP BY 0.1 +#HAVING MIN(ALL ((r'946496923')LIKE(CAST(nullif(0.5, 0.03) AS STRING(538) +#UNION ALL SELECT SUM(ALL 0.12830007105673624234754015560611151158) FROM t0 WHERE ((sql_min(t0.c0, t0.c0))<>(COALESCE (t0.c0, sql_min(abs(t0.c0), nullif(t0.c0, t0.c0) GROUP BY 0.1 +#HAVING NOT (MIN(ALL ((r'946496923')LIKE(CAST(nullif(0.5, 0.03) AS STRING(538)) +% .%26 # table_name +% %2 # name +% double # type +% 24 # length +#SELECT SUM(ALL 0.12830007105673624234754015560611151158) FROM t0 WHERE ((sql_min(t0.c0, t0.c0))<>(COALESCE (t0.c0, sql_min(abs(t0.c0), nullif(t0.c0, t0.c0) GROUP BY 0.1 +#HAVING MIN(ALL ((r'946496923')LIKE(CAST(nullif(0.5, 0.03) AS STRING(538) +#UNION ALL SELECT SUM(ALL 0.12830007105673624234754015560611151158) FROM t0 WHERE ((sql_min(t0.c0, t0.c0))<>(COALESCE (t0.c0, sql_min(abs(t0.c0), nullif(t0.c0, t0.c0) GROUP BY 0.1 +#HAVING NOT (MIN(ALL ((r'946496923')LIKE(CAST(nullif(0.5, 0.03) AS STRING(538)) +% .%26 # table_name +% %2 # name +% double # type +% 24 # length +#ROLLBACK; + +# 09:44:50 > +# 09:44:50 > "Done." +# 09:44:50 > + ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Don't set properties on input bats.
Changeset: 8a328745f3e6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8a328745f3e6 Modified Files: gdk/gdk_calc.c Branch: Jun2020 Log Message: Don't set properties on input bats. diffs (79 lines): diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -320,11 +320,6 @@ BATcalcnot(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -450,11 +445,6 @@ BATcalcnegate(BAT *b, BAT *s, BAT *r) bn->tnonil = nils == 0; bn->tkey = b->tkey && nils <= 1; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -590,11 +580,6 @@ BATcalcabsolute(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -729,11 +714,6 @@ BATcalciszero(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -872,11 +852,6 @@ BATcalcsign(BAT *b, BAT *s, BAT *r) bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils != 0 && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", ALGOBATPAR(b), ALGOOPTBATPAR(s), @@ -3805,15 +3780,6 @@ BATcalcincrdecr(BAT *b, BAT *s, BAT *r, bn->tnil = nils != 0; bn->tnonil = nils == 0; - if (nils && !b->tnil) { - b->tnil = true; - b->batDirtydesc = true; - } - if (nils == 0 && !b->tnonil) { - b->tnonil = true; - b->batDirtydesc = true; - } - TRC_DEBUG(ALGO, "%s: b=" ALGOBATFMT ",s=" ALGOOPTBATFMT ",r=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT " " LLFMT "usec\n", func, ALGOBATPAR(b), ALGOOPTBATPAR(s), ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - Merge with default branch.
Changeset: 807b2332eec2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=807b2332eec2 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c Branch: unlock Log Message: Merge with default branch. diffs (257 lines): diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c --- a/monetdb5/modules/mal/sysmon.c +++ b/monetdb5/modules/mal/sysmon.c @@ -31,13 +31,14 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, bat *w = getArgReference_bat(stk,pci,7); bat *m = getArgReference_bat(stk,pci,8); lng qtag; - int wrk, mem, sz; + int wrk, mem; + BUN sz; timestamp tsn; str msg = MAL_SUCCEED; (void) cntxt; (void) mb; - sz = qsize; // reserve space for all tuples in QRYqueue + sz = (BUN) qsize; // reserve space for all tuples in QRYqueue tag = COLnew(0, TYPE_lng, sz, TRANSIENT); sessionid = COLnew(0, TYPE_int, sz, TRANSIENT); user = COLnew(0, TYPE_str, sz, TRANSIENT); diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -774,7 +774,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l } assert(!e->r); if (exps) { - int nrcols = 0; + unsigned nrcols = 0; int push_cond_exec = 0, coalesce = 0; stmt *ncond = NULL, *ocond = cond; diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -2612,7 +2612,7 @@ stmt_catalog(backend *be, int type, stmt void stmt_set_nrcols(stmt *s) { - int nrcols = 0; + unsigned nrcols = 0; int key = 1; node *n; list *l = s->op4.lval; diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -3167,34 +3167,33 @@ static sql_exp * rel_nop(sql_query *query, sql_rel **rel, symbol *se, int fs, exp_kind ek) { mvc *sql = query->sql; - int nr_args = 0; + int nr_args = 0, err = 0; dnode *l = se->data.lval->h; dnode *ops = l->next->next->data.lval?l->next->next->data.lval->h:NULL; list *exps = sa_list(sql->sa), *tl = sa_list(sql->sa); sql_subfunc *sf = NULL; sql_schema *s = cur_schema(sql); exp_kind iek = {type_value, card_column, FALSE}; - int err = 0; for (; ops; ops = ops->next, nr_args++) { - sql_exp *e = rel_value_exp(query, rel, ops->data.sym, fs, iek); - sql_subtype *tpe; - - if (!e) - err = 1; - append(exps, e); - if (e) { - tpe = exp_subtype(e); - append(tl, tpe); + if (!err) { /* we need the nr_args count at the end, but if an error is found, stop calling rel_value_exp */ + sql_exp *e = rel_value_exp(query, rel, ops->data.sym, fs, iek); + if (!e) { + err = 1; + continue; + } + append(exps, e); + append(tl, exp_subtype(e)); } } if (l->type == type_int) { /* exec nr (ops)*/ int nr = l->data.i_val; - cq *q = qc_find(sql->qc, nr); - - if (q) { - node *n, *m; + cq *q; + + if (err) + return NULL; + if ((q = qc_find(sql->qc, nr))) { list *nexps = new_exp_list(sql->sa); sql_func *f = q->f; @@ -3202,7 +3201,7 @@ rel_nop(sql_query *query, sql_rel **rel, if (list_length(f->ops) != list_length(exps)) return sql_error(sql, 02, SQLSTATE(42000) "EXEC called with wrong number of arguments: expected %d, got %d", list_length(f->ops), list_length(exps)); if (exps->h && f->ops) { - for (n = exps->h, m = f->ops->h; n && m; n = n->next, m = m->next) { + for (node *n = exps->h, *m = f->ops->h; n && m; n = n->next, m = m->next) { sql_arg *a = m->data; sql_exp *e = n->data; sql_subtype *ntp = >type; @@ -3219,6 +3218,7 @@ rel_nop(sql_query *query, sql_rel **rel, sql->type = q->type; if (nexps) return exp_op(sql->sa, nexps, sql_dup_subfunc(sql->sa, f, tl, NULL)); + return NULL; }
MonetDB: unlock - Use a fresh name for a new function.
Changeset: f66f402f94a5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f66f402f94a5 Modified Files: monetdb5/modules/mal/batMask.c Branch: unlock Log Message: Use a fresh name for a new function. diffs (10 lines): diff --git a/monetdb5/modules/mal/batMask.c b/monetdb5/modules/mal/batMask.c --- a/monetdb5/modules/mal/batMask.c +++ b/monetdb5/modules/mal/batMask.c @@ -78,5 +78,5 @@ mel_func batMask_init_funcs[] = { #undef read #pragma section(".CRT$XCU",read) #endif -LIB_STARTUP_FUNC(init_batExtensions_mal) +LIB_STARTUP_FUNC(init_batMask_mal) { mal_module("batMask", NULL, batMask_init_funcs); } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: unlock - Added casts.
Changeset: 87982f8ef6c6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=87982f8ef6c6 Modified Files: gdk/gdk_calc.c Branch: unlock Log Message: Added casts. diffs (30 lines): diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -14487,7 +14487,7 @@ convert_msk_##TYPE(const uint32_t *restr dst[k] = TYPE##_nil;\ nils++; \ } else {\ - dst[k] = (mask & (1U << j)) != 0; \ + dst[k] = (TYPE) ((mask & (1U << j)) != 0); \ } \ k++;\ } \ @@ -14500,7 +14500,7 @@ convert_msk_##TYPE(const uint32_t *restr dst[k] = TYPE##_nil;\ nils++; \ } else {\ - dst[k] = (mask & (1U << j)) != 0; \ + dst[k] = (TYPE) ((mask & (1U << j)) != 0); \ } \ k++;\ } \ @@ -14512,7 +14512,7 @@ convert_msk_##TYPE(const uint32_t *restr dst[k] = TYPE##_nil;\ nils++; \ } else {\ - dst[k] = (src[x / 32] & (1U << (x % 32))) != 0; \ + dst[k] = (TYPE) ((src[x / 32] & (1U << (x % 32))) != 0); \ } \ } \ } \ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Fix some types.
Changeset: 50d364de468c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=50d364de468c Modified Files: monetdb5/modules/mal/sysmon.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c Branch: default Log Message: Fix some types. diffs (44 lines): diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c --- a/monetdb5/modules/mal/sysmon.c +++ b/monetdb5/modules/mal/sysmon.c @@ -31,13 +31,14 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, bat *w = getArgReference_bat(stk,pci,7); bat *m = getArgReference_bat(stk,pci,8); lng qtag; - int wrk, mem, sz; + int wrk, mem; + BUN sz; timestamp tsn; str msg = MAL_SUCCEED; (void) cntxt; (void) mb; - sz = qsize; // reserve space for all tuples in QRYqueue + sz = (BUN) qsize; // reserve space for all tuples in QRYqueue tag = COLnew(0, TYPE_lng, sz, TRANSIENT); sessionid = COLnew(0, TYPE_int, sz, TRANSIENT); user = COLnew(0, TYPE_str, sz, TRANSIENT); diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -774,7 +774,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l } assert(!e->r); if (exps) { - int nrcols = 0; + unsigned nrcols = 0; int push_cond_exec = 0, coalesce = 0; stmt *ncond = NULL, *ocond = cond; diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -2610,7 +2610,7 @@ stmt_catalog(backend *be, int type, stmt void stmt_set_nrcols(stmt *s) { - int nrcols = 0; + unsigned nrcols = 0; int key = 1; node *n; list *l = s->op4.lval; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list