Skip to content

Reuse repeated variable bindings for numbered placeholders - #1559

Merged
lovasoa merged 4 commits into
mainfrom
codex/reuse-variable-bindings-1558
Oct 23, 2026
Merged

lovasoa merged 4 commits into
mainfrom
codex/reuse-variable-bindings-1558

Conversation

@lovasoa

@lovasoa lovasoa commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Repeated variables now share a prepared parameter on native SQL Server, PostgreSQL, and SQLite connections. The SQL Server reproducer uses @p1 in both SELECT and GROUP BY and returns (0, 2), (1, 2), and (2, 2).

Reuse is scoped to one statement and keyed by the variable's name and lookup source. Function calls remain independent, and MySQL/ODBC positional placeholders keep one argument per occurrence. Regression coverage checks generated SQL, binding order, distinct lookup sources, SET changes including NULL, and live SQL Server grouping. Updated the unreleased changelog.

Chart documentation browser tests now wait for all charts to initialize before checking their output. The loading assertion checks every placeholder, avoiding an ambiguous multi-element locator.

Validation:

  • Full cargo test on SQLite, SQL Server, PostgreSQL, and MySQL: 248 unit tests and 87 integration tests passed on each.
  • All 148 Playwright tests passed locally using the CI-built Linux binary.
  • npm test (82 tests), npm run build
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings

Fixes #1558.

@lovasoa
lovasoa enabled auto-merge October 23, 2026 14:20
@lovasoa
lovasoa added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 52ddf3e Oct 23, 2026
20 checks passed
@lovasoa
lovasoa deleted the codex/reuse-variable-bindings-1558 branch October 23, 2026 20:51
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.

SQL Server: the same variable used in SELECT and GROUP BY is bound as two different parameters, so the query fails (regression in 0.46/0.47)

1 participant