Skip to content

Commit 6820bf9

Browse files
committed
do not quote numbers in the DEFAULT clause in SHOW CREATE
1 parent c5c9128 commit 6820bf9

File tree

103 files changed

+4256
-4252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4256
-4252
lines changed

mysql-test/r/alter_table.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS
15041504
SHOW CREATE TABLE t1;
15051505
Table Create Table
15061506
t1 CREATE TABLE `t1` (
1507-
`transaction_id` int(11) NOT NULL DEFAULT '0',
1507+
`transaction_id` int(11) NOT NULL DEFAULT 0,
15081508
PRIMARY KEY (`transaction_id`)
15091509
) ENGINE=MyISAM DEFAULT CHARSET=latin1
15101510
DROP TABLE t1;

mysql-test/r/alter_table_mdev539_maria.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ drop index `primary` on lineitem;
1010
show create table lineitem;
1111
Table Create Table
1212
lineitem CREATE TABLE `lineitem` (
13-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
13+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
1414
`l_partkey` int(11) DEFAULT NULL,
1515
`l_suppkey` int(11) DEFAULT NULL,
16-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
16+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
1717
`l_quantity` double DEFAULT NULL,
1818
`l_extendedprice` double DEFAULT NULL,
1919
`l_discount` double DEFAULT NULL,
@@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
3939
show create table lineitem;
4040
Table Create Table
4141
lineitem CREATE TABLE `lineitem` (
42-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
42+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
4343
`l_partkey` int(11) DEFAULT NULL,
4444
`l_suppkey` int(11) DEFAULT NULL,
45-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
45+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
4646
`l_quantity` double DEFAULT NULL,
4747
`l_extendedprice` double DEFAULT NULL,
4848
`l_discount` double DEFAULT NULL,
@@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
8080
show create table lineitem;
8181
Table Create Table
8282
lineitem CREATE TABLE `lineitem` (
83-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
83+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
8484
`l_partkey` int(11) DEFAULT NULL,
8585
`l_suppkey` int(11) DEFAULT NULL,
86-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
86+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
8787
`l_quantity` double DEFAULT NULL,
8888
`l_extendedprice` double DEFAULT NULL,
8989
`l_discount` double DEFAULT NULL,
@@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
114114
show create table lineitem;
115115
Table Create Table
116116
lineitem CREATE TABLE `lineitem` (
117-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
117+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
118118
`l_partkey` int(11) DEFAULT NULL,
119119
`l_suppkey` int(11) DEFAULT NULL,
120-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
120+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
121121
`l_quantity` double DEFAULT NULL,
122122
`l_extendedprice` double DEFAULT NULL,
123123
`l_discount` double DEFAULT NULL,

mysql-test/r/alter_table_mdev539_myisam.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ drop index `primary` on lineitem;
1010
show create table lineitem;
1111
Table Create Table
1212
lineitem CREATE TABLE `lineitem` (
13-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
13+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
1414
`l_partkey` int(11) DEFAULT NULL,
1515
`l_suppkey` int(11) DEFAULT NULL,
16-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
16+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
1717
`l_quantity` double DEFAULT NULL,
1818
`l_extendedprice` double DEFAULT NULL,
1919
`l_discount` double DEFAULT NULL,
@@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
3939
show create table lineitem;
4040
Table Create Table
4141
lineitem CREATE TABLE `lineitem` (
42-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
42+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
4343
`l_partkey` int(11) DEFAULT NULL,
4444
`l_suppkey` int(11) DEFAULT NULL,
45-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
45+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
4646
`l_quantity` double DEFAULT NULL,
4747
`l_extendedprice` double DEFAULT NULL,
4848
`l_discount` double DEFAULT NULL,
@@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
8080
show create table lineitem;
8181
Table Create Table
8282
lineitem CREATE TABLE `lineitem` (
83-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
83+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
8484
`l_partkey` int(11) DEFAULT NULL,
8585
`l_suppkey` int(11) DEFAULT NULL,
86-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
86+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
8787
`l_quantity` double DEFAULT NULL,
8888
`l_extendedprice` double DEFAULT NULL,
8989
`l_discount` double DEFAULT NULL,
@@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
114114
show create table lineitem;
115115
Table Create Table
116116
lineitem CREATE TABLE `lineitem` (
117-
`l_orderkey` int(11) NOT NULL DEFAULT '0',
117+
`l_orderkey` int(11) NOT NULL DEFAULT 0,
118118
`l_partkey` int(11) DEFAULT NULL,
119119
`l_suppkey` int(11) DEFAULT NULL,
120-
`l_linenumber` int(11) NOT NULL DEFAULT '0',
120+
`l_linenumber` int(11) NOT NULL DEFAULT 0,
121121
`l_quantity` double DEFAULT NULL,
122122
`l_extendedprice` double DEFAULT NULL,
123123
`l_discount` double DEFAULT NULL,

mysql-test/r/bug46760.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ info: Records: 0 Duplicates: 0 Warnings: 0
1818
SHOW CREATE TABLE t1;
1919
Table Create Table
2020
t1 CREATE TABLE `t1` (
21-
`a` int(11) DEFAULT '10'
21+
`a` int(11) DEFAULT 10
2222
) ENGINE=InnoDB DEFAULT CHARSET=latin1
2323
DROP TABLE t1;
2424
#

mysql-test/r/check_constraint.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Table Create Table
5454
t1 CREATE TABLE `t1` (
5555
`a` int(11) DEFAULT NULL CHECK (a>10),
5656
`b` int(11) DEFAULT NULL CHECK (b > 20),
57-
`c` int(11) DEFAULT '0' CHECK (c < 10),
57+
`c` int(11) DEFAULT 0 CHECK (c < 10),
5858
CONSTRAINT `min` CHECK (a+b > 100),
5959
CONSTRAINT `max` CHECK (a+b <500),
6060
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
@@ -77,7 +77,7 @@ Table Create Table
7777
t2 CREATE TABLE `t2` (
7878
`a` int(11) DEFAULT NULL CHECK (a>10),
7979
`b` int(11) DEFAULT NULL CHECK (b > 20),
80-
`c` int(11) DEFAULT '0' CHECK (c < 10),
80+
`c` int(11) DEFAULT 0 CHECK (c < 10),
8181
CONSTRAINT `min` CHECK (a+b > 100),
8282
CONSTRAINT `max` CHECK (a+b <500),
8383
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
@@ -93,7 +93,7 @@ Table Create Table
9393
t2 CREATE TABLE `t2` (
9494
`a` int(11) DEFAULT NULL CHECK (a>10),
9595
`b` int(11) DEFAULT NULL CHECK (b > 20),
96-
`c` int(11) DEFAULT '0' CHECK (c < 10),
96+
`c` int(11) DEFAULT 0 CHECK (c < 10),
9797
CONSTRAINT `max` CHECK (a+b <500),
9898
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
9999
) ENGINE=MyISAM DEFAULT CHARSET=latin1

mysql-test/r/create-uca.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COLLATE latin1_bin;
1010
SHOW CREATE TABLE t1;
1111
Table Create Table
1212
t1 CREATE TABLE `t1` (
13-
`c1` int(11) DEFAULT '12' COMMENT 'column1',
13+
`c1` int(11) DEFAULT 12 COMMENT 'column1',
1414
`c2` int(11) DEFAULT NULL COMMENT 'column2',
1515
`c3` int(11) NOT NULL COMMENT 'column3',
1616
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
@@ -21,7 +21,7 @@ CREATE TABLE t2 AS SELECT * FROM t1;
2121
SHOW CREATE TABLE t2;
2222
Table Create Table
2323
t2 CREATE TABLE `t2` (
24-
`c1` int(11) DEFAULT '12' COMMENT 'column1',
24+
`c1` int(11) DEFAULT 12 COMMENT 'column1',
2525
`c2` int(11) DEFAULT NULL COMMENT 'column2',
2626
`c3` int(11) NOT NULL COMMENT 'column3',
2727
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',

mysql-test/r/create.result

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,8 @@ select a1,a2 from t1;
803803
show create table t2;
804804
Table Create Table
805805
t2 CREATE TABLE `t2` (
806-
`a` int(11) DEFAULT '3',
807-
`b` int(11) DEFAULT '3',
806+
`a` int(11) DEFAULT 3,
807+
`b` int(11) DEFAULT 3,
808808
`a1` int(11) DEFAULT NULL,
809809
`a2` int(11) DEFAULT NULL
810810
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -1133,46 +1133,46 @@ create table t1 like information_schema.processlist;
11331133
show create table t1;
11341134
Table Create Table
11351135
t1 CREATE TABLE `t1` (
1136-
`ID` bigint(4) NOT NULL DEFAULT '0',
1136+
`ID` bigint(4) NOT NULL DEFAULT 0,
11371137
`USER` varchar(128) NOT NULL DEFAULT '',
11381138
`HOST` varchar(64) NOT NULL DEFAULT '',
11391139
`DB` varchar(64) DEFAULT NULL,
11401140
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1141-
`TIME` int(7) NOT NULL DEFAULT '0',
1141+
`TIME` int(7) NOT NULL DEFAULT 0,
11421142
`STATE` varchar(64) DEFAULT NULL,
11431143
`INFO` longtext DEFAULT NULL,
1144-
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
1145-
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
1146-
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
1147-
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
1148-
`MEMORY_USED` bigint(7) NOT NULL DEFAULT '0',
1149-
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
1150-
`QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
1144+
`TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000,
1145+
`STAGE` tinyint(2) NOT NULL DEFAULT 0,
1146+
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
1147+
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
1148+
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
1149+
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
1150+
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
11511151
`INFO_BINARY` blob DEFAULT NULL,
1152-
`TID` bigint(4) NOT NULL DEFAULT '0'
1152+
`TID` bigint(4) NOT NULL DEFAULT 0
11531153
) DEFAULT CHARSET=utf8
11541154
drop table t1;
11551155
create temporary table t1 like information_schema.processlist;
11561156
show create table t1;
11571157
Table Create Table
11581158
t1 CREATE TEMPORARY TABLE `t1` (
1159-
`ID` bigint(4) NOT NULL DEFAULT '0',
1159+
`ID` bigint(4) NOT NULL DEFAULT 0,
11601160
`USER` varchar(128) NOT NULL DEFAULT '',
11611161
`HOST` varchar(64) NOT NULL DEFAULT '',
11621162
`DB` varchar(64) DEFAULT NULL,
11631163
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1164-
`TIME` int(7) NOT NULL DEFAULT '0',
1164+
`TIME` int(7) NOT NULL DEFAULT 0,
11651165
`STATE` varchar(64) DEFAULT NULL,
11661166
`INFO` longtext DEFAULT NULL,
1167-
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
1168-
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
1169-
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
1170-
`PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
1171-
`MEMORY_USED` bigint(7) NOT NULL DEFAULT '0',
1172-
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0',
1173-
`QUERY_ID` bigint(4) NOT NULL DEFAULT '0',
1167+
`TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000,
1168+
`STAGE` tinyint(2) NOT NULL DEFAULT 0,
1169+
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
1170+
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
1171+
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
1172+
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
1173+
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
11741174
`INFO_BINARY` blob DEFAULT NULL,
1175-
`TID` bigint(4) NOT NULL DEFAULT '0'
1175+
`TID` bigint(4) NOT NULL DEFAULT 0
11761176
) DEFAULT CHARSET=utf8
11771177
drop table t1;
11781178
create table t1 like information_schema.character_sets;
@@ -1182,7 +1182,7 @@ t1 CREATE TABLE `t1` (
11821182
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
11831183
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
11841184
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
1185-
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
1185+
`MAXLEN` bigint(3) NOT NULL DEFAULT 0
11861186
) ENGINE=MEMORY DEFAULT CHARSET=utf8
11871187
drop table t1;
11881188

@@ -1241,8 +1241,8 @@ CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0);
12411241
SHOW CREATE TABLE t1;
12421242
Table Create Table
12431243
t1 CREATE TABLE `t1` (
1244-
`c1` year(4) DEFAULT '2008',
1245-
`c2` year(4) DEFAULT '0000'
1244+
`c1` year(4) DEFAULT 2008,
1245+
`c2` year(4) DEFAULT 0000
12461246
) ENGINE=MyISAM DEFAULT CHARSET=latin1
12471247

12481248
INSERT INTO t1 VALUES();
@@ -1256,8 +1256,8 @@ ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0;
12561256
SHOW CREATE TABLE t1;
12571257
Table Create Table
12581258
t1 CREATE TABLE `t1` (
1259-
`c1` year(4) DEFAULT '0000',
1260-
`c2` year(4) DEFAULT '0000'
1259+
`c1` year(4) DEFAULT 0000,
1260+
`c2` year(4) DEFAULT 0000
12611261
) ENGINE=MyISAM DEFAULT CHARSET=latin1
12621262

12631263
INSERT INTO t1 VALUES();

mysql-test/r/ctype_utf8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ SHOW CREATE TABLE t1;
22752275
Table Create Table
22762276
t1 CREATE TABLE `t1` (
22772277
`clipid` int(11) NOT NULL,
2278-
`mos` tinyint(4) DEFAULT '0',
2278+
`mos` tinyint(4) DEFAULT 0,
22792279
`Tape` tinytext DEFAULT NULL,
22802280
PRIMARY KEY (`clipid`),
22812281
KEY `tape` (`Tape`(255))

mysql-test/r/ctype_utf8mb4.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,7 @@ SHOW CREATE TABLE t1;
23872387
Table Create Table
23882388
t1 CREATE TABLE `t1` (
23892389
`clipid` int(11) NOT NULL,
2390-
`mos` tinyint(4) DEFAULT '0',
2390+
`mos` tinyint(4) DEFAULT 0,
23912391
`Tape` tinytext DEFAULT NULL,
23922392
PRIMARY KEY (`clipid`),
23932393
KEY `tape` (`Tape`(250))

mysql-test/r/ctype_utf8mb4_innodb.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ SHOW CREATE TABLE t1;
23472347
Table Create Table
23482348
t1 CREATE TABLE `t1` (
23492349
`clipid` int(11) NOT NULL,
2350-
`mos` tinyint(4) DEFAULT '0',
2350+
`mos` tinyint(4) DEFAULT 0,
23512351
`Tape` tinytext DEFAULT NULL,
23522352
PRIMARY KEY (`clipid`),
23532353
KEY `tape` (`Tape`(191))

0 commit comments

Comments
 (0)