Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed May 19, 2021
1 parent 7463558 commit dc9349b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ddl/db_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2813,6 +2813,8 @@ func (s *testIntegrationSuite3) TestCreateTemporaryTable(c *C) {
tk.MustGetErrCode("create global temporary table t(a double(0, 0))", errno.ErrParse)
tk.MustGetErrCode("create temporary table t(id int) on commit delete rows", errno.ErrParse)
tk.MustGetErrCode("create temporary table t(id int) on commit preserve rows", errno.ErrParse)
tk.MustGetErrCode("create table t(id int) on commit delete rows", errno.ErrParse)
tk.MustGetErrCode("create table t(id int) on commit preserve rows", errno.ErrParse)

// Not support yet.
tk.MustGetErrCode("create global temporary table t (id int) on commit preserve rows", errno.ErrUnsupportedDDLOperation)
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ func handleTableOptions(options []*ast.TableOption, tbInfo *model.TableInfo) err
// We don't handle charset and collate here since they're handled in `getCharsetAndCollateInTableOption`.
case ast.TableOptionEngine:
if tbInfo.TempTableType != model.TempTableNone {
if op.StrValue != "" && op.StrValue != "memory" {
if op.StrValue != "" && !strings.EqualFold(op.StrValue, "memory") {
return errors.Trace(errUnsupportedEngineTemporary)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ddl/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,5 @@ var (
ErrPartitionNoTemporary = dbterror.ClassDDL.NewStd(mysql.ErrPartitionNoTemporary)

errUnsupportedOnCommitPreserve = dbterror.ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("TiDB doesn't support ON COMMIT PRESERVE ROWS for now", nil))
errUnsupportedEngineTemporary = dbterror.ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("TiDB doesn't this kind of engine for temporary table", nil))
errUnsupportedEngineTemporary = dbterror.ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("TiDB doesn't support this kind of engine for temporary table", nil))
)

0 comments on commit dc9349b

Please sign in to comment.