Skip to content

Commit

Permalink
Make IMPORT FOREIGN SCHEMA behave consistently
Browse files Browse the repository at this point in the history
The case of the table names returned by information_schema queries
depends on MySQL's `lower_case_table_names` setting.
https://dev.mysql.com/doc/refman/5.7/en/charset-collation-information-schema.html
suggests forcing a suitable collation to work around the issue.

Fixes #202.
  • Loading branch information
mhw committed Oct 26, 2021
1 parent 5cba7d8 commit 181ec7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysql_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@ mysqlImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
{
bool first_item = true;

appendStringInfoString(&buf, " AND t.TABLE_NAME ");
appendStringInfoString(&buf, " AND t.TABLE_NAME COLLATE UTF8_GENERAL_CI ");
if (stmt->list_type == FDW_IMPORT_SCHEMA_EXCEPT)
appendStringInfoString(&buf, "NOT ");
appendStringInfoString(&buf, "IN (");
Expand Down

0 comments on commit 181ec7a

Please sign in to comment.