Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Table names needing quotes are not handled correctly in mysqlctl schema manager #13311

Closed
dbussink opened this issue Jun 13, 2023 · 0 comments · Fixed by #13312
Closed

Comments

@dbussink
Copy link
Contributor

Overview of the Issue

When you have a table that contains for example a ' in the name itself (yes, that's possible, you can put almost anything in a table name), the mysqlctl schema manager doesn't properly inspect this table. Specifically mysqlctl.GetColumns fails.

Reproduction Steps

Create a table with a quote:

mysql> create table `with ' quote` (i int);
Query OK, 0 rows affected (0.03 sec)

Use mysqlctl.GetColumns and see the error.

Binary Version

All supported versions including main

Operating System and Environment details

-

Log Fragments

Error transitioning to the desired state: REPLICA, Serving, will keep retrying: in Engine.reload(), reading table SHOW TABLES LIKE 'with : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'quote
                ORDER BY ORDINAL_POSITION' at line 3 (errno 1064) (sqlstate 42000) during query: SELECT COLUMN_NAME as column_name
                FROM INFORMATION_SCHEMA.COLUMNS
                WHERE TABLE_SCHEMA = 'some-db' AND TABLE_NAME = 'with ' quote
                ORDER BY ORDINAL_POSITION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant