Skip to content

Refuse arrays of CASE and subquery results stored as BLOB - #193

Merged
LucaCappelletti94 merged 7 commits into
mainfrom
upstream/blob-operator-elements
Oct 30, 2026
Merged

LucaCappelletti94 merged 7 commits into
mainfrom
upstream/blob-operator-elements

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Collaborator

#181 typed an array element from a column, a cast, a literal or a call, so an element built by CASE or by a scalar subquery still reached SQLite. ARRAY[CASE WHEN id > 0 THEN b END], array_agg(CASE id WHEN 1 THEN u END) under UuidRepresentation::Blob, ARRAY[(SELECT b FROM t LIMIT 1)] and ARRAY[d.x] over a derived decode(...) AS x all translated and then failed with JSON cannot hold BLOB values.

A CASE now takes the common type of its results, the way PostgreSQL's select_common_type resolves it, through the same sql-traits rule ARRAY[...] already uses. A scalar subquery takes the type of its first output column, and a column a derived table or CTE defines by an expression is typed from that expression rather than only when it names another column.

sqlparser main now parses DROP FOREIGN TABLE as ObjectType::ForeignTable, which the drop match did not cover. It is dropped with a warning, like the CREATE FOREIGN TABLE that never reached the output.

@LucaCappelletti94 LucaCappelletti94 added the bug Something isn't working label Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LucaCappelletti94
LucaCappelletti94 merged commit 1300397 into main Oct 30, 2026
19 checks passed
@LucaCappelletti94
LucaCappelletti94 deleted the upstream/blob-operator-elements branch October 31, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant