Changeset: 28f97fa58f04 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/28f97fa58f04
Modified Files:
        monetdb5/optimizer/opt_dict.c
Branch: Jan2022
Log Message:

Do a more defensive candidate list presence check


diffs (31 lines):

diff --git a/monetdb5/optimizer/opt_dict.c b/monetdb5/optimizer/opt_dict.c
--- a/monetdb5/optimizer/opt_dict.c
+++ b/monetdb5/optimizer/opt_dict.c
@@ -153,12 +153,12 @@ OPTdictImplementation(Client cntxt, MalB
                                                 * tp2 = batcalc.bte/sht/int(tp)
                                                 * pos = intersect(o, tp2, 
cand, nil) */
 
-                                               int cand = getArg(p, j+1);
+                                               int has_cand = getArgType(mb, 
p, 2) == newBatType(TYPE_oid);
                                                InstrPtr r = copyInstruction(p);
                                                getArg(r, 0) = 
newTmpVariable(mb, newBatType(TYPE_oid));
                                                getArg(r, j) = vardictvalue[k];
-                                               if (cand)
-                                                       r = ReplaceWithNil(mb, 
r, j+1, TYPE_bat); /* no candidate list */
+                                               if (has_cand)
+                                                       r = ReplaceWithNil(mb, 
r, 2, TYPE_bat); /* no candidate list */
                                                pushInstruction(mb,r);
 
                                                int tpe = getVarType(mb, 
varisdict[k]);
@@ -171,7 +171,10 @@ OPTdictImplementation(Client cntxt, MalB
                                                getArg(t, 0) = getArg(p, 0);
                                                addArgument(mb, t, 
varisdict[k]);
                                                addArgument(mb, t, getArg(s, 
0));
-                                               addArgument(mb, t, cand);
+                                               if (has_cand)
+                                                       t = addArgument(mb, t, 
getArg(p, 2));
+                                               else
+                                                       t = pushNil(mb, t, 
TYPE_bat);
                                                t = pushNil(mb, t, TYPE_bat);
                                                t = pushBit(mb, t, TRUE);    /* 
nil matches */
                                                t = pushBit(mb, t, TRUE);     
/* max_one */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to