Skip to content

Commit

Permalink
Fix CorrectWrongCharacterEncodingPatch applying to non Plan tables in…
Browse files Browse the repository at this point in the history
… same database
  • Loading branch information
AuroraLS3 committed Jul 1, 2024
1 parent ac74d3c commit 511b41e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public Query<List<String>> getBadTableCorrectionQueries() {
String selectTablesWithWrongCharset = "SELECT CONCAT('ALTER TABLE `', table_name, '` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;')\n" +
"FROM information_schema.TABLES AS T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` AS C\n" +
"WHERE C.collation_name = T.table_collation\n" +
"AND T.table_name LIKE 'plan\\_%'\n" +
"AND T.table_schema = '" + databaseName + "'\n" +
"AND\n" +
"(\n" +
Expand All @@ -74,6 +75,7 @@ public Query<List<String>> getBadTableCorrectionQueries() {
String selectColumnsWithWrongCharset = "SELECT CONCAT('ALTER TABLE `', table_name, '` MODIFY `', column_name, '` ', DATA_TYPE, '(', CHARACTER_MAXIMUM_LENGTH, ') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci', (CASE WHEN IS_NULLABLE = 'NO' THEN ' NOT NULL' ELSE '' END), ';')\n" +
"FROM information_schema.COLUMNS \n" +
"WHERE TABLE_SCHEMA = '" + databaseName + "'\n" +
"AND table_name LIKE 'plan\\_%'\n" +
"AND DATA_TYPE = 'varchar'\n" +
"AND\n" +
"(\n" +
Expand Down

0 comments on commit 511b41e

Please sign in to comment.