Changeset: 539e9eb15c3e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=539e9eb15c3e Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 monetdb5/modules/kernel/batmmath.c sql/backends/monet5/sql.c sql/backends/monet5/sql_cast.c Branch: default Log Message:
Clean up some more conditional execution stuff. diffs (truncated from 392 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 @@ -6568,7 +6568,6 @@ stdout of test 'MAL-signatures` in direc [ "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", "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;", "" ] [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:lng]):bat[:daytime] ", "MTIMEdaytime_fromseconds_bulk;", "" ] [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:str]):bat[:daytime] ", "MTIMEdaytime_fromstr_bulk;", "" ] @@ -6576,7 +6575,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:str], X_2:int):bat[:daytime] ", "batstr_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:daytime], X_2:int):bat[:daytime] ", "daytime_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:oid], X_2:int):bat[:daytime] ", "nil_2time_daytime;", "" ] -[ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:oid], X_2:int, X_3:bat[:bit]):bat[:daytime] ", "nil_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:lng], X_2:int):bat[:daytime] ", "second_interval_2_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:daytime], X_2:int):bat[:daytime] ", "str_2time_daytimetz;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:timestamp], X_2:int):bat[:daytime] ", "timestamp_2_daytime;", "" ] @@ -8950,7 +8948,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "str", "pattern batcalc.str(X_1:bat[:any], X_2:bat[:oid]):bat[:str] ", "CMDconvertsignal_str;", "" ] [ "batcalc", "str", "pattern batcalc.str(X_1:bat[:any], X_2:bat[:oid], X_3:bat[:bit]):bat[:str] ", "CMDconvertsignal_str;", "" ] [ "batcalc", "str", "pattern batcalc.str(X_1:int, X_2:int, X_3:int, X_4:int, X_5:bat[:any_1], X_6:int):bat[:str] ", "SQLbatstr_cast;", "" ] -[ "batcalc", "str", "pattern batcalc.str(X_1:int, X_2:int, X_3:int, X_4:int, X_5:bat[:any_1], X_6:int, X_7:bat[:bit]):bat[:str] ", "SQLbatstr_cast;", "" ] [ "batcalc", "str_noerror", "pattern batcalc.str_noerror(X_1:bat[:any]):bat[:str] ", "CMDconvert_str;", "" ] [ "batcalc", "str_noerror", "pattern batcalc.str_noerror(X_1:bat[:any], X_2:bat[:bit]):bat[:str] ", "CMDconvert_str;", "" ] [ "batcalc", "str_noerror", "pattern batcalc.str_noerror(X_1:bat[:any], X_2:bat[:oid]):bat[:str] ", "CMDconvert_str;", "" ] 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 @@ -5178,7 +5178,6 @@ stdout of test 'MAL-signatures` in direc [ "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", "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;", "" ] [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:lng]):bat[:daytime] ", "MTIMEdaytime_fromseconds_bulk;", "" ] [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:str]):bat[:daytime] ", "MTIMEdaytime_fromstr_bulk;", "" ] @@ -5186,7 +5185,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "daytime", "command batcalc.daytime(X_1:bat[:str], X_2:int):bat[:daytime] ", "batstr_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:daytime], X_2:int):bat[:daytime] ", "daytime_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:oid], X_2:int):bat[:daytime] ", "nil_2time_daytime;", "" ] -[ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:oid], X_2:int, X_3:bat[:bit]):bat[:daytime] ", "nil_2time_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:lng], X_2:int):bat[:daytime] ", "second_interval_2_daytime;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:daytime], X_2:int):bat[:daytime] ", "str_2time_daytimetz;", "" ] [ "batcalc", "daytime", "pattern batcalc.daytime(X_1:bat[:timestamp], X_2:int):bat[:daytime] ", "timestamp_2_daytime;", "" ] @@ -6945,7 +6943,6 @@ stdout of test 'MAL-signatures` in direc [ "batcalc", "str", "pattern batcalc.str(X_1:bat[:any]):bat[:str] ", "CMDconvertsignal_str;", "" ] [ "batcalc", "str", "pattern batcalc.str(X_1:bat[:any], X_2:bat[:oid]):bat[:str] ", "CMDconvertsignal_str;", "" ] [ "batcalc", "str", "pattern batcalc.str(X_1:int, X_2:int, X_3:int, X_4:int, X_5:bat[:any_1], X_6:int):bat[:str] ", "SQLbatstr_cast;", "" ] -[ "batcalc", "str", "pattern batcalc.str(X_1:int, X_2:int, X_3:int, X_4:int, X_5:bat[:any_1], X_6:int, X_7:bat[:bit]):bat[:str] ", "SQLbatstr_cast;", "" ] [ "batcalc", "str_noerror", "pattern batcalc.str_noerror(X_1:bat[:any]):bat[:str] ", "CMDconvert_str;", "" ] [ "batcalc", "str_noerror", "pattern batcalc.str_noerror(X_1:bat[:any], X_2:bat[:oid]):bat[:str] ", "CMDconvert_str;", "" ] [ "batcalc", "strings", "command batcalc.strings(X_1:bat[:str]):bat[:str] ", "BATSTRstrings;", "" ] diff --git a/monetdb5/modules/kernel/batmmath.c b/monetdb5/modules/kernel/batmmath.c --- a/monetdb5/modules/kernel/batmmath.c +++ b/monetdb5/modules/kernel/batmmath.c @@ -19,8 +19,7 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr const char *malfunc) { bat bid; - BAT *bn, *b, *s = NULL, *r = NULL; - const bit *rv; + BAT *bn, *b, *s = NULL; struct canditer ci; oid x; BUN i; @@ -31,32 +30,13 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr if ((b = BATdescriptor(bid)) == NULL) throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); - if (pci->argc == 4) { - bid = *getArgReference_bat(stk, pci, 3); - if (!is_bat_nil(bid)) { - if ((r = BATdescriptor(bid)) == NULL) { - BBPunfix(b->batCacheid); - throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); - } - assert(r->ttype == TYPE_bit); - } - } - - if (pci->argc >= 3) { + if (pci->argc == 3) { bid = *getArgReference_bat(stk, pci, 2); if (!is_bat_nil(bid)) { if ((s = BATdescriptor(bid)) == NULL) { BBPunfix(b->batCacheid); - if (r) - BBPunfix(r->batCacheid); throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); } - if (s->ttype == TYPE_bit) { - assert(pci->argc == 3); - assert(r == NULL); - r = s; - s = NULL; - } } } @@ -66,15 +46,11 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr BBPunfix(b->batCacheid); if (s) BBPunfix(s->batCacheid); - if (r) - BBPunfix(r->batCacheid); if (bn == NULL) throw(MAL, malfunc, GDK_EXCEPTION); goto doreturn; } - rv = r ? Tloc(r, 0) : NULL; - errno = 0; feclearexcept(FE_ALL_EXCEPT); switch (b->ttype) { @@ -83,7 +59,7 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr flt *restrict fdst = (flt *) Tloc(bn, 0); for (i = 0; i < ci.ncand; i++) { x = canditer_next(&ci) - b->hseqbase; - if ((rv != NULL && !rv[i]) || is_flt_nil(fsrc[x])) { + if (is_flt_nil(fsrc[x])) { fdst[i] = flt_nil; nils++; } else { @@ -97,7 +73,7 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr dbl *restrict ddst = (dbl *) Tloc(bn, 0); for (i = 0; i < ci.ncand; i++) { x = canditer_next(&ci) - b->hseqbase; - if ((rv != NULL && !rv[i]) || is_dbl_nil(dsrc[x])) { + if (is_dbl_nil(dsrc[x])) { ddst[i] = dbl_nil; nils++; } else { @@ -114,8 +90,6 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr BBPunfix(b->batCacheid); if (s) BBPunfix(s->batCacheid); - if (r) - BBPunfix(r->batCacheid); if (e != 0 || ex != 0) { const char *err; BBPunfix(bn->batCacheid); @@ -148,10 +122,9 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr const char *malfunc) { bat bid; - BAT *bn, *b1 = NULL, *b2 = NULL, *s1 = NULL, *s2 = NULL, *r = NULL; + BAT *bn, *b1 = NULL, *b2 = NULL, *s1 = NULL, *s2 = NULL; int tp1, tp2; struct canditer ci1 = (struct canditer){0}, ci2 = (struct canditer){0}; - const bit *rv; oid x1, x2; BUN i; BUN nils = 0; @@ -180,29 +153,13 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr assert(tp1 == tp2); assert(b1 != NULL || b2 != NULL); - if (pci->argc > 5) { - assert(pci->argc == 6); - bid = *getArgReference_bat(stk, pci, 5); - if (!is_bat_nil(bid)) { - r = BATdescriptor(bid); - if (r == NULL) - goto bailout; - assert(r->ttype == TYPE_bit); - } - } if (pci->argc > 4) { + assert(pci->argc == 5); bid = *getArgReference_bat(stk, pci, 4); if (!is_bat_nil(bid)) { s2 = BATdescriptor(bid); if (s2 == NULL) goto bailout; - if (s2->ttype == TYPE_bit) { - assert(pci->argc == 5); - assert(r == NULL); - assert(b1 == NULL || b2 == NULL); - r = s2; - s2 = NULL; - } } } if (pci->argc > 3) { @@ -211,11 +168,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr s1 = BATdescriptor(bid); if (s1 == NULL) goto bailout; - if (s1->ttype == TYPE_bit) { - assert(pci->argc == 4); - r = s1; - s1 = NULL; - } else if (b1 == NULL) { + if (b1 == NULL) { s2 = s1; s1 = NULL; } @@ -249,8 +202,6 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr goto doreturn; } - rv = r ? Tloc(r, 0) : NULL; - errno = 0; feclearexcept(FE_ALL_EXCEPT); switch (tp1) { @@ -262,8 +213,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr for (i = 0; i < ci1.ncand; i++) { x1 = canditer_next(&ci1) - b1->hseqbase; x2 = canditer_next(&ci2) - b2->hseqbase; - if ((rv != NULL && !rv[i]) || - is_flt_nil(fsrc1[x1]) || + if (is_flt_nil(fsrc1[x1]) || is_flt_nil(fsrc2[x2])) { fdst[i] = flt_nil; nils++; @@ -277,8 +227,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr flt *restrict fdst = (flt *) Tloc(bn, 0); for (i = 0; i < ci1.ncand; i++) { x1 = canditer_next(&ci1) - b1->hseqbase; - if ((rv != NULL && !rv[i]) || - is_flt_nil(fsrc1[x1])) { + if (is_flt_nil(fsrc1[x1])) { fdst[i] = flt_nil; nils++; } else { @@ -291,8 +240,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr flt *restrict fdst = (flt *) Tloc(bn, 0); for (i = 0; i < ci2.ncand; i++) { x2 = canditer_next(&ci2) - b2->hseqbase; - if ((rv != NULL && !rv[i]) || - is_flt_nil(fsrc2[x2])) { + if (is_flt_nil(fsrc2[x2])) { fdst[i] = flt_nil; nils++; } else { @@ -309,8 +257,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr for (i = 0; i < ci1.ncand; i++) { x1 = canditer_next(&ci1) - b1->hseqbase; x2 = canditer_next(&ci2) - b2->hseqbase; - if ((rv != NULL && !rv[i]) || - is_dbl_nil(dsrc1[x1]) || + if (is_dbl_nil(dsrc1[x1]) || is_dbl_nil(dsrc2[x2])) { ddst[i] = dbl_nil; nils++; @@ -324,8 +271,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr dbl *restrict ddst = (dbl *) Tloc(bn, 0); for (i = 0; i < ci1.ncand; i++) { x1 = canditer_next(&ci1) - b1->hseqbase; - if ((rv != NULL && !rv[i]) || - is_dbl_nil(dsrc1[x1])) { + if (is_dbl_nil(dsrc1[x1])) { ddst[i] = dbl_nil; nils++; } else { @@ -338,8 +284,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr dbl *restrict ddst = (dbl *) Tloc(bn, 0); for (i = 0; i < ci2.ncand; i++) { x2 = canditer_next(&ci2) - b2->hseqbase; - if ((rv != NULL && !rv[i]) || - is_dbl_nil(dsrc2[x2])) { + if (is_dbl_nil(dsrc2[x2])) { ddst[i] = dbl_nil; nils++; } else { @@ -370,8 +315,6 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr BBPunfix(s1->batCacheid); if (s2) BBPunfix(s2->batCacheid); - if (r) - BBPunfix(r->batCacheid); if (bn == NULL) throw(MAL, malfunc, GDK_EXCEPTION); if (e != 0 || ex != 0) { @@ -400,8 +343,6 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr BBPunfix(s1->batCacheid); if (s2) BBPunfix(s2->batCacheid); - if (r) - BBPunfix(r->batCacheid); throw(MAL, malfunc, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); } 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 @@ -5671,7 +5671,6 @@ static mel_func sql_init_funcs[] = { pattern("batcalc", "timestamp", timestamp_2time_timestamp, false, "cast timestamp to timestamp and check for overflow", args(1,3, batarg("",timestamp),batarg("v",timestamp),arg("digits",int))), pattern("calc", "daytime", nil_2time_daytime, false, "cast to daytime and check for overflow", args(1,3, arg("",daytime),arg("v",void),arg("digits",int))), pattern("batcalc", "daytime", nil_2time_daytime, false, "cast to daytime and check for overflow", args(1,3, batarg("",daytime),batarg("v",oid),arg("digits",int))), - pattern("batcalc", "daytime", nil_2time_daytime, false, "cast to daytime and check for overflow", args(1,4, batarg("",daytime),batarg("v",oid),arg("digits",int),batarg("r",bit))), pattern("calc", "daytime", str_2time_daytime, false, "cast to daytime and check for overflow", args(1,3, arg("",daytime),arg("v",str),arg("digits",int))), pattern("calc", "daytime", str_2time_daytimetz, false, "cast to daytime and check for overflow", args(1,4, arg("",daytime),arg("v",str),arg("digits",int),arg("has_tz",int))), pattern("calc", "daytime", daytime_2time_daytime, false, "cast daytime to daytime and check for overflow", args(1,3, arg("",daytime),arg("v",daytime),arg("digits",int))), @@ -5684,7 +5683,6 @@ static mel_func sql_init_funcs[] = { pattern("sql", "current_timestamp", SQLcurrent_timestamp, false, "Get the clients current timestamp", args(1,1, arg("",timestamp))), _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list