Add a blob IN filter pushdown test (depends on database-connector#25)#534
Merged
staticlibs merged 1 commit intoJul 25, 2026
Merged
Conversation
The COMPARE_IN branch of FilterPushdown::TransformExpression serialized its constants with identifier_config, whose blob_literal_prefix and blob_literal_suffix are empty. QueryWriter::EncodeBlob appends the closing quote unconditionally, so a blob IN list came out as "blob_col" IN (6470666B67', 6F74686572') and Postgres rejected it with 'trailing junk after numeric literal'. The equality path already used constant_config via TransformConstantFilter, so only IN lists were affected.
staticlibs
approved these changes
Jul 25, 2026
staticlibs
left a comment
Member
There was a problem hiding this comment.
Thanks for adding the test!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The SQL-level regression test for the blob
INpushdown bug. The fix itself is one line in thedatabase-connectorsubmodule (duckdb/database-connector#25); only the test belongs in this repo.The bug
FilterPushdown::TransformExpressionserialisesCOMPARE_INconstants withidentifier_config, whose blob literal prefix and suffix are empty, whileEncodeBlobappends the closing quote unconditionally. With this repo's configuration ('\xprefix and::BYTEAsuffix, set insrc/postgres_filter_pushdown.cpp:37) a blobINlist is emitted as:Postgres rejects it with
trailing junk after numeric literal, soWHERE blob_col IN (...)against an attached table fails outright. The=path was never affected — it already usedconstant_config.The test
test/sql/storage/filter_pushdown_blob_in.testruns blobIN/NOT INfilters against an attached Postgres table, including a six element list (the binder is more likely to keep a longer list as aCOMPARE_INrather than rewriting it to anORchain) and blobs containing quote and backslash bytes. With the bug present these fail with the Postgres syntax error rather than returning wrong rows.To land
database-connectorsubmodule pointer on this branch