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 Sep 9, 2020
1 parent 3af96b1 commit 32c7ee8
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 @@ -1699,7 +1699,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 32c7ee8

Please sign in to comment.