Skip to content

Commit

Permalink
fix issue5462 (#5463) (#5492)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored Dec 26, 2017
1 parent 39ba5ed commit efb13f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion executor/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func (e *ShowExec) fetchShowCreateTable() error {
}
cols = append(cols, colInfo)
}
buf.WriteString(fmt.Sprintf("(%s)", strings.Join(cols, "`,`")))
buf.WriteString(fmt.Sprintf("(%s)", strings.Join(cols, ",")))
if i != len(tb.Indices())-1 {
buf.WriteString(",\n")
}
Expand Down
4 changes: 2 additions & 2 deletions executor/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *testSuite) TestShow(c *C) {

testSQL := `drop table if exists show_test`
tk.MustExec(testSQL)
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";`
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";`
tk.MustExec(testSQL)

testSQL = "show columns from show_test;"
Expand All @@ -48,7 +48,7 @@ func (s *testSuite) TestShow(c *C) {
row := result.Rows()[0]
// For issue https://github.com/pingcap/tidb/issues/1061
expectedRow := []interface{}{
"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'"}
"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'"}
for i, r := range row {
c.Check(r, Equals, expectedRow[i])
}
Expand Down

0 comments on commit efb13f1

Please sign in to comment.