Changeset: 9566791373dd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9566791373dd
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
monetdb5/mal/mal_listing.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/calc.c
monetdb5/optimizer/opt_pushselect.c
sql/test/BugTracker-2026/Tests/All
Branch: default
Log Message:
Merge with Dec2025 branch.
diffs (truncated from 354 to 300 lines):
diff --git a/clients/Tests/MAL-signatures-hge.test
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -47114,11 +47114,6 @@ command inspect.getAtomSizes():bat[:int]
INSPECTatom_sizes
Collect a BAT with the atom sizes.
inspect
-getAtomSuper
-command inspect.getAtomSuper():bat[:str]
-INSPECTatom_sup_names
-Collect a BAT with the atom names.
-inspect
getComment
pattern inspect.getComment(X_0:str, X_1:str):bat[:str]
INSPECTgetComment
diff --git a/clients/Tests/MAL-signatures.test
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -2819,11 +2819,6 @@ unsafe pattern alarm.sleep(X_0:any_1):an
ALARMsleep
Sleep a few milliseconds and return the slept value
alarm
-sleep
-unsafe pattern alarm.sleep(X_0:any_1):void
-ALARMsleep
-Sleep a few milliseconds
-alarm
time
unsafe command alarm.time():int
ALARMtime
@@ -22100,16 +22095,6 @@ CMDconvertsignal_str
(empty)
batcalc
str
-command batcalc.str(X_0:bat[:inet4], X_1:bat[:oid]):bat[:str]
-INETinet42str_bulk
-Coerce an inet4 to a string type
-batcalc
-str
-command batcalc.str(X_0:bat[:inet6], X_1:bat[:oid]):bat[:str]
-INETinet62str_bulk
-Coerce an inet6 to a string type
-batcalc
-str
pattern batcalc.str(X_0:int, X_1:int, X_2:int, X_3:int, X_4:bat[:any_1],
X_5:bat[:oid], X_6:int):bat[:str]
SQLbatstr_cast
cast to string and check for overflow
@@ -22119,11 +22104,6 @@ pattern batcalc.str(X_0:int, X_1:int, X_
SQLbatstr_cast
cast to string and check for overflow, no candidate list
batcalc
-str
-command batcalc.str(X_0:bat[:uuid], X_1:bat[:oid]):bat[:str]
-UUIDuuid2str_bulk
-Coerce a uuid to a string type
-batcalc
timestamp
pattern batcalc.timestamp(X_0:bat[:date], X_1:bat[:oid]):bat[:timestamp]
MTIMEtimestamp_fromdate_bulk
@@ -33565,25 +33545,10 @@ CMDvarCONVERT
Cast VALUE to str
calc
str
-command calc.str(X_0:inet4):str
-INETinet42str
-Coerce an inet4 to a string type
-calc
-str
-command calc.str(X_0:inet6):str
-INETinet62str
-Coerce an inet6 to a string type
-calc
-str
pattern calc.str(X_0:int, X_1:int, X_2:int, X_3:int, X_4:any_1, X_5:int):str
SQLstr_cast
cast to string and check for overflow
calc
-str
-command calc.str(X_0:uuid):str
-UUIDuuid2str
-Coerce a uuid to a string type
-calc
timestamp
command calc.timestamp(X_0:date):timestamp
MTIMEtimestamp_fromdate
@@ -35649,11 +35614,6 @@ command inspect.getAtomSizes():bat[:int]
INSPECTatom_sizes
Collect a BAT with the atom sizes.
inspect
-getAtomSuper
-command inspect.getAtomSuper():bat[:str]
-INSPECTatom_sup_names
-Collect a BAT with the atom names.
-inspect
getComment
pattern inspect.getComment(X_0:str, X_1:str):bat[:str]
INSPECTgetComment
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -65,7 +65,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
char *bufend = buf;
int nameused = 0;
str tpe;
- int showtype = 0, closequote = 0;
+ bool showtype = false, closequote = false;
int varid = getArg(p, idx);
// show the name when required or is used
@@ -105,7 +105,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
if (!isaBatType(getVarType(mb, varid))
&& getBatType(getVarType(mb, varid)) >=
TYPE_date
&& getBatType(getVarType(mb, varid)) !=
TYPE_str) {
- closequote = 1;
+ closequote = true;
bufend = stpcpy(bufend, "\"");
}
size_t cv_len = strlen(cv);
@@ -123,7 +123,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
if (closequote) {
bufend = stpcpy(bufend, "\"");
}
- showtype = showtype || closequote > TYPE_str ||
+ showtype = showtype ||
((isVarTypedef(mb, varid) ||
(flg & (LIST_MAL_REMOTE | LIST_MAL_TYPE))) &&
isVarConstant(mb, varid)) ||
(isaBatType(getVarType(mb, varid)) && idx <
p->retc);
diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -82,9 +82,9 @@ do_batstr_int(Client cntxt, MalBlkPtr mb
bool nils = false;
struct canditer ci1 = { 0 };
oid off1;
- bat *res = getArgReference_bat(stk, pci, 0),
- bid = *getArgReference_bat(stk, pci, 1),
- *sid1 = pci->argc == 3 ? getArgReference_bat(stk, pci, 2) :
NULL;
+ bat *res = getArgReference_bat(stk, pci, 0);
+ bat bid = *getArgReference_bat(stk, pci, 1);
+ bat sid = pci->argc == 3 ? *getArgReference_bat(stk, pci, 2) : 0;
(void) cntxt;
(void) mb;
@@ -93,7 +93,7 @@ do_batstr_int(Client cntxt, MalBlkPtr mb
SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto bailout;
}
- if (sid1 && !is_bat_nil(*sid1) && !(bs = BATdescriptor(*sid1))) {
+ if (!is_bat_nil(sid) && !(bs = BATdescriptor(sid))) {
msg = createException(MAL, name,
SQLSTATE(HY002)
RUNTIME_OBJECT_MISSING);
goto bailout;
diff --git a/monetdb5/modules/mal/calc.c b/monetdb5/modules/mal/calc.c
--- a/monetdb5/modules/mal/calc.c
+++ b/monetdb5/modules/mal/calc.c
@@ -570,7 +570,7 @@ CALCmin(Client cntxt, MalBlkPtr mb, MalS
if (t != getArgType(mb, pci, 2))
return mythrow(MAL, "calc.min", SEMANTIC_TYPE_MISMATCH);
nil = ATOMnilptr(t);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+ if (ATOMstorage(t) >= TYPE_str) {
p1 = *(ptr *) p1;
p2 = *(ptr *) p2;
}
@@ -596,7 +596,7 @@ CALCmin_no_nil(Client cntxt, MalBlkPtr m
if (t != getArgType(mb, pci, 2))
return mythrow(MAL, "calc.min", SEMANTIC_TYPE_MISMATCH);
nil = ATOMnilptr(t);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+ if (ATOMstorage(t) >= TYPE_str) {
p1 = *(ptr *) p1;
p2 = *(ptr *) p2;
}
@@ -608,7 +608,7 @@ CALCmin_no_nil(Client cntxt, MalBlkPtr m
if (t != getArgType(mb, pci, i))
return mythrow(MAL, "calc.min",
SEMANTIC_TYPE_MISMATCH);
ptr p2 = getArgReference(stk, pci, i);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str)
+ if (ATOMstorage(t) >= TYPE_str)
p2 = *(ptr *) p2;
if (ATOMeq(t, p1, nil) ||
(!ATOMeq(t, p2, nil) && ATOMcmp(t, p1, p2) > 0))
@@ -633,7 +633,7 @@ CALCmax(Client cntxt, MalBlkPtr mb, MalS
if (t != getArgType(mb, pci, 2))
return mythrow(MAL, "calc.max", SEMANTIC_TYPE_MISMATCH);
nil = ATOMnilptr(t);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+ if (ATOMstorage(t) >= TYPE_str) {
p1 = *(ptr *) p1;
p2 = *(ptr *) p2;
}
@@ -692,7 +692,7 @@ CALCmax_no_nil(Client cntxt, MalBlkPtr m
if (t != getArgType(mb, pci, 2))
return mythrow(MAL, "calc.max", SEMANTIC_TYPE_MISMATCH);
nil = ATOMnilptr(t);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+ if (ATOMstorage(t) >= TYPE_str) {
p1 = *(ptr *) p1;
p2 = *(ptr *) p2;
}
@@ -704,7 +704,7 @@ CALCmax_no_nil(Client cntxt, MalBlkPtr m
if (t != getArgType(mb, pci, i))
return mythrow(MAL, "calc.max",
SEMANTIC_TYPE_MISMATCH);
ptr p2 = getArgReference(stk, pci, i);
- if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str)
+ if (ATOMstorage(t) >= TYPE_str)
p2 = *(ptr *) p2;
if (ATOMeq(t, p1, nil) ||
(!ATOMeq(t, p2, nil) && ATOMcmp(t, p1, p2) < 0))
diff --git a/monetdb5/modules/mal/inspect.c b/monetdb5/modules/mal/inspect.c
--- a/monetdb5/modules/mal/inspect.c
+++ b/monetdb5/modules/mal/inspect.c
@@ -525,31 +525,6 @@ INSPECTgetDatabaseName(Client ctx, str *
}
static str
-INSPECTatom_sup_names(Client ctx, bat *ret)
-{
- (void) ctx;
- int i, k;
- BAT *b = COLnew(0, TYPE_str, 256, TRANSIENT);
-
- if (b == 0)
- throw(MAL, "inspect.getAtomSuper", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
-
- for (i = 0; i < GDKatomcnt; i++) {
- for (k = ATOMstorage(i); k > TYPE_str; k = ATOMstorage(k)) ;
- if (BUNappend(b, ATOMname(k), false) != GDK_SUCCEED)
- goto bailout;
- }
-
- *ret = b->batCacheid;
- BBPkeepref(b);
-
- return MAL_SUCCEED;
- bailout:
- BBPreclaim(b);
- throw(MAL, "inspect.getAtomSuper", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-}
-
-static str
INSPECTatom_sizes(Client ctx, bat *ret)
{
(void) ctx;
@@ -671,7 +646,6 @@ static mel_func inspect_init_funcs[] = {
pattern("inspect", "getType", INSPECTtypeName, false, "Return the concrete
type of a variable (expression).", args(1,2, arg("",str),argany("v",1))),
pattern("inspect", "equalType", INSPECTequalType, false, "Return true if both
operands are of the same type", args(1,3,
arg("",bit),argany("l",0),argany("r",0))),
command("inspect", "getAtomNames", INSPECTatom_names, false, "Collect a BAT
with the atom names.", args(1,1, batarg("",str))),
- command("inspect", "getAtomSuper", INSPECTatom_sup_names, false, "Collect a
BAT with the atom names.", args(1,1, batarg("",str))),
command("inspect", "getAtomSizes", INSPECTatom_sizes, false, "Collect a BAT
with the atom sizes.", args(1,1, batarg("",int))),
command("inspect", "getEnvironment", INSPECTgetEnvironment, false, "Collect
the environment variables.", args(2,2, batarg("k",str),batarg("v",str))),
command("inspect", "getEnvironment", INSPECTgetEnvironmentKey, false, "Get
the value of an environment variable", args(1,2, arg("",str),arg("k",str))),
diff --git a/monetdb5/optimizer/opt_pushselect.c
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -305,13 +305,13 @@ OPTpushselectImplementation(Client ctx,
int var = getArg(p, 1);
InstrPtr q = mb->stmt[vars[var]]; /*
BEWARE: the optimizer may not add or remove statements ! */
- if (q && isLikeOp(q) &&
!isaBatType(getArgType(mb, q, 2)) && isVarConstant(mb, getArg(q, 2)) && /*
pattern is a value */
+ if (q && isLikeOp(q) &&
!isaBatType(getArgType(mb, q, 2)) &&
+ isVarConstant(mb, getArg(q, 2)) &&
/* pattern is a value */
isVarConstant(mb, getArg(q, 3)) &&
/* escape is a value */
isVarConstant(mb, getArg(q, 4)) &&
/* isensitive flag is a value */
- getArg(q, 0) == getArg(p,
-
1)
+ getArg(q, 0) == getArg(p, 1)
/* the output variable from
batalgebra.like is the input one for [theta]select */
- ) {
+ ) {
int has_cand = (getArgType(mb, p, 2) ==
newBatType(TYPE_oid)),
offset = 0, anti =
(getFunctionId(q)[0] == 'n');
bit ignore_case = *(bit *)
getVarValue(mb, getArg(q, 4)),
diff --git a/sql/test/BugTracker-2026/Tests/7960-isLikeOp-crash.test
b/sql/test/BugTracker-2026/Tests/7960-isLikeOp-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7960-isLikeOp-crash.test
@@ -0,0 +1,18 @@
+statement error 42S02!SELECT: no such table 't1'
+SELECT log , COUNT ( * ) FROM t1 GROUP BY log
+ UNION
+SELECT log , n FROM t1 WHERE n = 7 ORDER BY COUNT ( * ) , log
+
+statement error 42000!syntax error, unexpected STRING in: "select null union
all select null union all select 1 union all select 2 as 'x'"
+SELECT NULL UNION ALL SELECT NULL UNION ALL SELECT 1 UNION ALL SELECT 2 AS 'x'
ORDER BY x
+
+statement error 22018!conversion of string to type bte failed.
+WITH RECURSIVE x ( x ) AS ( SELECT 1 UNION ALL SELECT x + 1 FROM x WHERE x < 8
) SELECT x FROM x WHERE x = '<your_schema_name>' AND x = '<your_table_name>'
AND x = 'YES'
+
+# next query crashes in isLikeOp (p=0x0) at
monetdb5/optimizer/opt_support.c:462 because p = 0x0
+# It is called from OPTpushselectImplementation (ctx=0x3a647510,
mb=0x7f6a6c2147f0, stk=0x0, pci=0x7f6a6c14bfd0) at
monetdb5/optimizer/opt_pushselect.c:308
+statement error 22018!conversion of string to type bte failed.
+SELECT x LIKE '%51%' FROM (
+WITH RECURSIVE x ( x ) AS ( SELECT 1 UNION ALL SELECT x + 1 FROM x WHERE x < 8
) SELECT x FROM x WHERE x = '<your_schema_name>' AND x = '<your_table_name>'
AND x = 'YES'
+) AS temp
+
diff --git a/sql/test/BugTracker-2026/Tests/7961-list_empty-crash.test
b/sql/test/BugTracker-2026/Tests/7961-list_empty-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7961-list_empty-crash.test
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]