Skip to content

Quote schema identifiers during table creation - #22

Merged
beautifulentropy merged 1 commit into
letsencrypt:mainfrom
trailofbits:upstream/schema-identifier-quoting
Oct 2, 2026
Merged

beautifulentropy merged 1 commit into
letsencrypt:mainfrom
trailofbits:upstream/schema-identifier-quoting

Conversation

@akshithg

Copy link
Copy Markdown

Fix a schema-creation regression introduced by #17. That change quoted schema names in table references but left CREATE SCHEMA unquoted. For a schema named MixedCase, PostgreSQL creates the schema as mixedcase, then fails when the quoted table reference looks for MixedCase.

Apply Dialect.QuoteField to the schema name in TableMap.SqlForCreate so CREATE SCHEMA and the following CREATE TABLE use the same identifier semantics. This also escapes embedded identifier delimiters in CREATE SCHEMA, addressing a remaining gap related to #16.

Add regression cases for PostgreSQL double-quote escaping and MySQL backtick escaping. The regression fails before the fix and passes afterward.

Validation passed with Go 1.27.1: go test ./..., go test -race ./..., go vet ./..., go build ./..., and git diff --check. Database integration suites also passed against PostgreSQL 17, MariaDB 10.5, and SQLite on the same source tree. Additional review checks covered IF NOT EXISTS, repeated creation, and PostgreSQL LowercaseFields.

@akshithg
akshithg requested a review from a team as a code owner September 30, 2026 23:19
@akshithg
akshithg requested a review from aarongable September 30, 2026 23:19
@aarongable
aarongable requested a review from jsha October 1, 2026 18:19
@beautifulentropy
beautifulentropy merged commit 372e71d into letsencrypt:main Oct 2, 2026
5 checks passed
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.

3 participants