-
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!: EXPOSED-150 Auto-quoted column names change case across databas…
…es (#1841) * fix!: EXPOSED-150 Auto-quoted column names change case across databases Column and table names that are reserved keywords are automatically quoted before being used in SQL statements. Databases that support upper case folding (H2, Oracle) quote and upper case the identifiers, so attempting to use the tables across different databases fails. This fix ensures any reserved keywords used as identifiers are only quoted, so they now retain whatever case the user provides them in, but it will be equivalent across databases. This broke some tests that checked for index name, as names like TABLE_column_IDX, were being created in those databases. This was avoided by pulling inProperCase() out of the buildString until the end of the name creation. BREAKING CHANGE: [H2, Oracle] Reserved words will be treated as quoted identifiers and no longer have their case automatically changed to upper case. * fix!: EXPOSED-150 Auto-quoted column names change case across databases Change table name of tests failing in Oracle due to using a quoted identifier. These tests fail because of a JDBC driver bug specific to quoted table identifiers beign used with an insert statement and preparedStatement(). Upgrading the driver version to at least 21.1.0.0 resolves the issue but causes other failures (namely batch insert / DML Returning errors). This will be investigated for the future, but for now the tables are no longer named using reserved keywords. * fix!: EXPOSED-150 Auto-quoted column names change case across databases Add IdentifierManager cache for identities that have been checked against the keywords list. * fix!: EXPOSED-150 Auto-quoted column names change case across databases Add global flag, preserveKeywordCasing, to DatabaseConfig to allow opt-out from new behavior. Log warnings if table is created using identifiers that are in keywords list. Restrict opt-in test to H2 for proper Database connection and configuration. * fix!: EXPOSED-150 Auto-quoted column names change case across databases Switch preserveKeywordCasing flag to have @OptIn and be false by default. Adjust internal and private functions accordingly. Adjust unit tests to test for when flag is opted-in. Logged warnings only happen if keyword is identified and flag is not opted-in. * fix!: EXPOSED-150 Auto-quoted column names change case across databases Revert changed unit tests to use old behavior since flag set to false as default.
- Loading branch information
Showing
11 changed files
with
231 additions
and
26 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
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
Oops, something went wrong.