Bug #111143 Quoting of ints
Submitted: 24 May 2023 15:11 Modified: 26 May 2023 7:56
Reporter: Gabriel Gritsch Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:8.0.33, 5.7.42 OS:MacOS
Assigned to: CPU Architecture:ARM
Tags: INT, quote, SHOW CREATE TABLE

[24 May 2023 15:11] Gabriel Gritsch
Description:
"SHOW CREATE TABLE" quotes INT values.

How to repeat:
I create a test-table:

CREATE TABLE `test_table` (
  `test_col` INT NOT NULL DEFAULT 123
) ENGINE=INNODB;

Then I use the SHOW-command:

SHOW CREATE TABLE test_table;

But as result I get this:

CREATE TABLE `test_table` (
  `test_col` int NOT NULL DEFAULT '123'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci

Please look at the default-value.
It is enclosed in quotes. Why?

Same happens if I set sql_quote_show_create to OFF.

Have asked this also in Slack-community and first answer was that another one has the same issue.
So it may be a bug?

mariadb for example does not enclose the INT values in quotes.
[25 May 2023 8:21] MySQL Verification Team
Hello Gabriel Gritsch,

Thank you for the report and feedback.

regards,
Umesh
[25 May 2023 19:32] Roy Lyseng
Notice that sql_quote_show_create is about quoting of identifiers, not values.
Quoting of numeric values is unusual, but I do not know if it can be considered a bug.
[26 May 2023 7:56] Gabriel Gritsch
Yes correct, sql_quote_show_create should not change the behaviour but I mentioned it only as it was a setting with a close name that could change the behaviour.

INTeger values should NOT be quoted, whatever is set for sql_quote_show_create.