Skip to content

Commit 3af96b1

Browse files
committed
Test case for issue 202
1 parent 8912bbb commit 3af96b1

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

expected/select.out

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,17 @@ SELECT * FROM enum_t1 ORDER BY id;
944944
(3 rows)
945945

946946
DROP FOREIGN TABLE enum_t1;
947+
-- Issue #202 - correct handling of mixed-case table names.
948+
IMPORT FOREIGN SCHEMA mysql_fdw_regress LIMIT TO ("mixedCaseTable") FROM SERVER mysql_svr INTO public;
949+
SELECT * FROM "mixedCaseTable" ORDER BY id;
950+
id | mixedCaseColumn
951+
----+-----------------
952+
1 | small
953+
2 | medium
954+
3 | large
955+
(3 rows)
956+
957+
DROP FOREIGN TABLE "mixedCaseTable";
947958
-- Cleanup
948959
DROP TABLE l_test_tbl1;
949960
DROP TABLE l_test_tbl2;

mysql_init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e
2929
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress1 -e "DROP TABLE IF EXISTS student;"
3030
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress1 -e "DROP TABLE IF EXISTS numbers;"
3131
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "DROP TABLE IF EXISTS enum_t1;"
32+
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "DROP TABLE IF EXISTS mixedCaseTable;"
3233

3334
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "CREATE TABLE mysql_test(a int primary key, b int);"
3435
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "INSERT INTO mysql_test(a,b) VALUES (1,1);"
@@ -40,3 +41,5 @@ mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress1 -e
4041
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress1 -e "CREATE TABLE numbers (a int, b varchar(255));"
4142
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "CREATE TABLE enum_t1 (id int PRIMARY KEY, size ENUM('small', 'medium', 'large'));"
4243
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "INSERT INTO enum_t1 VALUES (1, 'small'),(2, 'medium'),(3, 'medium');"
44+
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "CREATE TABLE mixedCaseTable (id int PRIMARY KEY, mixedCaseColumn text);"
45+
mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D mysql_fdw_regress -e "INSERT INTO mixedCaseTable VALUES (1, 'small'),(2, 'medium'),(3, 'large');"

sql/select.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ IMPORT FOREIGN SCHEMA mysql_fdw_regress LIMIT TO (enum_t1) FROM SERVER mysql_svr
237237
SELECT * FROM enum_t1 ORDER BY id;
238238
DROP FOREIGN TABLE enum_t1;
239239

240+
-- Issue #202 - correct handling of mixed-case table names.
241+
IMPORT FOREIGN SCHEMA mysql_fdw_regress LIMIT TO ("mixedCaseTable") FROM SERVER mysql_svr INTO public;
242+
SELECT * FROM "mixedCaseTable" ORDER BY id;
243+
DROP FOREIGN TABLE "mixedCaseTable";
244+
240245
-- Cleanup
241246
DROP TABLE l_test_tbl1;
242247
DROP TABLE l_test_tbl2;

0 commit comments

Comments
 (0)