Skip to content

Fix structure SQL statement splitting - #293

Open
ruslandoga wants to merge 1 commit into
masterfrom
rd/fix-structure-sql-splitting
Open

Fix structure SQL statement splitting#293
ruslandoga wants to merge 1 commit into
masterfrom
rd/fix-structure-sql-splitting

Conversation

@ruslandoga

Copy link
Copy Markdown
Collaborator

Structure loading previously split SQL at every semicolon, corrupting valid statements with semicolons inside string literals or comments. This replaces the naive split with a scanner that recognizes quoted values and identifiers, escaped or doubled quote characters, and line or block comments. It adds regression coverage that restores tables from statements containing a semicolon in a string default and in both comment styles.

Tested with mix test test/ecto/adapters/clickhouse/structure_test.exs (7 tests, 0 failures).

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.

1 participant