Skip to content

Fix SQLite Update query generation #4028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

compiledpanda
Copy link

@compiledpanda compiledpanda commented Jul 23, 2025

Purpose

Resolve the issue described in #3852 where update statements fail when generating queries. Note that this regression was introduced in 1.28.0 and is currently affecting the latest release (1.29.0).

Background

In commit 58b08ae the table names in sqlite queries were normalized (i.e. lower cased). In that commit a number of changes were made in the file internal/engine/sqlite/convert.go to lowercase tables names during query parsing so that the table names would always match the table names pulled from the schema even if the casing is different. The linked issue above exists because the table name in update statements was not included in the linked set of changes last year. In essence, if you used an uppercase table name in your update query (i.e. UPDATE MY_TABLE ...) it will not match the parsed table name which is currently being converted to lowercase (i.e. my_table).

Changes

  • Call the identifier() function in convertUpdate_stmtContext() so that tableName is properly cased before it is returned and used.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant