Skip to content
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

Make MySQL JDBC driver strictly follow JDBC #19292

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static Properties getConnectionProperties(MySqlConfig mySqlConfig)
{
Properties connectionProperties = new Properties();
connectionProperties.setProperty("useInformationSchema", Boolean.toString(mySqlConfig.isDriverUseInformationSchema()));
connectionProperties.setProperty("pedantic", "true");
connectionProperties.setProperty("useUnicode", "true");
connectionProperties.setProperty("characterEncoding", "utf8");
connectionProperties.setProperty("tinyInt1isBit", "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,4 +627,22 @@ public void verifyMySqlJdbcDriverNegativeDateHandling()
}
}
}

@Test
public void testQuotedIdentifiers()
{
assertUpdate("""
CREATE TABLE tpch."`back``quoted`" ("`back``quoted`" BIGINT)""");
assertThat(computeActual("SHOW CREATE TABLE tpch.\"`back``quoted`\"").getOnlyValue())
.isEqualTo("""
CREATE TABLE mysql.tpch."`back``quoted`" (
"`back``quoted`" bigint
)""");

assertUpdate("INSERT INTO tpch.\"`back``quoted`\" VALUES (1)", 1);
assertThat(query("SELECT * FROM \"`back``quoted`\""))
.matches("VALUES (BIGINT '1')");

assertQuery("SHOW COLUMNS FROM tpch.\"`back``quoted`\"", "VALUES ('`back``quoted`', 'bigint', '', '')");
}
}
Loading