diff --git a/redis_fdw.c b/redis_fdw.c index f9b5775..64b1d2b 100644 --- a/redis_fdw.c +++ b/redis_fdw.c @@ -1621,22 +1621,20 @@ redisGetQual(Node *node, TupleDesc tupdesc, char **key, char **value, bool *push if (IsA(right, Const)) { - StringInfoData buf; - - initStringInfo(&buf); + if (((Const *) right)->consttype == TEXTOID) { + /* And get the column and value... */ + *key = NameStr(TupleDescAttr(tupdesc, varattno - 1)->attname); + *value = TextDatumGetCString(((Const *) right)->constvalue); - /* And get the column and value... */ - *key = NameStr(TupleDescAttr(tupdesc, varattno - 1)->attname); - *value = TextDatumGetCString(((Const *) right)->constvalue); - - /* - * We can push down this qual if: - The operatory is TEXTEQ - The - * qual is on the key column - */ - if (op->opfuncid == PROCID_TEXTEQ && strcmp(*key, "key") == 0) - *pushdown = true; + /* + * We can push down this qual if: - The operatory is TEXTEQ - The + * qual is on the key column + */ + if (op->opfuncid == PROCID_TEXTEQ && strcmp(*key, "key") == 0) + *pushdown = true; - return; + return; + } } }