From 4c0d94bac11498da0394b4ad0bc70f8802ae11e3 Mon Sep 17 00:00:00 2001 From: Endi Caushi Date: Wed, 22 Jul 2020 16:20:16 +0000 Subject: [PATCH] Fix duplicate enum issue --- mysql_fdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql_fdw.c b/mysql_fdw.c index fbcb2e1..b8ccac4 100644 --- a/mysql_fdw.c +++ b/mysql_fdw.c @@ -1618,7 +1618,7 @@ mysqlImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid) " t.TABLE_NAME," " c.COLUMN_NAME," " CASE" - " WHEN c.DATA_TYPE = 'enum' THEN LOWER(CONCAT(c.COLUMN_NAME, '_t'))" + " WHEN c.DATA_TYPE = 'enum' THEN LOWER(CONCAT(t.TABLE_NAME, '_' , c.COLUMN_NAME, '_t'))" " WHEN c.DATA_TYPE = 'tinyint' THEN 'smallint'" " WHEN c.DATA_TYPE = 'mediumint' THEN 'integer'" " WHEN c.DATA_TYPE = 'tinyint unsigned' THEN 'smallint'"