EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
523 stars 161 forks source link

Make IMPORT FOREIGN SCHEMA behave consistently with mixed-case table names #206

Open mhw opened 3 years ago

mhw commented 3 years ago

The case of the table names returned by information_schema queries depends on MySQL's lower_case_table_names setting: on systems where the value is non-zero the table name will be forced to lowercase. Importing tables with mixed-case names requires different SQL depending on the MySQL server's settings as explained in #202.

This PR fixes the issue by forcing a suitable collation so that the information_schema query is case insensitive when matching table names and preserves case in the results.

Fixes #202.

mkgrgis commented 1 year ago

This is very usefully PR. Some years ago there were the same problems in firebird_fdw and sqlite_fdw.

mkgrgis commented 1 year ago

@jeevanchalke, what about this IMPORT FOREIGN SCHEMA ISO SQL behaviour? Tests are also added.