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

SHOW CREATE TABLE doesn't properly escape quotes in comments #8509

Open
fulghum opened this issue Oct 30, 2024 · 0 comments
Open

SHOW CREATE TABLE doesn't properly escape quotes in comments #8509

fulghum opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fulghum
Copy link
Contributor

fulghum commented Oct 30, 2024

When generating a CREATE TABLE statement for a table that contains comments, quotes in the comments are not properly escaped, resulting in a CREATE TABLE statement that can't be executed.

Repro:

create table t (pk int comment 'this, it''s the way to go');
Query OK, 0 rows affected (0.02 sec)

show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                      |
+-------+-----------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `pk` int COMMENT 'this, it's the way to go'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+-------+-----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@fulghum fulghum added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant