Skip to content

Commit 019c9e0

Browse files
committed
Fix assert error for where clause with UDF's
was fixed in HA_CONNECT::CondFilter moving res= pval->val_str(&tmp) but this was wrong. Now res is only used for strings. modified: storage/connect/ha_connect.cc
1 parent e939ea5 commit 019c9e0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

storage/connect/ha_connect.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,9 +2486,10 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
24862486
if (!i && (ismul))
24872487
return NULL;
24882488

2489-
switch (args[i]->real_type()) {
2489+
switch (args[i]->real_type()) {
24902490
case COND::STRING_ITEM:
2491-
pp->Value= PlugSubAllocStr(g, NULL, res->ptr(), res->length());
2491+
res= pval->val_str(&tmp);
2492+
pp->Value= PlugSubAllocStr(g, NULL, res->ptr(), res->length());
24922493
pp->Type= (pp->Value) ? TYPE_STRING : TYPE_ERROR;
24932494
break;
24942495
case COND::INT_ITEM:
@@ -2517,12 +2518,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
25172518
return NULL;
25182519
} // endswitch type
25192520

2520-
// This was moved because cannot be done for FUNC_ITEM
2521-
if ((res= pval->val_str(&tmp)) == NULL)
2522-
return NULL; // To be clarified
2523-
25242521
if (trace)
2525-
htrc("Value=%.*s\n", res->length(), res->ptr());
2522+
htrc("Value type=%hd\n", pp->Type);
25262523

25272524
// Append the value to the argument list
25282525
if (pprec)

0 commit comments

Comments
 (0)