Skip to content

Refuse arrays whose elements are stored as BLOB - #173

Merged
LucaCappelletti94 merged 1 commit into
mainfrom
upstream/blob-element-arrays
Oct 28, 2026
Merged

LucaCappelletti94 merged 1 commit into
mainfrom
upstream/blob-element-arrays

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Collaborator

Under ArrayRepresentation::Json the replica builds every array with json_array or json_group_array over the translated elements, and SQLite refuses a BLOB argument to both with JSON cannot hold BLOB values. A BYTEA[] column, a UUID[] column under UuidRepresentation::Blob or a vector(n)[] column translated without complaint and then failed on the first write of a non-empty array, and ARRAY[b] or array_agg(u) over such columns failed on the first row.

An array type is now refused when its element type translates to BLOB, in the same place NUMERIC(p,s)[] is refused, which covers column declarations and casts. The ARRAY[...] constructor, array_agg, array_append, array_prepend, || with a lone element and the replacement value of array_replace refuse an element whose declared or cast type is stored as a BLOB, with the same message. A function returning a BLOB is not typed here and still fails in SQLite. UUID[] under UuidRepresentation::Text keeps working.

json_agg, json_build_array and the other JSON functions hit the same SQLite error over BLOB columns, but PostgreSQL gives them a text answer, so they need a translation and are out of scope here. The commit also drops REVOKE role FROM role like GRANT role TO role, since sqlparser main now parses it as its own RevokeRole statement. It builds against connetto-rs/sql-traits#172, which sqlparser main needs as well.

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

codecov Bot commented Oct 28, 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 fcc260b into main Oct 28, 2026
21 checks passed
@LucaCappelletti94
LucaCappelletti94 deleted the upstream/blob-element-arrays 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