Skip to content

fix: double quoted string literals in migrator#183

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
ncruces:master
Mar 9, 2024
Merged

fix: double quoted string literals in migrator#183
jinzhu merged 1 commit intogo-gorm:masterfrom
ncruces:master

Conversation

@ncruces
Copy link
Contributor

@ncruces ncruces commented Feb 10, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Using %q is not appropriate to quote a string literal in RAW SQL. Double-quoted strings are considered a misfeature of SQLite, and advised to be disabled at compile time. Also, %q produces the wrong quoting: Hi "GORM"! is quoted as "Hi \"GORM\"!" not "Hi ""GORM""!", as SQLite would expect.

Current head fails GORM TestMigrateWithUniqueIndexAndUnique if SQLite is configured with SQLITE_DQS=0.

User Case Description

@jinzhu jinzhu merged commit 00ab012 into go-gorm:master Mar 9, 2024
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.

2 participants