Skip to content

Commit efb13f1

Browse files
authored
fix issue5462 (#5463) (#5492)
1 parent 39ba5ed commit efb13f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

executor/show.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func (e *ShowExec) fetchShowCreateTable() error {
529529
}
530530
cols = append(cols, colInfo)
531531
}
532-
buf.WriteString(fmt.Sprintf("(%s)", strings.Join(cols, "`,`")))
532+
buf.WriteString(fmt.Sprintf("(%s)", strings.Join(cols, ",")))
533533
if i != len(tb.Indices())-1 {
534534
buf.WriteString(",\n")
535535
}

executor/show_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (s *testSuite) TestShow(c *C) {
3535

3636
testSQL := `drop table if exists show_test`
3737
tk.MustExec(testSQL)
38-
testSQL = `create table SHOW_test (id int PRIMARY KEY AUTO_INCREMENT, c1 int comment "c1_comment", c2 int, c3 int default 1, c4 text, key idx_wide_c4(c4(10))) ENGINE=InnoDB AUTO_INCREMENT=28934 DEFAULT CHARSET=utf8 COMMENT "table_comment";`
38+
testSQL = `create table SHOW_test (id int PRIMARY KEY AUTO_INCREMENT, c1 int comment "c1_comment", c2 int, c3 int default 1, c4 text, key idx_wide_c4(c3, c4(10))) ENGINE=InnoDB AUTO_INCREMENT=28934 DEFAULT CHARSET=utf8 COMMENT "table_comment";`
3939
tk.MustExec(testSQL)
4040

4141
testSQL = "show columns from show_test;"
@@ -48,7 +48,7 @@ func (s *testSuite) TestShow(c *C) {
4848
row := result.Rows()[0]
4949
// For issue https://github.com/pingcap/tidb/issues/1061
5050
expectedRow := []interface{}{
51-
"SHOW_test", "CREATE TABLE `SHOW_test` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `c1` int(11) DEFAULT NULL COMMENT 'c1_comment',\n `c2` int(11) DEFAULT NULL,\n `c3` int(11) DEFAULT '1',\n `c4` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_wide_c4` (`c4`(10))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=28934 COMMENT='table_comment'"}
51+
"SHOW_test", "CREATE TABLE `SHOW_test` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `c1` int(11) DEFAULT NULL COMMENT 'c1_comment',\n `c2` int(11) DEFAULT NULL,\n `c3` int(11) DEFAULT '1',\n `c4` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_wide_c4` (`c3`,`c4`(10))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=28934 COMMENT='table_comment'"}
5252
for i, r := range row {
5353
c.Check(r, Equals, expectedRow[i])
5454
}

0 commit comments

Comments
 (0)