diff --git a/executor/show.go b/executor/show.go index 4913dffc320fd..b89a22e5c0154 100644 --- a/executor/show.go +++ b/executor/show.go @@ -633,14 +633,9 @@ func (e *ShowExec) fetchShowCreateTable() error { for i, def := range partitionInfo.Definitions { lessThans := "" lessThans = strings.Join(def.LessThan, ",") - multipleLt := len(def.LessThan) > 1 var parDef string - if multipleLt { - parDef = fmt.Sprintf(" PARTITION %s VALUES LESS THAN (%s)", def.Name, lessThans) - } else { - parDef = fmt.Sprintf(" PARTITION %s VALUES LESS THAN %s", def.Name, lessThans) - } + parDef = fmt.Sprintf(" PARTITION %s VALUES LESS THAN (%s)", def.Name, lessThans) if i < len(partitionInfo.Definitions)-1 { buf.WriteString(parDef) buf.WriteString(",\n") diff --git a/executor/show_test.go b/executor/show_test.go index ae81dbf1e9bcc..22bd062c0acd9 100644 --- a/executor/show_test.go +++ b/executor/show_test.go @@ -320,7 +320,7 @@ func (s *testSuite) TestShow(c *C) { tk.MustQuery("show create table t").Check(testutil.RowsWithSep("|", "t CREATE TABLE `t` (\n"+ " `a` int(11) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin"+"\nPARTITION BY RANGE ( `a` ) (\n PARTITION p0 VALUES LESS THAN 10,\n PARTITION p1 VALUES LESS THAN 20,\n PARTITION p2 VALUES LESS THAN MAXVALUE\n)", + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin"+"\nPARTITION BY RANGE ( `a` ) (\n PARTITION p0 VALUES LESS THAN (10),\n PARTITION p1 VALUES LESS THAN (20),\n PARTITION p2 VALUES LESS THAN (MAXVALUE)\n)", )) tk.MustExec(`drop table if exists t`)