diff --git a/executor/set_test.go b/executor/set_test.go index 1633c805b09f5..523247bc08dfa 100644 --- a/executor/set_test.go +++ b/executor/set_test.go @@ -298,12 +298,12 @@ func (s *testSuite2) TestSetVar(c *C) { // test skip isolation level check: error _, err = tk.Exec("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE") - c.Assert(terror.ErrorEqual(err, variable.ErrUnsupportedValueForVar), IsTrue, Commentf("err %v", err)) + c.Assert(terror.ErrorEqual(err, variable.ErrUnsupportedIsolationLevel), IsTrue, Commentf("err %v", err)) tk.MustQuery("select @@session.tx_isolation").Check(testkit.Rows("READ-COMMITTED")) tk.MustQuery("select @@session.transaction_isolation").Check(testkit.Rows("READ-COMMITTED")) _, err = tk.Exec("SET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE") - c.Assert(terror.ErrorEqual(err, variable.ErrUnsupportedValueForVar), IsTrue, Commentf("err %v", err)) + c.Assert(terror.ErrorEqual(err, variable.ErrUnsupportedIsolationLevel), IsTrue, Commentf("err %v", err)) tk.MustQuery("select @@global.tx_isolation").Check(testkit.Rows("READ-COMMITTED")) tk.MustQuery("select @@global.transaction_isolation").Check(testkit.Rows("READ-COMMITTED")) @@ -312,8 +312,8 @@ func (s *testSuite2) TestSetVar(c *C) { tk.MustExec("SET SESSION tidb_skip_isolation_level_check = 1") tk.MustExec("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE") tk.MustQuery("show warnings").Check(testkit.Rows( - "Warning 1105 variable 'tx_isolation' does not yet support value: SERIALIZABLE", - "Warning 1105 variable 'transaction_isolation' does not yet support value: SERIALIZABLE")) + "Warning 1105 The isolation level 'SERIALIZABLE' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error", + "Warning 1105 The isolation level 'SERIALIZABLE' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error")) tk.MustQuery("select @@session.tx_isolation").Check(testkit.Rows("SERIALIZABLE")) tk.MustQuery("select @@session.transaction_isolation").Check(testkit.Rows("SERIALIZABLE")) @@ -322,8 +322,8 @@ func (s *testSuite2) TestSetVar(c *C) { tk.MustExec("SET SESSION tidb_skip_isolation_level_check = 1") tk.MustExec("SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED") tk.MustQuery("show warnings").Check(testkit.Rows( - "Warning 1105 variable 'tx_isolation' does not yet support value: READ-UNCOMMITTED", - "Warning 1105 variable 'transaction_isolation' does not yet support value: READ-UNCOMMITTED")) + "Warning 1105 The isolation level 'READ-UNCOMMITTED' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error", + "Warning 1105 The isolation level 'READ-UNCOMMITTED' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error")) tk.MustQuery("select @@global.tx_isolation").Check(testkit.Rows("READ-UNCOMMITTED")) tk.MustQuery("select @@global.transaction_isolation").Check(testkit.Rows("READ-UNCOMMITTED")) diff --git a/sessionctx/variable/session.go b/sessionctx/variable/session.go index 9673ace21b665..15b45dbb5ff11 100644 --- a/sessionctx/variable/session.go +++ b/sessionctx/variable/session.go @@ -604,7 +604,7 @@ func (s *SessionVars) SetSystemVar(name string, val string) error { switch val { case "SERIALIZABLE", "READ-UNCOMMITTED": skipIsolationLevelCheck, err := GetSessionSystemVar(s, TiDBSkipIsolationLevelCheck) - returnErr := ErrUnsupportedValueForVar.GenWithStackByArgs(name, val) + returnErr := ErrUnsupportedIsolationLevel.GenWithStackByArgs(val) if err != nil { returnErr = err } diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index 841f7c0b5ca46..5d705b8cf50e8 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -85,6 +85,7 @@ var ( ErrTruncatedWrongValue = terror.ClassVariable.New(CodeTruncatedWrongValue, mysql.MySQLErrName[mysql.ErrTruncatedWrongValue]) ErrMaxPreparedStmtCountReached = terror.ClassVariable.New(CodeMaxPreparedStmtCountReached, mysql.MySQLErrName[mysql.ErrMaxPreparedStmtCountReached]) ErrUnsupportedValueForVar = terror.ClassVariable.New(CodeUnknownStatusVar, "variable '%s' does not yet support value: %s") + ErrUnsupportedIsolationLevel = terror.ClassVariable.New(CodeUnknownStatusVar, "The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error") ) func init() { diff --git a/sessionctx/variable/varsutil.go b/sessionctx/variable/varsutil.go index 5b61d0c3c1211..e58b245321ad9 100644 --- a/sessionctx/variable/varsutil.go +++ b/sessionctx/variable/varsutil.go @@ -430,7 +430,7 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string, switch upVal { case "SERIALIZABLE", "READ-UNCOMMITTED": skipIsolationLevelCheck, err := GetSessionSystemVar(vars, TiDBSkipIsolationLevelCheck) - returnErr := ErrUnsupportedValueForVar.GenWithStackByArgs(name, value) + returnErr := ErrUnsupportedIsolationLevel.GenWithStackByArgs(value) if err != nil { returnErr = err }