You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: LIMIT/OFFSET parameters named Column1/Column2 instead of Limit/Offset #4730
Other (main at 5daa2db, sqlc version: v1.31.1-105)
What happened?
Under the core analyzer (SQLCEXPERIMENT=coreanalyzer), LIMIT and OFFSET placeholders get no name. The generated params struct has Column1/Column2 instead of Limit/Offset. The default analyzer names them correctly.
The order of the arguments is correct on both paths. Only the names are lost, so the generated code still runs.
This is not limited to SQLite's LIMIT ?, ? form. LIMIT ? OFFSET ? is affected the same way on SQLite and MySQL. The existing select_limit/sqlite and select_limit/mysql end-to-end cases already fail in the core replay context:
SQLC_TEST_CORE=1 go test ./internal/endtoend -run 'TestReplay/core/select_limit/'
The comma form deserves its own coverage: in LIMIT x, y the first placeholder is the offset, so a fix that names placeholders by position would swap the two names there.
#4614 mentions this as a leftover. A naming attempt in the core was backed out there because it changed analyze output for SQLite and ClickHouse, which suggests the fix belongs in the compiler bridge rather than in the analysis.
Relevant log output
No response
Database schema
CREATETABLEfoo (a text);
SQL queries
/* name: FooLimitComma :many */SELECT a
FROM foo
LIMIT ?, ?;
Activity