-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove hard-coded collation in JDBC adapter #1518
Conversation
steps: | ||
- name: Run MySQL 5.7 | ||
run: | | ||
docker run -e MYSQL_ROOT_PASSWORD=mysql -p 3306:3306 -d mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we need to run MySQL with the collation-related parameters, we run docker run
command here.
@@ -607,6 +595,7 @@ jobs: | |||
MSSQL_PID: "Express" | |||
SA_PASSWORD: "SqlServer17" | |||
ACCEPT_EULA: "Y" | |||
MSSQL_COLLATION: "Japanese_BIN2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for SQL Server, we set MSSQL_COLLATION
for the collation.
return new String[] { | ||
"CREATE SCHEMA " + enclose(fullSchema) + " character set utf8 COLLATE utf8_bin" | ||
}; | ||
return new String[] {"CREATE SCHEMA " + enclose(fullSchema)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the hard-coded collation for MySQL.
return new String[] { | ||
"CREATE SCHEMA IF NOT EXISTS " + enclose(schema) + " character set utf8 COLLATE utf8_bin" | ||
}; | ||
return new String[] {"CREATE SCHEMA IF NOT EXISTS " + enclose(schema)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
@@ -176,7 +176,7 @@ public String getDataTypeForEngine(DataType scalarDbDataType) { | |||
case INT: | |||
return "INT"; | |||
case TEXT: | |||
return "VARCHAR(8000) COLLATE Latin1_General_BIN"; | |||
return "VARCHAR(8000)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the hard-coded collation for SQL Server.
import org.junit.jupiter.api.TestInstance; | ||
|
||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
public abstract class DistributedStorageJapaneseIntegrationTestBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an integration test for Japanese.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
@kota2and3kan As discussed, I've added an integration test for Japanese Hankaku in f670592. Please take a look when you have time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
Description
Currently, in the JDBC adapter, we use a hard-coded collation for SQL Server when creating tables. However, we've encountered an issue where Japanese cannot be used with the hard-coded collation in SQL Server. To resolve this, this PR removes the hard-coded collation for SQL Server. For consistency, it also eliminates the hard-coded collation for MySQL. As a result, the collation configured in the database will be used when creating tables.
Related issues and/or PRs
N/A
Changes made
Checklist
Additional notes (optional)
N/A
Release notes
Removed the hard-coded collation for MySQL and SQL Server in the JDBC adapter. As a result, the collation configured in the underlying database will be used when creating tables.