Skip to content

fix: bind formatQuery params by position, not textual order#1056

Open
AntonOfTheWoods wants to merge 1 commit into
electric-sql:mainfrom
AntonOfTheWoods:fix/format-query-positional-params
Open

fix: bind formatQuery params by position, not textual order#1056
AntonOfTheWoods wants to merge 1 commit into
electric-sql:mainfrom
AntonOfTheWoods:fix/format-query-positional-params

Conversation

@AntonOfTheWoods

Copy link
Copy Markdown
Contributor

formatQuery rewrote $N placeholders as %NL, but format() reads a bare %NL as "min width N" and consumes arguments sequentially. Out-of-order placeholders therefore silently bound the wrong values (live.query and live.incrementalQuery inline params through this path), and a repeated placeholder failed with "too few arguments for format()". Emit the positional %N$L instead.

Fixes #1055

formatQuery rewrote $N placeholders as %NL, but format() reads a bare
%NL as "min width N" and consumes arguments sequentially. Out-of-order
placeholders therefore silently bound the wrong values (live.query and
live.incrementalQuery inline params through this path), and a repeated
placeholder failed with "too few arguments for format()". Emit the
positional %N$L instead.

Fixes electric-sql#1055

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: live.query silently binds positional params in textual order

1 participant