-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: master
Are you sure you want to change the base?
Conversation
let's see what blows up and then see if we can add a test for the problematic identifiers. |
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.
thank you!
i searched MariaDB docs for same property, but didn't find it.
Didn't check the code though.
Didn't check other MySQL-alike, the Singlestore
I think we could test cover this, using table names with backticks. |
70d4f19
to
8e85b0f
Compare
pedantic configuration property changes the MySQL JDBC driver to more strictly follow the JDBC specification. The one behaviour we're most interested in is handling of quoted identifiers. Without this property if an identifier like `ab``c` is left as it is instead of being properly quoted like ```ab````c```.
doesn't matter with or without While trying to add a test however I noticed a different bug which I've reported to MySQL folks - it's a bug in their driver.
So if your MySQL has a table named like that Trino will always think it doesn't exist since we use Follow along at https://bugs.mysql.com/bug.php?id=116113 |
Here's the test I used to find this: @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', '', '')");
} |
8e85b0f
to
96e01ad
Compare
pedantic configuration property changes the MySQL JDBC driver to more strictly follow the JDBC specification.
The one behaviour we're most interested in is handling of quoted identifiers. Without this property if an identifier like
ab``c
is left as it is instead of being properly quoted likeab````c
.Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
FYI @findepi