Skip to content

Commit 0d979a2

Browse files
ciscoxllcoocood
authored andcommitted
ddl: fix 'show create table' result not correct when the table with a compression option (#7793)
1 parent 86416be commit 0d979a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

executor/show.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ func (e *ShowExec) fetchShowCreateTable() error {
598598

599599
// Displayed if the compression typed is set.
600600
if len(tb.Meta().Compression) != 0 {
601-
buf.WriteString(fmt.Sprintf(" COMPRESSION=`%s`", tb.Meta().Compression))
601+
buf.WriteString(fmt.Sprintf(" COMPRESSION='%s'", tb.Meta().Compression))
602602
}
603603

604604
// add partition info here.

executor/show_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ func (s *testSuite) TestShow(c *C) {
397397
tk.MustQuery("show create table t1").Check(testutil.RowsWithSep("|",
398398
"t1 CREATE TABLE `t1` (\n"+
399399
" `c1` int(11) DEFAULT NULL\n"+
400-
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMPRESSION=`zlib`",
400+
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMPRESSION='zlib'",
401401
))
402402

403403
// Test show create table year type

0 commit comments

Comments
 (0)