Bug #116113 | DatabaseMetaData#getTables doesn't work properly for delimited identifiers | ||
---|---|---|---|
Submitted: | 15 Sep 2024 17:45 | Modified: | 15 Jan 15:59 |
Reporter: | Ashhar Hasan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 9.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[15 Sep 2024 17:45]
Ashhar Hasan
[16 Sep 2024 9:20]
MySQL Verification Team
Hello Ashhar Hasan, Thank you for the report and feedback. regards, Umesh
[19 Sep 2024 16:34]
Axyoan Marcelo
Posted by developer: Hello Ashhar, The tableNamePattern argument you are passing to getTables should be ```back````quoted```. The server treats `tableName`, the same as tablename, so we need a way to make them equivalent, meaning that Connector/J has to first unquote the tableName. There actually exists bug here, it lies in getColumns, as it is not unquoting the tableNamePattern given. Thank you for your report.
[8 Nov 2024 19:18]
Filipe Silva
Hi Ashhar, Axyoan's explanation is true for default mode (pedantic=false), however, you are right with regard to the expected results when "pedantic=true". Several metadata methods are currently handling quoted identifiers differently. They shall all be readjusted.
[19 Dec 2024 0:42]
Daniel So
Posted by developer: Added the following entry to the C/J 9.2.0 changelog: "Behaviors of a few of the DatabaseMetaData methods were inconsistent when handling parameters of identifiers quoted with backticks (`). With this patch, identifiers quoted by backticks are always unquoted when the connection is in non-pedantic mode, but they are always taken as-is (with the backticks escaped as parts of the identifier) when the connection is in pedantic mode."