Changeset: ee321f961263 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ee321f961263
Modified Files:
        monetdb5/optimizer/opt_pushselect.c
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

Fix for #7960. Add check on valid InstrPtr q.


diffs (31 lines):

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 (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/All 
b/sql/test/BugTracker-2026/Tests/All
--- a/sql/test/BugTracker-2026/Tests/All
+++ b/sql/test/BugTracker-2026/Tests/All
@@ -144,5 +144,5 @@ KNOWNFAIL?7955-rel_setop_get_statistics-
 KNOWNFAIL?7956-rel_remove_const_aggr-crash
 KNOWNFAIL?7957-tail_type-crash
 7959-double-function-destroy
-KNOWNFAIL?7960-isLikeOp-crash
+7960-isLikeOp-crash
 KNOWNFAIL?7961-list_empty-crash
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to