Skip to content

Commit

Permalink
test: 调整enable_timestamp_type参数单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Jul 19, 2019
1 parent 6a642ef commit 121cb2b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions session/session_inception_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2178,9 +2178,9 @@ func (s *testSessionIncSuite) TestZeroDate(c *C) {
defer func() {
config.GetGlobalConfig().Inc = saved
}()

sql := ""

config.GetGlobalConfig().Inc.EnableZeroDate = false
sql = `create table t4 (id int unsigned not null auto_increment primary key comment 'primary key', a datetime not null default 0 comment 'a') comment 'test';`
s.testErrorCode(c, sql,
Expand All @@ -2193,11 +2193,12 @@ func (s *testSessionIncSuite) TestTimestampType(c *C) {
defer func() {
config.GetGlobalConfig().Inc = saved
}()

sql := ""

config.GetGlobalConfig().Inc.EnableTimeStampType = false
sql = `create table t4 (id int unsigned not null auto_increment primary key comment 'primary key', a timestamp not null default 0 comment 'a') comment 'test';`
// sql = `create table t4 (id int unsigned not null auto_increment primary key comment 'primary key', a timestamp not null default 0 comment 'a') comment 'test';`
sql = `create table t4 (id int unsigned not null auto_increment primary key comment 'primary key', a timestamp not null comment 'a') comment 'test';`
s.testErrorCode(c, sql,
session.NewErr(session.ER_INVALID_DATA_TYPE, "a"))
config.GetGlobalConfig().Inc.EnableTimeStampType = true
Expand Down

0 comments on commit 121cb2b

Please sign in to comment.