Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/executor/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,9 @@ func TestValidateSetVar(t *testing.T) {
tk.MustExec("set @@global.innodb_lock_wait_timeout = 0")
tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect innodb_lock_wait_timeout value: '0'"))

tk.MustExec("set @@global.innodb_lock_wait_timeout = 1073741824")
tk.MustQuery("show warnings").Check(testkit.Rows())

tk.MustExec("set @@global.innodb_lock_wait_timeout = 1073741825")
tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect innodb_lock_wait_timeout value: '1073741825'"))

Expand Down
2 changes: 1 addition & 1 deletion pkg/sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ var defaultSysVars = []*SysVar{
}},
{Scope: vardef.ScopeGlobal | vardef.ScopeSession, Name: vardef.WaitTimeout, Value: strconv.FormatInt(vardef.DefWaitTimeout, 10), Type: vardef.TypeUnsigned, MinValue: 0, MaxValue: secondsPerYear},
{Scope: vardef.ScopeGlobal | vardef.ScopeSession, Name: vardef.InteractiveTimeout, Value: "28800", Type: vardef.TypeUnsigned, MinValue: 1, MaxValue: secondsPerYear},
{Scope: vardef.ScopeGlobal | vardef.ScopeSession, Name: vardef.InnodbLockWaitTimeout, Value: strconv.FormatInt(vardef.DefInnodbLockWaitTimeout, 10), Type: vardef.TypeUnsigned, MinValue: 1, MaxValue: 3600, SetSession: func(s *SessionVars, val string) error {
{Scope: vardef.ScopeGlobal | vardef.ScopeSession, Name: vardef.InnodbLockWaitTimeout, Value: strconv.FormatInt(vardef.DefInnodbLockWaitTimeout, 10), Type: vardef.TypeUnsigned, MinValue: 1, MaxValue: 1073741824, SetSession: func(s *SessionVars, val string) error {
lockWaitSec := TidbOptInt64(val, vardef.DefInnodbLockWaitTimeout)
s.LockWaitTimeout = lockWaitSec * 1000
return nil
Expand Down
4 changes: 2 additions & 2 deletions tests/realtikvtest/pessimistictest/pessimistic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ func TestInnodbLockWaitTimeout(t *testing.T) {
tk2.MustExec("set innodb_lock_wait_timeout = 2")
tk2.MustQuery(`show variables like "innodb_lock_wait_timeout"`).Check(testkit.Rows("innodb_lock_wait_timeout 2"))
// to check whether it will set to innodb_lock_wait_timeout to max value
tk2.MustExec("set innodb_lock_wait_timeout = 3602")
tk2.MustQuery(`show variables like "innodb_lock_wait_timeout"`).Check(testkit.Rows("innodb_lock_wait_timeout 3600"))
tk2.MustExec("set innodb_lock_wait_timeout = 1073741825")
tk2.MustQuery(`show variables like "innodb_lock_wait_timeout"`).Check(testkit.Rows("innodb_lock_wait_timeout 1073741824"))
tk2.MustExec("set innodb_lock_wait_timeout = 2")

tk3 := testkit.NewTestKit(t, store)
Expand Down