-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Incorrect SQL statements when creating a table with a dot in its…
… name (#1871) * fix: Incorrect SQL statements when creating a table with a dot in its name * test: fix Failing test createTableWithExplicitForeignKeyName4 The test failed because fallbackSeqName = null_id_seq. The reason tableName was null is that its declaration in the test was missing get(). * chore: add comment on Oracle exclusion in test * fix: Test failing when checking if table exists tester.exists() was returning false because of issues with processing the quoted table name that led to a mismatch * fix: testCreateTableWithQuotedIdentifiers fails In `String.metadataMatchesTable`, we should not use `table.tableNameWithoutSchemeSanitized` because "sanitization" in this case should be dialect-aware (aka we should be removing only what is considered a valid quote string in MySQL, which is the backtick). This means that if a table has double quotes (") in MySQL, they should not be removed when we compare it with the table name returned from the metadata, because the metadata (DatabaseMetaData.getTables method) returns it WITH the double quotes. If a name is quoted with backticks (`) instead, the metadata returns it WITHOUT backticks. For example: For table name "\"IdentifierTable\"", metadata returns -> "testdb."IdentifierTable"" For table name "`SomeNamespace.SomeTable`", metadata returns -> "testdb.SomeNamespace.SomeTable" * chore: add KDoc for tableNameWithoutSchemeSanitized * chore: add KDoc for tableNameWithoutScheme * chore: update KDoc for schemaName
- Loading branch information
Showing
4 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters