diff --git a/br/pkg/utils/retry.go b/br/pkg/utils/retry.go index e1426628b8af2..8b66c7505aa16 100644 --- a/br/pkg/utils/retry.go +++ b/br/pkg/utils/retry.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/pingcap/errors" "github.com/pingcap/log" - tmysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/util/logutil" "github.com/tikv/client-go/v2/tikv" @@ -104,7 +104,7 @@ func WithRetryReturnLastErr( func FallBack2CreateTable(err error) bool { switch nerr := errors.Cause(err).(type) { case *terror.Error: - return nerr.Code() == tmysql.ErrInvalidDDLJob + return nerr.Code() == errno.ErrInvalidDDLJob } return false } diff --git a/pkg/ddl/column_modify_test.go b/pkg/ddl/column_modify_test.go index 04f0c86ca042c..d6273fe9b51a5 100644 --- a/pkg/ddl/column_modify_test.go +++ b/pkg/ddl/column_modify_test.go @@ -354,7 +354,7 @@ func TestChangeColumn(t *testing.T) { err = tk.ExecToErr("alter table t4 change c1 a1 int not null;") require.EqualError(t, err, "[ddl:1265]Data truncated for column 'a1' at row 1") sql = "alter table t4 change c2 a bigint not null;" - tk.MustGetErrCode(sql, mysql.WarnDataTruncated) + tk.MustGetErrCode(sql, errno.WarnDataTruncated) sql = "alter table t3 modify en enum('a', 'z', 'b', 'c') not null default 'a'" tk.MustExec(sql) // Rename to an existing column. @@ -365,12 +365,12 @@ func TestChangeColumn(t *testing.T) { tk.MustExec("drop table if exists t5") tk.MustExec("create table t5 (k char(10) primary key, v int)") sql = "alter table t5 change column k k tinytext;" - tk.MustGetErrCode(sql, mysql.ErrBlobKeyWithoutLength) + tk.MustGetErrCode(sql, errno.ErrBlobKeyWithoutLength) tk.MustExec("drop table t5") tk.MustExec("drop table if exists t5") tk.MustExec("create table t5 (k char(10), v int, INDEX(k))") sql = "alter table t5 change column k k tinytext;" - tk.MustGetErrCode(sql, mysql.ErrBlobKeyWithoutLength) + tk.MustGetErrCode(sql, errno.ErrBlobKeyWithoutLength) tk.MustExec("drop table t5") tk.MustExec("drop table t3") } diff --git a/pkg/ddl/column_type_change_test.go b/pkg/ddl/column_type_change_test.go index 908a395f4b42a..a053688b256ff 100644 --- a/pkg/ddl/column_type_change_test.go +++ b/pkg/ddl/column_type_change_test.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/ddl" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/parser/mysql" @@ -175,10 +176,10 @@ var mockTerrorMap = make(map[string]*terror.Error) func init() { // Since terror new action will cause data race with other test suite (getTerrorCode) in parallel, we init it all here. - mockTerrorMap[model.StateNone.String()] = dbterror.ClassDDL.NewStdErr(1, mysql.Message("MockRollingBackInCallBack-"+model.StateNone.String(), nil)) - mockTerrorMap[model.StateDeleteOnly.String()] = dbterror.ClassDDL.NewStdErr(1, mysql.Message("MockRollingBackInCallBack-"+model.StateDeleteOnly.String(), nil)) - mockTerrorMap[model.StateWriteOnly.String()] = dbterror.ClassDDL.NewStdErr(1, mysql.Message("MockRollingBackInCallBack-"+model.StateWriteOnly.String(), nil)) - mockTerrorMap[model.StateWriteReorganization.String()] = dbterror.ClassDDL.NewStdErr(1, mysql.Message("MockRollingBackInCallBack-"+model.StateWriteReorganization.String(), nil)) + mockTerrorMap[model.StateNone.String()] = dbterror.ClassDDL.NewStdErr(1, errno.Message("MockRollingBackInCallBack-"+model.StateNone.String(), nil)) + mockTerrorMap[model.StateDeleteOnly.String()] = dbterror.ClassDDL.NewStdErr(1, errno.Message("MockRollingBackInCallBack-"+model.StateDeleteOnly.String(), nil)) + mockTerrorMap[model.StateWriteOnly.String()] = dbterror.ClassDDL.NewStdErr(1, errno.Message("MockRollingBackInCallBack-"+model.StateWriteOnly.String(), nil)) + mockTerrorMap[model.StateWriteReorganization.String()] = dbterror.ClassDDL.NewStdErr(1, errno.Message("MockRollingBackInCallBack-"+model.StateWriteReorganization.String(), nil)) } // Test issue #20529. diff --git a/pkg/ddl/ddl_test.go b/pkg/ddl/ddl_test.go index ed5d14d2f389a..83f2a8c698b03 100644 --- a/pkg/ddl/ddl_test.go +++ b/pkg/ddl/ddl_test.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/tidb/pkg/ddl/testargsv1" "github.com/pingcap/tidb/pkg/domain/infosync" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/infoschema" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/meta" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/pkg/parser" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/charset" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/store/mockstore" "github.com/pingcap/tidb/pkg/tablecodec" @@ -209,7 +209,7 @@ func TestError(t *testing.T) { } for _, err := range kvErrs { code := terror.ToSQLError(err).Code - require.NotEqual(t, mysql.ErrUnknown, code) + require.NotEqual(t, errno.ErrUnknown, code) require.Equal(t, uint16(err.Code()), code) } } diff --git a/pkg/ddl/placement_policy_test.go b/pkg/ddl/placement_policy_test.go index 889920ca22d3e..15bbaaa57877a 100644 --- a/pkg/ddl/placement_policy_test.go +++ b/pkg/ddl/placement_policy_test.go @@ -28,7 +28,7 @@ import ( "github.com/pingcap/tidb/pkg/ddl/util" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/domain/infosync" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/infoschema" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/meta" @@ -230,15 +230,15 @@ func testPlacementPolicy(t *testing.T) { tk.MustGetErrCode("create placement policy x "+ "PRIMARY_REGION=\"cn-east-1\" "+ - "REGIONS=\"cn-east-1,cn-east-2\" ", mysql.ErrPlacementPolicyExists) + "REGIONS=\"cn-east-1,cn-east-2\" ", errno.ErrPlacementPolicyExists) tk.MustGetErrCode("create placement policy X "+ "PRIMARY_REGION=\"cn-east-1\" "+ - "REGIONS=\"cn-east-1,cn-east-2\" ", mysql.ErrPlacementPolicyExists) + "REGIONS=\"cn-east-1,cn-east-2\" ", errno.ErrPlacementPolicyExists) tk.MustGetErrCode("create placement policy `X` "+ "PRIMARY_REGION=\"cn-east-1\" "+ - "REGIONS=\"cn-east-1,cn-east-2\" ", mysql.ErrPlacementPolicyExists) + "REGIONS=\"cn-east-1,cn-east-2\" ", errno.ErrPlacementPolicyExists) tk.MustExec("create placement policy if not exists X " + "PRIMARY_REGION=\"cn-east-1\" " + @@ -250,7 +250,7 @@ func testPlacementPolicy(t *testing.T) { require.Equal(t, len(bundles), 0) tk.MustExec("drop placement policy x") - tk.MustGetErrCode("drop placement policy x", mysql.ErrPlacementPolicyNotExists) + tk.MustGetErrCode("drop placement policy x", errno.ErrPlacementPolicyNotExists) tk.MustExec("drop placement policy if exists x") //nolint:revive,all_revive tk.MustQuery("show warnings").Check(testkit.Rows("Note 8239 Unknown placement policy 'x'")) @@ -464,8 +464,8 @@ func TestResetSchemaPlacement(t *testing.T) { tk := testkit.NewTestKit(t, store) tk.MustExec("drop database if exists TestResetPlacementDB;") tk.MustExec("create placement policy `TestReset` followers=4;") - tk.MustGetErrCode("create placement policy `default` followers=4;", mysql.ErrReservedSyntax) - tk.MustGetErrCode("create placement policy default followers=4;", mysql.ErrParse) + tk.MustGetErrCode("create placement policy `default` followers=4;", errno.ErrReservedSyntax) + tk.MustGetErrCode("create placement policy default followers=4;", errno.ErrParse) tk.MustExec("create database TestResetPlacementDB placement policy `TestReset`;") tk.MustExec("use TestResetPlacementDB") @@ -607,8 +607,8 @@ func TestAlterPlacementPolicy(t *testing.T) { // test alter not exist policies tk.MustExec("drop table tp") tk.MustExec("drop placement policy x") - tk.MustGetErrCode("alter placement policy x REGIONS=\"bj,sh\"", mysql.ErrPlacementPolicyNotExists) - tk.MustGetErrCode("alter placement policy x2 REGIONS=\"bj,sh\"", mysql.ErrPlacementPolicyNotExists) + tk.MustGetErrCode("alter placement policy x REGIONS=\"bj,sh\"", errno.ErrPlacementPolicyNotExists) + tk.MustGetErrCode("alter placement policy x2 REGIONS=\"bj,sh\"", errno.ErrPlacementPolicyNotExists) tk.MustQuery("select * from INFORMATION_SCHEMA.PLACEMENT_POLICIES WHERE POLICY_NAME='x'").Check(testkit.Rows()) } @@ -636,7 +636,7 @@ func TestCreateTableWithPlacementPolicy(t *testing.T) { // Only placement policy should check the policy existence. tk.MustGetErrCode("create table t(a int)"+ - "PLACEMENT POLICY=\"x\"", mysql.ErrPlacementPolicyNotExists) + "PLACEMENT POLICY=\"x\"", errno.ErrPlacementPolicyNotExists) tk.MustExec("create placement policy x " + "FOLLOWERS=2 " + "CONSTRAINTS=\"[+disk=ssd]\" ") @@ -1098,7 +1098,7 @@ func TestAlterTablePartitionWithPlacementPolicy(t *testing.T) { // Only placement policy should check the policy existence. tk.MustGetErrCode("alter table t1 partition p0 "+ - "PLACEMENT POLICY=\"x\"", mysql.ErrPlacementPolicyNotExists) + "PLACEMENT POLICY=\"x\"", errno.ErrPlacementPolicyNotExists) tk.MustExec("create placement policy x " + "FOLLOWERS=2 ") tk.MustExec("alter table t1 partition p0 " + @@ -2208,25 +2208,25 @@ func TestExchangePartitionWithPlacement(t *testing.T) { checkExistTableBundlesInPD(t, dom, "test", "tp") // exchange par2, t1 - tk.MustGetErrCode("alter table tp exchange partition p2 with table t1", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p2 with table t1", errno.ErrTablesDifferentMetadata) // exchange par3, t1 - tk.MustGetErrCode("alter table tp exchange partition p3 with table t1", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p3 with table t1", errno.ErrTablesDifferentMetadata) // exchange par1, t2 - tk.MustGetErrCode("alter table tp exchange partition p1 with table t2", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p1 with table t2", errno.ErrTablesDifferentMetadata) // exchange par2, t2 - tk.MustGetErrCode("alter table tp exchange partition p2 with table t2", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p2 with table t2", errno.ErrTablesDifferentMetadata) // exchange par3, t2 - tk.MustGetErrCode("alter table tp exchange partition p3 with table t2", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p3 with table t2", errno.ErrTablesDifferentMetadata) // exchange par1, t3 - tk.MustGetErrCode("alter table tp exchange partition p1 with table t3", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p1 with table t3", errno.ErrTablesDifferentMetadata) // exchange par2, t3 - tk.MustGetErrCode("alter table tp exchange partition p2 with table t3", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p2 with table t3", errno.ErrTablesDifferentMetadata) // exchange par3, t3 tk.MustExec("alter table tp exchange partition p3 with table t3") @@ -2312,7 +2312,7 @@ func TestPDFail(t *testing.T) { checkAllBundlesNotChange(t, existBundles) // exchange partition - tk.MustGetErrCode("alter table tp exchange partition p1 with table t1", mysql.ErrTablesDifferentMetadata) + tk.MustGetErrCode("alter table tp exchange partition p1 with table t1", errno.ErrTablesDifferentMetadata) tk.MustQuery("show create table t1").Check(testkit.Rows("t1 CREATE TABLE `t1` (\n" + " `id` int(11) DEFAULT NULL\n" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) diff --git a/pkg/ddl/placement_sql_test.go b/pkg/ddl/placement_sql_test.go index 130998b7409ce..2e79d6cec7d0b 100644 --- a/pkg/ddl/placement_sql_test.go +++ b/pkg/ddl/placement_sql_test.go @@ -23,7 +23,7 @@ import ( "github.com/pingcap/tidb/pkg/ddl" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/domain/infosync" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/sessionctx" @@ -210,7 +210,7 @@ func TestAlterDBPlacement(t *testing.T) { // Policy Test // Test for Non-Exist policy - tk.MustGetErrCode("ALTER DATABASE TestAlterDB PLACEMENT POLICY=`alter_z`;", mysql.ErrPlacementPolicyNotExists) + tk.MustGetErrCode("ALTER DATABASE TestAlterDB PLACEMENT POLICY=`alter_z`;", errno.ErrPlacementPolicyNotExists) tk.MustQuery("SELECT CATALOG_NAME, SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME, TIDB_PLACEMENT_POLICY_NAME FROM information_schema.schemata WHERE SCHEMA_NAME='TestAlterDB'").Check(testkit.Rows(`def TestAlterDB utf8mb4 utf8mb4_bin `)) tk.MustExec("ALTER DATABASE TestAlterDB PLACEMENT POLICY=`alter_x`;") diff --git a/pkg/ddl/sequence_test.go b/pkg/ddl/sequence_test.go index 3f94edc1dd391..132d2ae781b9d 100644 --- a/pkg/ddl/sequence_test.go +++ b/pkg/ddl/sequence_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/parser/auth" "github.com/pingcap/tidb/pkg/session" @@ -34,30 +34,30 @@ func TestCreateSequence(t *testing.T) { tk := testkit.NewTestKit(t, store) tk.MustExec("use test") tk.MustExec("drop sequence if exists seq") - tk.MustGetErrCode("create sequence `seq `", mysql.ErrWrongTableName) + tk.MustGetErrCode("create sequence `seq `", errno.ErrWrongTableName) // increment should not be set as 0. - tk.MustGetErrCode("create sequence seq increment 0", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq increment 0", errno.ErrSequenceInvalidData) // maxvalue should be larger than minvalue. - tk.MustGetErrCode("create sequence seq maxvalue 1 minvalue 2", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq maxvalue 1 minvalue 2", errno.ErrSequenceInvalidData) // maxvalue should be larger than minvalue. - tk.MustGetErrCode("create sequence seq maxvalue 1 minvalue 1", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq maxvalue 1 minvalue 1", errno.ErrSequenceInvalidData) // maxvalue shouldn't be equal to MaxInt64. - tk.MustGetErrCode("create sequence seq maxvalue 9223372036854775807 minvalue 1", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq maxvalue 9223372036854775807 minvalue 1", errno.ErrSequenceInvalidData) // TODO : minvalue shouldn't be equal to MinInt64. // maxvalue should be larger than start. - tk.MustGetErrCode("create sequence seq maxvalue 1 start with 2", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq maxvalue 1 start with 2", errno.ErrSequenceInvalidData) // cacheVal should be less than (math.MaxInt64-maxIncrement)/maxIncrement. - tk.MustGetErrCode("create sequence seq increment 100000 cache 922337203685477", mysql.ErrSequenceInvalidData) + tk.MustGetErrCode("create sequence seq increment 100000 cache 922337203685477", errno.ErrSequenceInvalidData) // test unsupported table option in sequence. - tk.MustGetErrCode("create sequence seq CHARSET=utf8", mysql.ErrSequenceUnsupportedTableOption) + tk.MustGetErrCode("create sequence seq CHARSET=utf8", errno.ErrSequenceUnsupportedTableOption) tk.MustExec("create sequence seq comment=\"test\"") diff --git a/pkg/ddl/tests/metadatalock/mdl_test.go b/pkg/ddl/tests/metadatalock/mdl_test.go index 5a041e3b16bba..6d8ef460c9a47 100644 --- a/pkg/ddl/tests/metadatalock/mdl_test.go +++ b/pkg/ddl/tests/metadatalock/mdl_test.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/ddl" ingesttestutil "github.com/pingcap/tidb/pkg/ddl/ingest/testutil" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/server" "github.com/pingcap/tidb/pkg/testkit" @@ -330,15 +330,15 @@ func TestMDLRRUpdateSchema(t *testing.T) { tk.MustExec("begin") tkDDL.MustExec("alter table test.t add index idx(a);") tk.MustQuery("select * from t").Check(testkit.Rows("1 ")) - tk.MustGetErrCode("select * from t use index(idx)", mysql.ErrKeyDoesNotExist) + tk.MustGetErrCode("select * from t use index(idx)", errno.ErrKeyDoesNotExist) tk.MustExec("commit") tk.MustQuery("select * from t use index(idx)").Check(testkit.Rows("1 ")) // Modify column(reorg). tk.MustExec("begin") tkDDL.MustExec("alter table test.t modify column a char(10);") - tk.MustGetErrCode("select * from t", mysql.ErrInfoSchemaChanged) - tk.MustGetErrCode("select * from t", mysql.ErrInfoSchemaChanged) + tk.MustGetErrCode("select * from t", errno.ErrInfoSchemaChanged) + tk.MustGetErrCode("select * from t", errno.ErrInfoSchemaChanged) tk.MustExec("commit") tk.MustQuery("select * from t").Check(testkit.Rows("1 ")) @@ -1113,7 +1113,7 @@ func TestMDLDisable2Enable(t *testing.T) { wg.Wait() - tk.MustGetErrCode("commit", mysql.ErrInfoSchemaChanged) + tk.MustGetErrCode("commit", errno.ErrInfoSchemaChanged) tk3.MustExec("commit") tk.MustExec("admin check table t") } @@ -1153,7 +1153,7 @@ func TestMDLEnable2Disable(t *testing.T) { wg.Wait() - tk.MustGetErrCode("commit", mysql.ErrInfoSchemaChanged) + tk.MustGetErrCode("commit", errno.ErrInfoSchemaChanged) tk3.MustExec("commit") tk.MustExec("admin check table t") } @@ -1322,11 +1322,11 @@ func TestMDLTableCreate(t *testing.T) { tk.MustExec("begin") tk.MustQuery("select * from t;") - tk.MustGetErrCode("select * from t1;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t1;", errno.ErrNoSuchTable) tkDDL.MustExec("create table test.t1(a int);") - tk.MustGetErrCode("select * from t1;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t1;", errno.ErrNoSuchTable) tk.MustExec("commit") } @@ -1346,7 +1346,7 @@ func TestMDLTableDrop(t *testing.T) { tkDDL.MustExec("drop table test.t;") - tk.MustGetErrCode("select * from t;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t;", errno.ErrNoSuchTable) tk.MustExec("commit") } @@ -1365,8 +1365,8 @@ func TestMDLDatabaseCreate(t *testing.T) { tkDDL.MustExec("create database test2;") tkDDL.MustExec("create table test2.t(a int);") - tk.MustGetErrCode("use test2", mysql.ErrBadDB) - tk.MustGetErrCode("select * from test2.t;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("use test2", errno.ErrBadDB) + tk.MustGetErrCode("select * from test2.t;", errno.ErrNoSuchTable) tk.MustExec("commit") } @@ -1387,7 +1387,7 @@ func TestMDLDatabaseDrop(t *testing.T) { tkDDL.MustExec("drop database test;") tk.MustExec("use test;") - tk.MustGetErrCode("select * from t;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t;", errno.ErrNoSuchTable) tk.MustExec("commit") } @@ -1407,8 +1407,8 @@ func TestMDLRenameTable(t *testing.T) { tkDDL.MustExec("rename table test.t to test.t1;") - tk.MustGetErrCode("select * from t;", mysql.ErrNoSuchTable) - tk.MustGetErrCode("select * from t1;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t;", errno.ErrNoSuchTable) + tk.MustGetErrCode("select * from t1;", errno.ErrNoSuchTable) tk.MustExec("commit") tk.MustExec("create database test2") @@ -1416,8 +1416,8 @@ func TestMDLRenameTable(t *testing.T) { tkDDL.MustExec("rename table test.t1 to test2.t1;") - tk.MustGetErrCode("select * from t1;", mysql.ErrNoSuchTable) - tk.MustGetErrCode("select * from test2.t1;", mysql.ErrNoSuchTable) + tk.MustGetErrCode("select * from t1;", errno.ErrNoSuchTable) + tk.MustGetErrCode("select * from test2.t1;", errno.ErrNoSuchTable) tk.MustExec("commit") } diff --git a/pkg/ddl/tests/partition/db_partition_test.go b/pkg/ddl/tests/partition/db_partition_test.go index 399d9325ac684..148bf65b6e946 100644 --- a/pkg/ddl/tests/partition/db_partition_test.go +++ b/pkg/ddl/tests/partition/db_partition_test.go @@ -204,7 +204,7 @@ func TestCreateTableWithPartition(t *testing.T) { partition p1 values less than (19xx91), partition p2 values less than maxvalue );` - tk.MustGetErrCode(sql18, mysql.ErrBadField) + tk.MustGetErrCode(sql18, errno.ErrBadField) sql9 := `create TABLE t9 ( col1 int diff --git a/pkg/ddl/tests/serial/serial_test.go b/pkg/ddl/tests/serial/serial_test.go index ec753f0d958c4..a04eca0c74ae5 100644 --- a/pkg/ddl/tests/serial/serial_test.go +++ b/pkg/ddl/tests/serial/serial_test.go @@ -198,23 +198,23 @@ func TestCreateTableWithLike(t *testing.T) { // for failure table cases tk.MustExec("use ctwl_db") failSQL := "create table t1 like test_not_exist.t" - tk.MustGetErrCode(failSQL, mysql.ErrNoSuchTable) + tk.MustGetErrCode(failSQL, errno.ErrNoSuchTable) failSQL = "create table t1 like test.t_not_exist" - tk.MustGetErrCode(failSQL, mysql.ErrNoSuchTable) + tk.MustGetErrCode(failSQL, errno.ErrNoSuchTable) failSQL = "create table t1 (like test_not_exist.t)" - tk.MustGetErrCode(failSQL, mysql.ErrNoSuchTable) + tk.MustGetErrCode(failSQL, errno.ErrNoSuchTable) failSQL = "create table test_not_exis.t1 like ctwl_db.t" - tk.MustGetErrCode(failSQL, mysql.ErrBadDB) + tk.MustGetErrCode(failSQL, errno.ErrBadDB) failSQL = "create table t1 like ctwl_db.t" - tk.MustGetErrCode(failSQL, mysql.ErrTableExists) + tk.MustGetErrCode(failSQL, errno.ErrTableExists) // test failure for wrong object cases tk.MustExec("drop view if exists v") tk.MustExec("create view v as select 1 from dual") - tk.MustGetErrCode("create table viewTable like v", mysql.ErrWrongObject) + tk.MustGetErrCode("create table viewTable like v", errno.ErrWrongObject) tk.MustExec("drop sequence if exists seq") tk.MustExec("create sequence seq") - tk.MustGetErrCode("create table sequenceTable like seq", mysql.ErrWrongObject) + tk.MustGetErrCode("create table sequenceTable like seq", errno.ErrWrongObject) tk.MustExec("drop database ctwl_db") tk.MustExec("drop database ctwl_db1") @@ -831,7 +831,7 @@ func TestCanceledJobTakeTime(t *testing.T) { ddl.SetWaitTimeWhenErrorOccurred(1 * time.Second) defer func() { ddl.SetWaitTimeWhenErrorOccurred(originalWT) }() startTime := time.Now() - tk.MustGetErrCode("alter table t_cjtt add column b int", mysql.ErrNoSuchTable) + tk.MustGetErrCode("alter table t_cjtt add column b int", errno.ErrNoSuchTable) sub := time.Since(startTime) require.Less(t, sub, ddl.GetWaitTimeWhenErrorOccurred()) } diff --git a/pkg/domain/domain.go b/pkg/domain/domain.go index cb76a2fe6b586..00412c8d318d4 100644 --- a/pkg/domain/domain.go +++ b/pkg/domain/domain.go @@ -3399,7 +3399,7 @@ var ( ErrInfoSchemaExpired = dbterror.ClassDomain.NewStd(errno.ErrInfoSchemaExpired) // ErrInfoSchemaChanged returns the error that information schema is changed. ErrInfoSchemaChanged = dbterror.ClassDomain.NewStdErr(errno.ErrInfoSchemaChanged, - mysql.Message(errno.MySQLErrName[errno.ErrInfoSchemaChanged].Raw+". "+kv.TxnRetryableMark, nil)) + errno.Message(errno.MySQLErrName[errno.ErrInfoSchemaChanged].Raw+". "+kv.TxnRetryableMark, nil)) ) // SysProcesses holds the sys processes infos diff --git a/pkg/errno/BUILD.bazel b/pkg/errno/BUILD.bazel index 4bbfbb3103035..8749cee658ac8 100644 --- a/pkg/errno/BUILD.bazel +++ b/pkg/errno/BUILD.bazel @@ -9,7 +9,6 @@ go_library( ], importpath = "github.com/pingcap/tidb/pkg/errno", visibility = ["//visibility:public"], - deps = ["//pkg/parser/mysql"], ) go_test( diff --git a/pkg/errno/errname.go b/pkg/errno/errname.go index 8c35058293cc9..d4c57ecf427cf 100644 --- a/pkg/errno/errname.go +++ b/pkg/errno/errname.go @@ -14,1230 +14,1239 @@ package errno -import "github.com/pingcap/tidb/pkg/parser/mysql" +// ErrMessage is a error message with the format specifier. +type ErrMessage struct { + Raw string + RedactArgPos []int +} + +// Message creates a error message with the format specifier. +func Message(message string, redactArgs []int) *ErrMessage { + return &ErrMessage{Raw: message, RedactArgPos: redactArgs} +} // MySQLErrName maps error code to MySQL error messages. // Note: all ErrMessage to be added should be considered about the log redaction -// by setting the suitable configuration in the second argument of mysql.Message. +// by setting the suitable configuration in the second argument of Message. // See https://github.com/pingcap/tidb/blob/master/errno/logredaction.md -var MySQLErrName = map[uint16]*mysql.ErrMessage{ - ErrHashchk: mysql.Message("hashchk", nil), - ErrNisamchk: mysql.Message("isamchk", nil), - ErrNo: mysql.Message("NO", nil), - ErrYes: mysql.Message("YES", nil), - ErrCantCreateFile: mysql.Message("Can't create file '%-.200s' (errno: %d - %s)", nil), - ErrCantCreateTable: mysql.Message("Can't create table '%-.200s' (errno: %d)", nil), - ErrCantCreateDB: mysql.Message("Can't create database '%-.192s' (errno: %d)", nil), - ErrDBCreateExists: mysql.Message("Can't create database '%-.192s'; database exists", nil), - ErrDBDropExists: mysql.Message("Can't drop database '%-.192s'; database doesn't exist", nil), - ErrDBDropDelete: mysql.Message("Error dropping database (can't delete '%-.192s', errno: %d)", nil), - ErrDBDropRmdir: mysql.Message("Error dropping database (can't rmdir '%-.192s', errno: %d)", nil), - ErrCantDeleteFile: mysql.Message("Error on delete of '%-.192s' (errno: %d - %s)", nil), - ErrCantFindSystemRec: mysql.Message("Can't read record in system table", nil), - ErrCantGetStat: mysql.Message("Can't get status of '%-.200s' (errno: %d - %s)", nil), - ErrCantGetWd: mysql.Message("Can't get working directory (errno: %d - %s)", nil), - ErrCantLock: mysql.Message("Can't lock file (errno: %d - %s)", nil), - ErrCantOpenFile: mysql.Message("Can't open file: '%-.200s' (errno: %d - %s)", nil), - ErrFileNotFound: mysql.Message("Can't find file: '%-.200s' (errno: %d - %s)", nil), - ErrCantReadDir: mysql.Message("Can't read dir of '%-.192s' (errno: %d - %s)", nil), - ErrCantSetWd: mysql.Message("Can't change dir to '%-.192s' (errno: %d - %s)", nil), - ErrCheckread: mysql.Message("Record has changed since last read in table '%-.192s'", nil), - ErrDiskFull: mysql.Message("Disk full (%s); waiting for someone to free some space... (errno: %d - %s)", nil), - ErrDupKey: mysql.Message("Can't write; duplicate key in table '%-.192s'", nil), - ErrErrorOnClose: mysql.Message("Error on close of '%-.192s' (errno: %d - %s)", nil), - ErrErrorOnRead: mysql.Message("Error reading file '%-.200s' (errno: %d - %s)", nil), - ErrErrorOnRename: mysql.Message("Error on rename of '%-.210s' to '%-.210s' (errno: %d - %s)", nil), - ErrErrorOnWrite: mysql.Message("Error writing file '%-.200s' (errno: %d - %s)", nil), - ErrFileUsed: mysql.Message("'%-.192s' is locked against change", nil), - ErrFilsortAbort: mysql.Message("Sort aborted", nil), - ErrFormNotFound: mysql.Message("View '%-.192s' doesn't exist for '%-.192s'", nil), - ErrGetErrno: mysql.Message("Got error %d from storage engine", nil), - ErrIllegalHa: mysql.Message("Table storage engine for '%-.192s' doesn't have this option", nil), - ErrKeyNotFound: mysql.Message("Can't find record in '%-.192s'", nil), - ErrNotFormFile: mysql.Message("Incorrect information in file: '%-.200s'", nil), - ErrNotKeyFile: mysql.Message("Incorrect key file for table '%-.200s'; try to repair it", nil), - ErrOldKeyFile: mysql.Message("Old key file for table '%-.192s'; repair it!", nil), - ErrOpenAsReadonly: mysql.Message("Table '%-.192s' is read only", nil), - ErrOutofMemory: mysql.Message("Out of memory; restart server and try again (needed %d bytes)", nil), - ErrOutOfSortMemory: mysql.Message("Out of sort memory, consider increasing server sort buffer size", nil), - ErrUnexpectedEOF: mysql.Message("Unexpected EOF found when reading file '%-.192s' (errno: %d - %s)", nil), - ErrConCount: mysql.Message("Too many connections", nil), - ErrOutOfResources: mysql.Message("Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", nil), - ErrBadHost: mysql.Message("Can't get hostname for your address", nil), - ErrHandshake: mysql.Message("Bad handshake", nil), - ErrDBaccessDenied: mysql.Message("Access denied for user '%-.48s'@'%-.255s' to database '%-.192s'", nil), - ErrAccessDenied: mysql.Message("Access denied for user '%-.48s'@'%-.255s' (using password: %s)", nil), - ErrNoDB: mysql.Message("No database selected", nil), - ErrUnknownCom: mysql.Message("Unknown command", nil), - ErrBadNull: mysql.Message("Column '%-.192s' cannot be null", nil), - ErrBadDB: mysql.Message("Unknown database '%-.192s'", nil), - ErrTableExists: mysql.Message("Table '%-.192s' already exists", nil), - ErrBadTable: mysql.Message("Unknown table '%-.100s'", nil), - ErrNonUniq: mysql.Message("Column '%-.192s' in %-.192s is ambiguous", nil), - ErrServerShutdown: mysql.Message("Server shutdown in progress", nil), - ErrBadField: mysql.Message("Unknown column '%-.192s' in '%-.192s'", nil), - ErrFieldNotInGroupBy: mysql.Message("Expression #%d of %s is not in GROUP BY clause and contains nonaggregated column '%s' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by", nil), - ErrWrongGroupField: mysql.Message("Can't group on '%-.192s'", nil), - ErrWrongSumSelect: mysql.Message("Statement has sum functions and columns in same statement", nil), - ErrWrongValueCount: mysql.Message("Column count doesn't match value count", nil), - ErrTooLongIdent: mysql.Message("Identifier name '%-.100s' is too long", nil), - ErrDupFieldName: mysql.Message("Duplicate column name '%-.192s'", nil), - ErrDupKeyName: mysql.Message("Duplicate key name '%-.192s'", nil), - ErrDupEntry: mysql.Message("Duplicate entry '%-.64s' for key '%-.192s'", []int{0}), - ErrWrongFieldSpec: mysql.Message("Incorrect column specifier for column '%-.192s'", nil), - ErrParse: mysql.Message("%s %s", nil), - ErrEmptyQuery: mysql.Message("Query was empty", nil), - ErrNonuniqTable: mysql.Message("Not unique table/alias: '%-.192s'", nil), - ErrInvalidDefault: mysql.Message("Invalid default value for '%-.192s'", nil), - ErrMultiplePriKey: mysql.Message("Multiple primary key defined", nil), - ErrTooManyKeys: mysql.Message("Too many keys specified; max %d keys allowed", nil), - ErrTooManyKeyParts: mysql.Message("Too many key parts specified; max %d parts allowed", nil), - ErrTooLongKey: mysql.Message("Specified key was too long (%d bytes); max key length is %d bytes", nil), - ErrKeyColumnDoesNotExits: mysql.Message("Key column '%-.192s' doesn't exist in table", nil), - ErrBlobUsedAsKey: mysql.Message("BLOB column '%-.192s' can't be used in key specification with the used table type", nil), - ErrJSONVacuousPath: mysql.Message("The path expression '$' is not allowed in this context.", nil), - ErrJSONBadOneOrAllArg: mysql.Message("The oneOrAll argument to %s may take these values: 'one' or 'all'.", nil), - ErrTooBigFieldlength: mysql.Message("Column length too big for column '%-.192s' (max = %d); use BLOB or TEXT instead", nil), - ErrWrongAutoKey: mysql.Message("Incorrect table definition; there can be only one auto column and it must be defined as a key", nil), - ErrReady: mysql.Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d", nil), - ErrNormalShutdown: mysql.Message("%s: Normal shutdown\n", nil), - ErrGotSignal: mysql.Message("%s: Got signal %d. Aborting!\n", nil), - ErrShutdownComplete: mysql.Message("%s: Shutdown complete\n", nil), - ErrForcingClose: mysql.Message("%s: Forcing close of thread %d user: '%-.48s'\n", nil), - ErrIpsock: mysql.Message("Can't create IP socket", nil), - ErrNoSuchIndex: mysql.Message("Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table", nil), - ErrWrongFieldTerminators: mysql.Message("Field separator argument is not what is expected; check the manual", nil), - ErrBlobsAndNoTerminated: mysql.Message("You can't use fixed rowlength with BLOBs; please use 'fields terminated by'", nil), - ErrTextFileNotReadable: mysql.Message("The file '%-.128s' must be in the database directory or be readable by all", nil), - ErrFileExists: mysql.Message("File '%-.200s' already exists", nil), - ErrLoadInfo: mysql.Message("Records: %d Deleted: %d Skipped: %d Warnings: %d", nil), - ErrAlterInfo: mysql.Message("Records: %d Duplicates: %d", nil), - ErrWrongSubKey: mysql.Message("Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys", nil), - ErrCantRemoveAllFields: mysql.Message("You can't delete all columns with ALTER TABLE; use DROP TABLE instead", nil), - ErrCantDropFieldOrKey: mysql.Message("Can't DROP '%-.192s'; check that column/key exists", nil), - ErrInsertInfo: mysql.Message("Records: %d Duplicates: %d Warnings: %d", nil), - ErrUpdateTableUsed: mysql.Message("You can't specify target table '%-.192s' for update in FROM clause", nil), - ErrNoSuchThread: mysql.Message("Unknown thread id: %d", nil), - ErrKillDenied: mysql.Message("You are not owner of thread %d", nil), - ErrNoTablesUsed: mysql.Message("No tables used", nil), - ErrTooBigSet: mysql.Message("Too many strings for column %-.192s and SET", nil), - ErrNoUniqueLogFile: mysql.Message("Can't generate a unique log-filename %-.200s.(1-999)\n", nil), - ErrTableNotLockedForWrite: mysql.Message("Table '%-.192s' was locked with a READ lock and can't be updated", nil), - ErrTableNotLocked: mysql.Message("Table '%-.192s' was not locked with LOCK TABLES", nil), - ErrBlobCantHaveDefault: mysql.Message("BLOB/TEXT/JSON column '%-.192s' can't have a default value", nil), - ErrWrongDBName: mysql.Message("Incorrect database name '%-.100s'", nil), - ErrWrongTableName: mysql.Message("Incorrect table name '%-.100s'", nil), - ErrTooBigSelect: mysql.Message("The SELECT would examine more than MAXJOINSIZE rows; check your WHERE and use SET SQLBIGSELECTS=1 or SET MAXJOINSIZE=# if the SELECT is okay", nil), - ErrUnknown: mysql.Message("Unknown error", nil), - ErrUnknownProcedure: mysql.Message("Unknown procedure '%-.192s'", nil), - ErrWrongParamcountToProcedure: mysql.Message("Incorrect parameter count to procedure '%-.192s'", nil), - ErrWrongParametersToProcedure: mysql.Message("Incorrect parameters to procedure '%-.192s'", nil), - ErrUnknownTable: mysql.Message("Unknown table '%-.192s' in %-.32s", nil), - ErrFieldSpecifiedTwice: mysql.Message("Column '%-.192s' specified twice", nil), - ErrInvalidGroupFuncUse: mysql.Message("Invalid use of group function", nil), - ErrUnsupportedExtension: mysql.Message("Table '%-.192s' uses an extension that doesn't exist in this MySQL version", nil), - ErrTableMustHaveColumns: mysql.Message("A table must have at least 1 column", nil), - ErrRecordFileFull: mysql.Message("The table '%-.192s' is full", nil), - ErrUnknownCharacterSet: mysql.Message("Unknown character set: '%-.64s'", nil), - ErrTooManyTables: mysql.Message("Too many tables; MySQL can only use %d tables in a join", nil), - ErrTooManyFields: mysql.Message("Too many columns", nil), - ErrTooBigRowsize: mysql.Message("Row size too large. The maximum row size for the used table type, not counting BLOBs, is %d. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs", nil), - ErrStackOverrun: mysql.Message("Thread stack overrun: Used: %d of a %d stack. Use 'mysqld --threadStack=#' to specify a bigger stack if needed", nil), - ErrWrongOuterJoin: mysql.Message("Cross dependency found in OUTER JOIN; examine your ON conditions", nil), - ErrNullColumnInIndex: mysql.Message("Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler", nil), - ErrCantFindUdf: mysql.Message("Can't load function '%-.192s'", nil), - ErrCantInitializeUdf: mysql.Message("Can't initialize function '%-.192s'; %-.80s", nil), - ErrUdfNoPaths: mysql.Message("No paths allowed for shared library", nil), - ErrUdfExists: mysql.Message("Function '%-.192s' already exists", nil), - ErrCantOpenLibrary: mysql.Message("Can't open shared library '%-.192s' (errno: %d %-.128s)", nil), - ErrCantFindDlEntry: mysql.Message("Can't find symbol '%-.128s' in library", nil), - ErrFunctionNotDefined: mysql.Message("Function '%-.192s' is not defined", nil), - ErrHostIsBlocked: mysql.Message("Host '%-.255s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", nil), - ErrHostNotPrivileged: mysql.Message("Host '%-.255s' is not allowed to connect to this MySQL server", nil), - ErrPasswordAnonymousUser: mysql.Message("You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", nil), - ErrPasswordNotAllowed: mysql.Message("You must have privileges to update tables in the mysql database to be able to change passwords for others", nil), - ErrPasswordNoMatch: mysql.Message("Can't find any matching row in the user table", nil), - ErrUpdateInfo: mysql.Message("Rows matched: %d Changed: %d Warnings: %d", nil), - ErrCantCreateThread: mysql.Message("Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", nil), - ErrWrongValueCountOnRow: mysql.Message("Column count doesn't match value count at row %d", nil), - ErrCantReopenTable: mysql.Message("Can't reopen table: '%-.192s'", nil), - ErrInvalidUseOfNull: mysql.Message("Invalid use of NULL value", nil), - ErrRegexp: mysql.Message("Got error '%-.64s' from regexp", nil), - ErrMixOfGroupFuncAndFields: mysql.Message("Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", nil), - ErrNonexistingGrant: mysql.Message("There is no such grant defined for user '%-.48s' on host '%-.255s'", nil), - ErrTableaccessDenied: mysql.Message("%-.128s command denied to user '%-.48s'@'%-.255s' for table '%-.64s'", nil), - ErrColumnaccessDenied: mysql.Message("%-.16s command denied to user '%-.48s'@'%-.255s' for column '%-.192s' in table '%-.192s'", nil), - ErrIllegalGrantForTable: mysql.Message("Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used", nil), - ErrGrantWrongHostOrUser: mysql.Message("The host or user argument to GRANT is too long", nil), - ErrNoSuchTable: mysql.Message("Table '%-.192s.%-.192s' doesn't exist", nil), - ErrNonexistingTableGrant: mysql.Message("There is no such grant defined for user '%-.48s' on host '%-.255s' on table '%-.192s'", nil), - ErrNotAllowedCommand: mysql.Message("The used command is not allowed with this MySQL version", nil), - ErrSyntax: mysql.Message("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use", nil), - ErrDelayedCantChangeLock: mysql.Message("Delayed insert thread couldn't get requested lock for table %-.192s", nil), - ErrTooManyDelayedThreads: mysql.Message("Too many delayed threads in use", nil), - ErrAbortingConnection: mysql.Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' (%-.64s)", nil), - ErrNetPacketTooLarge: mysql.Message("Got a packet bigger than 'max_allowed_packet' bytes", nil), - ErrNetReadErrorFromPipe: mysql.Message("Got a read error from the connection pipe", nil), - ErrNetFcntl: mysql.Message("Got an error from fcntl()", nil), - ErrNetPacketsOutOfOrder: mysql.Message("Got packets out of order", nil), - ErrNetUncompress: mysql.Message("Couldn't uncompress communication packet", nil), - ErrNetRead: mysql.Message("Got an error reading communication packets", nil), - ErrNetReadInterrupted: mysql.Message("Got timeout reading communication packets", nil), - ErrNetErrorOnWrite: mysql.Message("Got an error writing communication packets", nil), - ErrNetWriteInterrupted: mysql.Message("Got timeout writing communication packets", nil), - ErrTooLongString: mysql.Message("Result string is longer than 'maxAllowedPacket' bytes", nil), - ErrTableCantHandleBlob: mysql.Message("The used table type doesn't support BLOB/TEXT columns", nil), - ErrTableCantHandleAutoIncrement: mysql.Message("The used table type doesn't support AUTOINCREMENT columns", nil), - ErrDelayedInsertTableLocked: mysql.Message("INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES", nil), - ErrWrongColumnName: mysql.Message("Incorrect column name '%-.100s'", nil), - ErrWrongKeyColumn: mysql.Message("The used storage engine can't index column '%-.192s'", nil), - ErrWrongMrgTable: mysql.Message("Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist", nil), - ErrDupUnique: mysql.Message("Can't write, because of unique constraint, to table '%-.192s'", nil), - ErrBlobKeyWithoutLength: mysql.Message("BLOB/TEXT column '%-.192s' used in key specification without a key length", nil), - ErrPrimaryCantHaveNull: mysql.Message("All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", nil), - ErrTooManyRows: mysql.Message("Result consisted of more than one row", nil), - ErrRequiresPrimaryKey: mysql.Message("This table type requires a primary key", nil), - ErrNoRaidCompiled: mysql.Message("This version of MySQL is not compiled with RAID support", nil), - ErrUpdateWithoutKeyInSafeMode: mysql.Message("You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", nil), - ErrKeyDoesNotExist: mysql.Message("Key '%-.192s' doesn't exist in table '%-.192s'", nil), - ErrCheckNoSuchTable: mysql.Message("Can't open table", nil), - ErrCheckNotImplemented: mysql.Message("The storage engine for the table doesn't support %s", nil), - ErrCantDoThisDuringAnTransaction: mysql.Message("You are not allowed to execute this command in a transaction", nil), - ErrErrorDuringCommit: mysql.Message("Got error %d during COMMIT", nil), - ErrErrorDuringRollback: mysql.Message("Got error %d during ROLLBACK", nil), - ErrErrorDuringFlushLogs: mysql.Message("Got error %d during FLUSHLOGS", nil), - ErrErrorDuringCheckpoint: mysql.Message("Got error %d during CHECKPOINT", nil), - ErrNewAbortingConnection: mysql.Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' host: '%-.255s' (%-.64s)", nil), - ErrDumpNotImplemented: mysql.Message("The storage engine for the table does not support binary table dump", nil), - ErrFlushMasterBinlogClosed: mysql.Message("Binlog closed, cannot RESET MASTER", nil), - ErrIndexRebuild: mysql.Message("Failed rebuilding the index of dumped table '%-.192s'", nil), - ErrMaster: mysql.Message("Error from master: '%-.64s'", nil), - ErrMasterNetRead: mysql.Message("Net error reading from master", nil), - ErrMasterNetWrite: mysql.Message("Net error writing to master", nil), - ErrFtMatchingKeyNotFound: mysql.Message("Can't find FULLTEXT index matching the column list", nil), - ErrLockOrActiveTransaction: mysql.Message("Can't execute the given command because you have active locked tables or an active transaction", nil), - ErrUnknownSystemVariable: mysql.Message("Unknown system variable '%-.64s'", nil), - ErrCrashedOnUsage: mysql.Message("Table '%-.192s' is marked as crashed and should be repaired", nil), - ErrCrashedOnRepair: mysql.Message("Table '%-.192s' is marked as crashed and last (automatic?) repair failed", nil), - ErrWarningNotCompleteRollback: mysql.Message("Some non-transactional changed tables couldn't be rolled back", nil), - ErrTransCacheFull: mysql.Message("Multi-statement transaction required more than 'maxBinlogCacheSize' bytes of storage; increase this mysqld variable and try again", nil), - ErrSlaveMustStop: mysql.Message("This operation cannot be performed with a running slave; run STOP SLAVE first", nil), - ErrSlaveNotRunning: mysql.Message("This operation requires a running slave; configure slave and do START SLAVE", nil), - ErrBadSlave: mysql.Message("The server is not configured as slave; fix in config file or with CHANGE MASTER TO", nil), - ErrMasterInfo: mysql.Message("Could not initialize master info structure; more error messages can be found in the MySQL error log", nil), - ErrSlaveThread: mysql.Message("Could not create slave thread; check system resources", nil), - ErrTooManyUserConnections: mysql.Message("User %-.64s already has more than 'maxUserConnections' active connections", nil), - ErrSetConstantsOnly: mysql.Message("You may only use constant expressions with SET", nil), - ErrLockWaitTimeout: mysql.Message("Lock wait timeout exceeded; try restarting transaction", nil), - ErrLockTableFull: mysql.Message("The total number of locks exceeds the lock table size", nil), - ErrReadOnlyTransaction: mysql.Message("Update locks cannot be acquired during a READ UNCOMMITTED transaction", nil), - ErrDropDBWithReadLock: mysql.Message("DROP DATABASE not allowed while thread is holding global read lock", nil), - ErrCreateDBWithReadLock: mysql.Message("CREATE DATABASE not allowed while thread is holding global read lock", nil), - ErrWrongArguments: mysql.Message("Incorrect arguments to %s", nil), - ErrNoPermissionToCreateUser: mysql.Message("'%-.48s'@'%-.255s' is not allowed to create new users", nil), - ErrUnionTablesInDifferentDir: mysql.Message("Incorrect table definition; all MERGE tables must be in the same database", nil), - ErrLockDeadlock: mysql.Message("Deadlock found when trying to get lock; try restarting transaction", nil), - ErrTableCantHandleFt: mysql.Message("The used table type doesn't support FULLTEXT indexes", nil), - ErrCannotAddForeign: mysql.Message("Cannot add foreign key constraint", nil), - ErrNoReferencedRow: mysql.Message("Cannot add or update a child row: a foreign key constraint fails", nil), - ErrRowIsReferenced: mysql.Message("Cannot delete or update a parent row: a foreign key constraint fails", nil), - ErrConnectToMaster: mysql.Message("Error connecting to master: %-.128s", nil), - ErrQueryOnMaster: mysql.Message("Error running query on master: %-.128s", nil), - ErrErrorWhenExecutingCommand: mysql.Message("Error when executing command %s: %-.128s", nil), - ErrWrongUsage: mysql.Message("Incorrect usage of %s and %s", nil), - ErrWrongNumberOfColumnsInSelect: mysql.Message("The used SELECT statements have a different number of columns", nil), - ErrCantUpdateWithReadlock: mysql.Message("Can't execute the query because you have a conflicting read lock", nil), - ErrMixingNotAllowed: mysql.Message("Mixing of transactional and non-transactional tables is disabled", nil), - ErrDupArgument: mysql.Message("Option '%s' used twice in statement", nil), - ErrUserLimitReached: mysql.Message("User '%-.64s' has exceeded the '%s' resource (current value: %d)", nil), - ErrSpecificAccessDenied: mysql.Message("Access denied; you need (at least one of) the %-.128s privilege(s) for this operation", nil), - ErrLocalVariable: mysql.Message("Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", nil), - ErrGlobalVariable: mysql.Message("Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", nil), - ErrNoDefault: mysql.Message("Variable '%-.64s' doesn't have a default value", nil), - ErrWrongValueForVar: mysql.Message("Variable '%-.64s' can't be set to the value of '%-.200s'", nil), - ErrWrongTypeForVar: mysql.Message("Incorrect argument type to variable '%-.64s'", nil), - ErrVarCantBeRead: mysql.Message("Variable '%-.64s' can only be set, not read", nil), - ErrCantUseOptionHere: mysql.Message("Incorrect usage/placement of '%s'", nil), - ErrNotSupportedYet: mysql.Message("This version of TiDB doesn't yet support '%s'", nil), - ErrMasterFatalErrorReadingBinlog: mysql.Message("Got fatal error %d from master when reading data from binary log: '%-.320s'", nil), - ErrSlaveIgnoredTable: mysql.Message("Slave SQL thread ignored the query because of replicate-*-table rules", nil), - ErrIncorrectGlobalLocalVar: mysql.Message("Variable '%-.192s' is a %s variable", nil), - ErrWrongFkDef: mysql.Message("Incorrect foreign key definition for '%-.192s': %s", nil), - ErrKeyRefDoNotMatchTableRef: mysql.Message("Key reference and table reference don't match", nil), - ErrOperandColumns: mysql.Message("Operand should contain %d column(s)", nil), - ErrSubqueryNo1Row: mysql.Message("Subquery returns more than 1 row", nil), - ErrUnknownStmtHandler: mysql.Message("Unknown prepared statement handler (%.*s) given to %s", nil), - ErrCorruptHelpDB: mysql.Message("Help database is corrupt or does not exist", nil), - ErrCyclicReference: mysql.Message("Cyclic reference on subqueries", nil), - ErrAutoConvert: mysql.Message("Converting column '%s' from %s to %s", nil), - ErrIllegalReference: mysql.Message("Reference '%-.64s' not supported (%s)", nil), - ErrDerivedMustHaveAlias: mysql.Message("Every derived table must have its own alias", nil), - ErrSelectReduced: mysql.Message("Select %d was reduced during optimization", nil), - ErrTablenameNotAllowedHere: mysql.Message("Table '%s' from one of the %ss cannot be used in %s", nil), - ErrNotSupportedAuthMode: mysql.Message("Client does not support authentication protocol requested by server; consider upgrading MySQL client", nil), - ErrSpatialCantHaveNull: mysql.Message("All parts of a SPATIAL index must be NOT NULL", nil), - ErrCollationCharsetMismatch: mysql.Message("COLLATION '%s' is not valid for CHARACTER SET '%s'", nil), - ErrSlaveWasRunning: mysql.Message("Slave is already running", nil), - ErrSlaveWasNotRunning: mysql.Message("Slave already has been stopped", nil), - ErrTooBigForUncompress: mysql.Message("Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", nil), - ErrZlibZMem: mysql.Message("ZLIB: Not enough memory", nil), - ErrZlibZBuf: mysql.Message("ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", nil), - ErrZlibZData: mysql.Message("ZLIB: Input data corrupted", nil), - ErrCutValueGroupConcat: mysql.Message("Some rows were cut by GROUPCONCAT(%s)", []int{0}), - ErrWarnTooFewRecords: mysql.Message("Row %d doesn't contain data for all columns", nil), - ErrWarnTooManyRecords: mysql.Message("Row %d was truncated; it contained more data than there were input columns", nil), - ErrWarnNullToNotnull: mysql.Message("Column set to default value; NULL supplied to NOT NULL column '%s' at row %d", nil), - ErrWarnDataOutOfRange: mysql.Message("Out of range value for column '%s' at row %d", nil), - WarnDataTruncated: mysql.Message("Data truncated for column '%s' at row %d", nil), - ErrWarnUsingOtherHandler: mysql.Message("Using storage engine %s for table '%s'", nil), - ErrCantAggregate2collations: mysql.Message("Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", nil), - ErrDropUser: mysql.Message("Cannot drop one or more of the requested users", nil), - ErrRevokeGrants: mysql.Message("Can't revoke all privileges for one or more of the requested users", nil), - ErrCantAggregate3collations: mysql.Message("Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", nil), - ErrCantAggregateNcollations: mysql.Message("Illegal mix of collations for operation '%s'", nil), - ErrVariableIsNotStruct: mysql.Message("Variable '%-.64s' is not a variable component (can't be used as XXXX.variableName)", nil), - ErrUnknownCollation: mysql.Message("Unknown collation: '%-.64s'", nil), - ErrSlaveIgnoredSslParams: mysql.Message("SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", nil), - ErrServerIsInSecureAuthMode: mysql.Message("Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", nil), - ErrWarnFieldResolved: mysql.Message("Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d", nil), - ErrBadSlaveUntilCond: mysql.Message("Incorrect parameter or combination of parameters for START SLAVE UNTIL", nil), - ErrMissingSkipSlave: mysql.Message("It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart", nil), - ErrUntilCondIgnored: mysql.Message("SQL thread is not to be started so UNTIL options are ignored", nil), - ErrWrongNameForIndex: mysql.Message("Incorrect index name '%-.100s'", nil), - ErrWrongNameForCatalog: mysql.Message("Incorrect catalog name '%-.100s'", nil), - ErrWarnQcResize: mysql.Message("Query cache failed to set size %d; new query cache size is %d", nil), - ErrBadFtColumn: mysql.Message("Column '%-.192s' cannot be part of FULLTEXT index", nil), - ErrUnknownKeyCache: mysql.Message("Unknown key cache '%-.100s'", nil), - ErrWarnHostnameWontWork: mysql.Message("MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work", nil), - ErrUnknownStorageEngine: mysql.Message("Unknown storage engine '%s'", nil), - ErrWarnDeprecatedSyntax: mysql.Message("'%s' is deprecated and will be removed in a future release. Please use %s instead", nil), - ErrNonUpdatableTable: mysql.Message("The target table %-.100s of the %s is not updatable", nil), - ErrFeatureDisabled: mysql.Message("The '%s' feature is disabled; you need MySQL built with '%s' to have it working", nil), - ErrOptionPreventsStatement: mysql.Message("The MySQL server is running with the %s option so it cannot execute this statement", nil), - ErrDuplicatedValueInType: mysql.Message("Column '%-.100s' has duplicated value '%-.64s' in %s", []int{1}), - ErrTruncatedWrongValue: mysql.Message("Truncated incorrect %-.64s value: '%-.128s'", []int{1}), - ErrTooMuchAutoTimestampCols: mysql.Message("Incorrect table definition; there can be only one TIMESTAMP column with CURRENTTIMESTAMP in DEFAULT or ON UPDATE clause", nil), - ErrInvalidOnUpdate: mysql.Message("Invalid ON UPDATE clause for '%-.192s' column", nil), - ErrUnsupportedPs: mysql.Message("This command is not supported in the prepared statement protocol yet", nil), - ErrGetErrmsg: mysql.Message("Got error %d '%-.100s' from %s", nil), - ErrGetTemporaryErrmsg: mysql.Message("Got temporary error %d '%-.100s' from %s", nil), - ErrUnknownTimeZone: mysql.Message("Unknown or incorrect time zone: '%-.64s'", nil), - ErrWarnInvalidTimestamp: mysql.Message("Invalid TIMESTAMP value in column '%s' at row %d", nil), - ErrInvalidCharacterString: mysql.Message("Invalid %s character string: '%.64s'", []int{1}), - ErrWarnAllowedPacketOverflowed: mysql.Message("Result of %s() was larger than max_allowed_packet (%d) - truncated", nil), - ErrConflictingDeclarations: mysql.Message("Conflicting declarations: '%s%s' and '%s%s'", nil), - ErrSpNoRecursiveCreate: mysql.Message("Can't create a %s from within another stored routine", nil), - ErrSpAlreadyExists: mysql.Message("%s %s already exists", nil), - ErrSpDoesNotExist: mysql.Message("%s %s does not exist", nil), - ErrSpDropFailed: mysql.Message("Failed to DROP %s %s", nil), - ErrSpStoreFailed: mysql.Message("Failed to CREATE %s %s", nil), - ErrSpLilabelMismatch: mysql.Message("%s with no matching label: %s", nil), - ErrSpLabelRedefine: mysql.Message("Redefining label %s", nil), - ErrSpLabelMismatch: mysql.Message("End-label %s without match", nil), - ErrSpUninitVar: mysql.Message("Referring to uninitialized variable %s", nil), - ErrSpBadselect: mysql.Message("PROCEDURE %s can't return a result set in the given context", nil), - ErrSpBadreturn: mysql.Message("RETURN is only allowed in a FUNCTION", nil), - ErrSpBadstatement: mysql.Message("%s is not allowed in stored procedures", nil), - ErrUpdateLogDeprecatedIgnored: mysql.Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been ignored.", nil), - ErrUpdateLogDeprecatedTranslated: mysql.Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been translated to SET SQLLOGBIN.", nil), - ErrQueryInterrupted: mysql.Message("Query execution was interrupted", nil), - ErrSpWrongNoOfArgs: mysql.Message("Incorrect number of arguments for %s %s; expected %d, got %d", nil), - ErrSpCondMismatch: mysql.Message("Undefined CONDITION: %s", nil), - ErrSpNoreturn: mysql.Message("No RETURN found in FUNCTION %s", nil), - ErrSpNoreturnend: mysql.Message("FUNCTION %s ended without RETURN", nil), - ErrSpBadCursorQuery: mysql.Message("Cursor statement must be a SELECT", nil), - ErrSpBadCursorSelect: mysql.Message("Cursor SELECT must not have INTO", nil), - ErrSpCursorMismatch: mysql.Message("Undefined CURSOR: %s", nil), - ErrSpCursorAlreadyOpen: mysql.Message("Cursor is already open", nil), - ErrSpCursorNotOpen: mysql.Message("Cursor is not open", nil), - ErrSpUndeclaredVar: mysql.Message("Undeclared variable: %s", nil), - ErrSpWrongNoOfFetchArgs: mysql.Message("Incorrect number of FETCH variables", nil), - ErrSpFetchNoData: mysql.Message("No data - zero rows fetched, selected, or processed", nil), - ErrSpDupParam: mysql.Message("Duplicate parameter: %s", nil), - ErrSpDupVar: mysql.Message("Duplicate variable: %s", nil), - ErrSpDupCond: mysql.Message("Duplicate condition: %s", nil), - ErrSpDupCurs: mysql.Message("Duplicate cursor: %s", nil), - ErrSpCantAlter: mysql.Message("Failed to ALTER %s %s", nil), - ErrSpSubselectNyi: mysql.Message("Subquery value not supported", nil), - ErrStmtNotAllowedInSfOrTrg: mysql.Message("%s is not allowed in stored function or trigger", nil), - ErrSpVarcondAfterCurshndlr: mysql.Message("Variable or condition declaration after cursor or handler declaration", nil), - ErrSpCursorAfterHandler: mysql.Message("Cursor declaration after handler declaration", nil), - ErrSpCaseNotFound: mysql.Message("Case not found for CASE statement", nil), - ErrFparserTooBigFile: mysql.Message("Configuration file '%-.192s' is too big", nil), - ErrFparserBadHeader: mysql.Message("Malformed file type header in file '%-.192s'", nil), - ErrFparserEOFInComment: mysql.Message("Unexpected end of file while parsing comment '%-.200s'", nil), - ErrFparserErrorInParameter: mysql.Message("Error while parsing parameter '%-.192s' (line: '%-.192s')", nil), - ErrFparserEOFInUnknownParameter: mysql.Message("Unexpected end of file while skipping unknown parameter '%-.192s'", nil), - ErrViewNoExplain: mysql.Message("EXPLAIN/SHOW can not be issued; lacking privileges for underlying table", nil), - ErrFrmUnknownType: mysql.Message("File '%-.192s' has unknown type '%-.64s' in its header", nil), - ErrWrongObject: mysql.Message("'%-.192s.%-.192s' is not %s", nil), - ErrNonupdateableColumn: mysql.Message("Column '%-.192s' is not updatable", nil), - ErrViewSelectDerived: mysql.Message("View's SELECT contains a subquery in the FROM clause", nil), - ErrViewSelectClause: mysql.Message("View's SELECT contains a '%s' clause", nil), - ErrViewSelectVariable: mysql.Message("View's SELECT contains a variable or parameter", nil), - ErrViewSelectTmptable: mysql.Message("View's SELECT refers to a temporary table '%-.192s'", nil), - ErrViewWrongList: mysql.Message("In definition of view, derived table or common table expression, SELECT list and column names list have different column counts", nil), - ErrWarnViewMerge: mysql.Message("View merge algorithm can't be used here for now (assumed undefined algorithm)", nil), - ErrWarnViewWithoutKey: mysql.Message("View being updated does not have complete key of underlying table in it", nil), - ErrViewInvalid: mysql.Message("View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them", nil), - ErrSpNoDropSp: mysql.Message("Can't drop or alter a %s from within another stored routine", nil), - ErrSpGotoInHndlr: mysql.Message("GOTO is not allowed in a stored procedure handler", nil), - ErrTrgAlreadyExists: mysql.Message("Trigger already exists", nil), - ErrTrgDoesNotExist: mysql.Message("Trigger does not exist", nil), - ErrTrgOnViewOrTempTable: mysql.Message("Trigger's '%-.192s' is view or temporary table", nil), - ErrTrgCantChangeRow: mysql.Message("Updating of %s row is not allowed in %strigger", nil), - ErrTrgNoSuchRowInTrg: mysql.Message("There is no %s row in %s trigger", nil), - ErrNoDefaultForField: mysql.Message("Field '%-.192s' doesn't have a default value", nil), - ErrDivisionByZero: mysql.Message("Division by 0", nil), - ErrTruncatedWrongValueForField: mysql.Message("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %d", []int{0, 1}), - ErrIllegalValueForType: mysql.Message("Illegal %s '%-.192s' value found during parsing", []int{1}), - ErrViewNonupdCheck: mysql.Message("CHECK OPTION on non-updatable view '%-.192s.%-.192s'", nil), - ErrViewCheckFailed: mysql.Message("CHECK OPTION failed '%-.192s.%-.192s'", nil), - ErrProcaccessDenied: mysql.Message("%-.16s command denied to user '%-.48s'@'%-.255s' for routine '%-.192s'", nil), - ErrRelayLogFail: mysql.Message("Failed purging old relay logs: %s", nil), - ErrPasswdLength: mysql.Message("Password hash should be a %d-digit hexadecimal number", nil), - ErrUnknownTargetBinlog: mysql.Message("Target log not found in binlog index", nil), - ErrIoErrLogIndexRead: mysql.Message("I/O error reading log index file", nil), - ErrBinlogPurgeProhibited: mysql.Message("Server configuration does not permit binlog purge", nil), - ErrFseekFail: mysql.Message("Failed on fseek()", nil), - ErrBinlogPurgeFatalErr: mysql.Message("Fatal error during log purge", nil), - ErrLogInUse: mysql.Message("A purgeable log is in use, will not purge", nil), - ErrLogPurgeUnknownErr: mysql.Message("Unknown error during log purge", nil), - ErrRelayLogInit: mysql.Message("Failed initializing relay log position: %s", nil), - ErrNoBinaryLogging: mysql.Message("You are not using binary logging", nil), - ErrReservedSyntax: mysql.Message("The '%-.64s' syntax is reserved for purposes internal to the MySQL server", nil), - ErrWsasFailed: mysql.Message("WSAStartup Failed", nil), - ErrDiffGroupsProc: mysql.Message("Can't handle procedures with different groups yet", nil), - ErrNoGroupForProc: mysql.Message("Select must have a group with this procedure", nil), - ErrOrderWithProc: mysql.Message("Can't use ORDER clause with this procedure", nil), - ErrLoggingProhibitChangingOf: mysql.Message("Binary logging and replication forbid changing the global server %s", nil), - ErrNoFileMapping: mysql.Message("Can't map file: %-.200s, errno: %d", nil), - ErrWrongMagic: mysql.Message("Wrong magic in %-.64s", nil), - ErrPsManyParam: mysql.Message("Prepared statement contains too many placeholders", nil), - ErrKeyPart0: mysql.Message("Key part '%-.192s' length cannot be 0", nil), - ErrViewChecksum: mysql.Message("View text checksum failed", nil), - ErrViewMultiupdate: mysql.Message("Can not modify more than one base table through a join view '%-.192s.%-.192s'", nil), - ErrViewNoInsertFieldList: mysql.Message("Can not insert into join view '%-.192s.%-.192s' without fields list", nil), - ErrViewDeleteMergeView: mysql.Message("Can not delete from join view '%-.192s.%-.192s'", nil), - ErrCannotUser: mysql.Message("Operation %s failed for %.256s", nil), - ErrGrantRole: mysql.Message("Unknown authorization ID %.256s", nil), - ErrXaerNota: mysql.Message("XAERNOTA: Unknown XID", nil), - ErrXaerInval: mysql.Message("XAERINVAL: Invalid arguments (or unsupported command)", nil), - ErrXaerRmfail: mysql.Message("XAERRMFAIL: The command cannot be executed when global transaction is in the %.64s state", nil), - ErrXaerOutside: mysql.Message("XAEROUTSIDE: Some work is done outside global transaction", nil), - ErrXaerRmerr: mysql.Message("XAERRMERR: Fatal error occurred in the transaction branch - check your data for consistency", nil), - ErrXaRbrollback: mysql.Message("XARBROLLBACK: Transaction branch was rolled back", nil), - ErrNonexistingProcGrant: mysql.Message("There is no such grant defined for user '%-.48s' on host '%-.255s' on routine '%-.192s'", nil), - ErrProcAutoGrantFail: mysql.Message("Failed to grant EXECUTE and ALTER ROUTINE privileges", nil), - ErrProcAutoRevokeFail: mysql.Message("Failed to revoke all privileges to dropped routine", nil), - ErrDataTooLong: mysql.Message("Data too long for column '%s' at row %d", nil), - ErrSpBadSQLstate: mysql.Message("Bad SQLSTATE: '%s'", nil), - ErrStartup: mysql.Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d %s", nil), - ErrLoadFromFixedSizeRowsToVar: mysql.Message("Can't load value from file with fixed size rows to variable", nil), - ErrCantCreateUserWithGrant: mysql.Message("You are not allowed to create a user with GRANT", nil), - ErrWrongValueForType: mysql.Message("Incorrect %-.32s value: '%-.128s' for function %-.32s", nil), - ErrTableDefChanged: mysql.Message("Table definition has changed, please retry transaction", nil), - ErrSpDupHandler: mysql.Message("Duplicate handler declared in the same block", nil), - ErrSpNotVarArg: mysql.Message("OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger", nil), - ErrSpNoRetset: mysql.Message("Not allowed to return a result set from a %s", nil), - ErrCantCreateGeometryObject: mysql.Message("Cannot get geometry object from data you send to the GEOMETRY field", nil), - ErrFailedRoutineBreakBinlog: mysql.Message("A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes", nil), - ErrBinlogUnsafeRoutine: mysql.Message("This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), - ErrBinlogCreateRoutineNeedSuper: mysql.Message("You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), - ErrExecStmtWithOpenCursor: mysql.Message("You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it.", nil), - ErrStmtHasNoOpenCursor: mysql.Message("The statement (%d) has no open cursor.", nil), - ErrCommitNotAllowedInSfOrTrg: mysql.Message("Explicit or implicit commit is not allowed in stored function or trigger.", nil), - ErrNoDefaultForViewField: mysql.Message("Field of view '%-.192s.%-.192s' underlying table doesn't have a default value", nil), - ErrSpNoRecursion: mysql.Message("Recursive stored functions and triggers are not allowed.", nil), - ErrTooBigScale: mysql.Message("Too big scale %d specified for column '%-.192s'. Maximum is %d.", nil), - ErrTooBigPrecision: mysql.Message("Too-big precision %d specified for '%-.192s'. Maximum is %d.", nil), - ErrMBiggerThanD: mysql.Message("For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s').", nil), - ErrWrongLockOfSystemTable: mysql.Message("You can't combine write-locking of system tables with other tables or lock types", nil), - ErrConnectToForeignDataSource: mysql.Message("Unable to connect to foreign data source: %.64s", nil), - ErrQueryOnForeignDataSource: mysql.Message("There was a problem processing the query on the foreign data source. Data source : %-.64s", nil), - ErrForeignDataSourceDoesntExist: mysql.Message("The foreign data source you are trying to reference does not exist. Data source : %-.64s", nil), - ErrForeignDataStringInvalidCantCreate: mysql.Message("Can't create federated table. The data source connection string '%-.64s' is not in the correct format", nil), - ErrForeignDataStringInvalid: mysql.Message("The data source connection string '%-.64s' is not in the correct format", nil), - ErrCantCreateFederatedTable: mysql.Message("Can't create federated table. Foreign data src : %-.64s", nil), - ErrTrgInWrongSchema: mysql.Message("Trigger in wrong schema", nil), - ErrStackOverrunNeedMore: mysql.Message("Thread stack overrun: %d bytes used of a %d byte stack, and %d bytes needed. Use 'mysqld --threadStack=#' to specify a bigger stack.", nil), - ErrTooLongBody: mysql.Message("Routine body for '%-.100s' is too long", nil), - ErrWarnCantDropDefaultKeycache: mysql.Message("Cannot drop default keycache", nil), - ErrTooBigDisplaywidth: mysql.Message("Display width out of range for column '%-.192s' (max = %d)", nil), - ErrXaerDupid: mysql.Message("XAERDUPID: The XID already exists", nil), - ErrDatetimeFunctionOverflow: mysql.Message("Datetime function: %-.32s field overflow", nil), - ErrCantUpdateUsedTableInSfOrTrg: mysql.Message("Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.", nil), - ErrViewPreventUpdate: mysql.Message("The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'.", nil), - ErrPsNoRecursion: mysql.Message("The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner", nil), - ErrSpCantSetAutocommit: mysql.Message("Not allowed to set autocommit from a stored function or trigger", nil), - ErrMalformedDefiner: mysql.Message("Definer is not fully qualified", nil), - ErrViewFrmNoUser: mysql.Message("View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!", nil), - ErrViewOtherUser: mysql.Message("You need the SUPER privilege for creation view with '%-.192s'@'%-.255s' definer", nil), - ErrNoSuchUser: mysql.Message("The user specified as a definer ('%-.64s'@'%-.255s') does not exist", nil), - ErrForbidSchemaChange: mysql.Message("Changing schema from '%-.192s' to '%-.192s' is not allowed.", nil), - ErrRowIsReferenced2: mysql.Message("Cannot delete or update a parent row: a foreign key constraint fails (%.192s)", nil), - ErrNoReferencedRow2: mysql.Message("Cannot add or update a child row: a foreign key constraint fails (%.192s)", nil), - ErrSpBadVarShadow: mysql.Message("Variable '%-.64s' must be quoted with `...`, or renamed", nil), - ErrTrgNoDefiner: mysql.Message("No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.", nil), - ErrOldFileFormat: mysql.Message("'%-.192s' has an old format, you should re-create the '%s' object(s)", nil), - ErrSpRecursionLimit: mysql.Message("Recursive limit %d (as set by the maxSpRecursionDepth variable) was exceeded for routine %.192s", nil), - ErrSpProcTableCorrupt: mysql.Message("Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)", nil), - ErrSpWrongName: mysql.Message("Incorrect routine name '%-.192s'", nil), - ErrTableNeedsUpgrade: mysql.Message("Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\"", nil), - ErrSpNoAggregate: mysql.Message("AGGREGATE is not supported for stored functions", nil), - ErrMaxPreparedStmtCountReached: mysql.Message("Can't create more than maxPreparedStmtCount statements (current value: %d)", nil), - ErrViewRecursive: mysql.Message("`%-.192s`.`%-.192s` contains view recursion", nil), - ErrNonGroupingFieldUsed: mysql.Message("Non-grouping field '%-.192s' is used in %-.64s clause", nil), - ErrTableCantHandleSpkeys: mysql.Message("The used table type doesn't support SPATIAL indexes", nil), - ErrNoTriggersOnSystemSchema: mysql.Message("Triggers can not be created on system tables", nil), - ErrRemovedSpaces: mysql.Message("Leading spaces are removed from name '%s'", nil), - ErrAutoincReadFailed: mysql.Message("Failed to read auto-increment value from storage engine", nil), - ErrUsername: mysql.Message("user name", nil), - ErrHostname: mysql.Message("host name", nil), - ErrWrongStringLength: mysql.Message("String '%-.70s' is too long for %s (should be no longer than %d)", nil), - ErrNonInsertableTable: mysql.Message("The target table %-.100s of the %s is not insertable-into", nil), - ErrAdminWrongMrgTable: mysql.Message("Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist", nil), - ErrTooHighLevelOfNestingForSelect: mysql.Message("Too high level of nesting for select", nil), - ErrNameBecomesEmpty: mysql.Message("Name '%-.64s' has become ''", nil), - ErrAmbiguousFieldTerm: mysql.Message("First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY", nil), - ErrForeignServerExists: mysql.Message("The foreign server, %s, you are trying to create already exists.", nil), - ErrForeignServerDoesntExist: mysql.Message("The foreign server name you are trying to reference does not exist. Data source : %-.64s", nil), - ErrIllegalHaCreateOption: mysql.Message("Table storage engine '%-.64s' does not support the create option '%.64s'", nil), - ErrPartitionRequiresValues: mysql.Message("Syntax : %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition", nil), - ErrPartitionWrongValues: mysql.Message("Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition", []int{1}), - ErrPartitionMaxvalue: mysql.Message("MAXVALUE can only be used in last partition definition", nil), - ErrPartitionSubpartition: mysql.Message("Subpartitions can only be hash partitions and by key", nil), - ErrPartitionSubpartMix: mysql.Message("Must define subpartitions on all partitions if on one partition", nil), - ErrPartitionWrongNoPart: mysql.Message("Wrong number of partitions defined, mismatch with previous setting", nil), - ErrPartitionWrongNoSubpart: mysql.Message("Wrong number of subpartitions defined, mismatch with previous setting", nil), - ErrWrongExprInPartitionFunc: mysql.Message("Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed", nil), - ErrNoConstExprInRangeOrList: mysql.Message("Expression in RANGE/LIST VALUES must be constant", nil), - ErrFieldNotFoundPart: mysql.Message("Field in list of fields for partition function not found in table", nil), - ErrListOfFieldsOnlyInHash: mysql.Message("List of fields is only allowed in KEY partitions", nil), - ErrInconsistentPartitionInfo: mysql.Message("The partition info in the frm file is not consistent with what can be written into the frm file", nil), - ErrPartitionFuncNotAllowed: mysql.Message("The %-.192s function returns the wrong type", nil), - ErrPartitionsMustBeDefined: mysql.Message("For %-.64s partitions each partition must be defined", nil), - ErrRangeNotIncreasing: mysql.Message("VALUES LESS THAN value must be strictly increasing for each partition", nil), - ErrInconsistentTypeOfFunctions: mysql.Message("VALUES value must be of same type as partition function", nil), - ErrMultipleDefConstInListPart: mysql.Message("Multiple definition of same constant in list partitioning", nil), - ErrPartitionEntry: mysql.Message("Partitioning can not be used stand-alone in query", nil), - ErrMixHandler: mysql.Message("The mix of handlers in the partitions is not allowed in this version of MySQL", nil), - ErrPartitionNotDefined: mysql.Message("For the partitioned engine it is necessary to define all %-.64s", nil), - ErrTooManyPartitions: mysql.Message("Too many partitions (including subpartitions) were defined", nil), - ErrSubpartition: mysql.Message("It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning", nil), - ErrCantCreateHandlerFile: mysql.Message("Failed to create specific handler file", nil), - ErrBlobFieldInPartFunc: mysql.Message("A BLOB field is not allowed in partition function", nil), - ErrUniqueKeyNeedAllFieldsInPf: mysql.Message("A %-.192s must include all columns in the table's partitioning function", nil), - ErrNoParts: mysql.Message("Number of %-.64s = 0 is not an allowed value", []int{0}), - ErrPartitionMgmtOnNonpartitioned: mysql.Message("Partition management on a not partitioned table is not possible", nil), - ErrForeignKeyOnPartitioned: mysql.Message("Foreign key clause is not yet supported in conjunction with partitioning", nil), - ErrDropPartitionNonExistent: mysql.Message("Error in list of partitions to %-.64s", nil), - ErrDropLastPartition: mysql.Message("Cannot remove all partitions, use DROP TABLE instead", nil), - ErrCoalesceOnlyOnHashPartition: mysql.Message("COALESCE PARTITION can only be used on HASH/KEY partitions", nil), - ErrReorgHashOnlyOnSameNo: mysql.Message("REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers", nil), - ErrReorgNoParam: mysql.Message("REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs", nil), - ErrOnlyOnRangeListPartition: mysql.Message("%-.64s PARTITION can only be used on RANGE/LIST partitions", nil), - ErrAddPartitionSubpart: mysql.Message("Trying to Add partition(s) with wrong number of subpartitions", nil), - ErrAddPartitionNoNewPartition: mysql.Message("At least one partition must be added", nil), - ErrCoalescePartitionNoPartition: mysql.Message("At least one partition must be coalesced", nil), - ErrReorgPartitionNotExist: mysql.Message("More partitions to reorganize than there are partitions", nil), - ErrSameNamePartition: mysql.Message("Duplicate partition name %-.192s", nil), - ErrNoBinlog: mysql.Message("It is not allowed to shut off binlog on this command", nil), - ErrConsecutiveReorgPartitions: mysql.Message("When reorganizing a set of partitions they must be in consecutive order", nil), - ErrReorgOutsideRange: mysql.Message("Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range", nil), - ErrPartitionFunctionFailure: mysql.Message("Partition function not supported in this version for this handler", nil), - ErrPartState: mysql.Message("Partition state cannot be defined from CREATE/ALTER TABLE", nil), - ErrLimitedPartRange: mysql.Message("The %-.64s handler only supports 32 bit integers in VALUES", nil), - ErrPluginIsNotLoaded: mysql.Message("Plugin '%-.192s' is not loaded", nil), - ErrWrongValue: mysql.Message("Incorrect %-.32s value: '%-.128s'", []int{1}), - ErrNoPartitionForGivenValue: mysql.Message("Table has no partition for value %-.64s", []int{0}), - ErrFilegroupOptionOnlyOnce: mysql.Message("It is not allowed to specify %s more than once", nil), - ErrCreateFilegroupFailed: mysql.Message("Failed to create %s", nil), - ErrDropFilegroupFailed: mysql.Message("Failed to drop %s", nil), - ErrTablespaceAutoExtend: mysql.Message("The handler doesn't support autoextend of tablespaces", nil), - ErrWrongSizeNumber: mysql.Message("A size parameter was incorrectly specified, either number or on the form 10M", nil), - ErrSizeOverflow: mysql.Message("The size number was correct but we don't allow the digit part to be more than 2 billion", nil), - ErrAlterFilegroupFailed: mysql.Message("Failed to alter: %s", nil), - ErrBinlogRowLoggingFailed: mysql.Message("Writing one row to the row-based binary log failed", nil), - ErrBinlogRowWrongTableDef: mysql.Message("Table definition on master and slave does not match: %s", nil), - ErrBinlogRowRbrToSbr: mysql.Message("Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events", nil), - ErrEventAlreadyExists: mysql.Message("Event '%-.192s' already exists", nil), - ErrEventStoreFailed: mysql.Message("Failed to store event %s. Error code %d from storage engine.", nil), - ErrEventDoesNotExist: mysql.Message("Unknown event '%-.192s'", nil), - ErrEventCantAlter: mysql.Message("Failed to alter event '%-.192s'", nil), - ErrEventDropFailed: mysql.Message("Failed to drop %s", nil), - ErrEventIntervalNotPositiveOrTooBig: mysql.Message("INTERVAL is either not positive or too big", nil), - ErrEventEndsBeforeStarts: mysql.Message("ENDS is either invalid or before STARTS", nil), - ErrEventExecTimeInThePast: mysql.Message("Event execution time is in the past. Event has been disabled", nil), - ErrEventOpenTableFailed: mysql.Message("Failed to open mysql.event", nil), - ErrEventNeitherMExprNorMAt: mysql.Message("No datetime expression provided", nil), - ErrObsoleteColCountDoesntMatchCorrupted: mysql.Message("Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), - ErrObsoleteCannotLoadFromTable: mysql.Message("Cannot load from mysql.%s. The table is probably corrupted", nil), - ErrEventCannotDelete: mysql.Message("Failed to delete the event from mysql.event", nil), - ErrEventCompile: mysql.Message("Error during compilation of event's body", nil), - ErrEventSameName: mysql.Message("Same old and new event name", nil), - ErrEventDataTooLong: mysql.Message("Data for column '%s' too long", nil), - ErrDropIndexNeededInForeignKey: mysql.Message("Cannot drop index '%-.192s': needed in a foreign key constraint", nil), - ErrWarnDeprecatedSyntaxWithVer: mysql.Message("The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead", nil), - ErrCantWriteLockLogTable: mysql.Message("You can't write-lock a log table. Only read access is possible", nil), - ErrCantLockLogTable: mysql.Message("You can't use locks with log tables.", nil), - ErrForeignDuplicateKeyOldUnused: mysql.Message("Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry", nil), - ErrColCountDoesntMatchPleaseUpdate: mysql.Message("Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysqlUpgrade to fix this error.", nil), - ErrTempTablePreventsSwitchOutOfRbr: mysql.Message("Cannot switch out of the row-based binary log format when the session has open temporary tables", nil), - ErrStoredFunctionPreventsSwitchBinlogFormat: mysql.Message("Cannot change the binary logging format inside a stored function or trigger", nil), - ErrNdbCantSwitchBinlogFormat: mysql.Message("The NDB cluster engine does not support changing the binlog format on the fly yet", nil), - ErrPartitionNoTemporary: mysql.Message("Cannot create temporary table with partitions", nil), - ErrPartitionConstDomain: mysql.Message("Partition constant is out of partition function domain", nil), - ErrPartitionFunctionIsNotAllowed: mysql.Message("This partition function is not allowed", nil), - ErrDdlLog: mysql.Message("Error in DDL log", nil), - ErrNullInValuesLessThan: mysql.Message("Not allowed to use NULL value in VALUES LESS THAN", nil), - ErrWrongPartitionName: mysql.Message("Incorrect partition name", nil), - ErrCantChangeTxCharacteristics: mysql.Message("Transaction characteristics can't be changed while a transaction is in progress", nil), - ErrDupEntryAutoincrementCase: mysql.Message("ALTER TABLE causes autoIncrement resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'", nil), - ErrEventModifyQueue: mysql.Message("Internal scheduler error %d", nil), - ErrEventSetVar: mysql.Message("Error during starting/stopping of the scheduler. Error code %d", nil), - ErrPartitionMerge: mysql.Message("Engine cannot be used in partitioned tables", nil), - ErrCantActivateLog: mysql.Message("Cannot activate '%-.64s' log", nil), - ErrRbrNotAvailable: mysql.Message("The server was not built with row-based replication", nil), - ErrBase64Decode: mysql.Message("Decoding of base64 string failed", nil), - ErrEventRecursionForbidden: mysql.Message("Recursion of EVENT DDL statements is forbidden when body is present", nil), - ErrEventsDB: mysql.Message("Cannot proceed because system tables used by Event Scheduler were found damaged at server start", nil), - ErrOnlyIntegersAllowed: mysql.Message("Only integers allowed as number here", nil), - ErrUnsuportedLogEngine: mysql.Message("This storage engine cannot be used for log tables\"", nil), - ErrBadLogStatement: mysql.Message("You cannot '%s' a log table if logging is enabled", nil), - ErrCantRenameLogTable: mysql.Message("Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'", nil), - ErrWrongParamcountToNativeFct: mysql.Message("Incorrect parameter count in the call to native function '%-.192s'", nil), - ErrWrongParametersToNativeFct: mysql.Message("Incorrect parameters in the call to native function '%-.192s'", nil), - ErrWrongParametersToStoredFct: mysql.Message("Incorrect parameters in the call to stored function '%-.192s'", nil), - ErrNativeFctNameCollision: mysql.Message("This function '%-.192s' has the same name as a native function", nil), - ErrDupEntryWithKeyName: mysql.Message("Duplicate entry '%-.64s' for key '%-.192s'", nil), - ErrBinlogPurgeEmFile: mysql.Message("Too many files opened, please execute the command again", nil), - ErrEventCannotCreateInThePast: mysql.Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.", nil), - ErrEventCannotAlterInThePast: mysql.Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.", nil), - ErrSlaveIncident: mysql.Message("The incident %s occurred on the master. Message: %-.64s", nil), - ErrNoPartitionForGivenValueSilent: mysql.Message("Table has no partition for some existing values", nil), - ErrBinlogUnsafeStatement: mysql.Message("Unsafe statement written to the binary log using statement format since BINLOGFORMAT = STATEMENT. %s", nil), - ErrSlaveFatal: mysql.Message("Fatal : %s", nil), - ErrSlaveRelayLogReadFailure: mysql.Message("Relay log read failure: %s", nil), - ErrSlaveRelayLogWriteFailure: mysql.Message("Relay log write failure: %s", nil), - ErrSlaveCreateEventFailure: mysql.Message("Failed to create %s", nil), - ErrSlaveMasterComFailure: mysql.Message("Master command %s failed: %s", nil), - ErrBinlogLoggingImpossible: mysql.Message("Binary logging not possible. Message: %s", nil), - ErrViewNoCreationCtx: mysql.Message("View `%-.64s`.`%-.64s` has no creation context", nil), - ErrViewInvalidCreationCtx: mysql.Message("Creation context of view `%-.64s`.`%-.64s' is invalid", nil), - ErrSrInvalidCreationCtx: mysql.Message("Creation context of stored routine `%-.64s`.`%-.64s` is invalid", nil), - ErrTrgCorruptedFile: mysql.Message("Corrupted TRG file for table `%-.64s`.`%-.64s`", nil), - ErrTrgNoCreationCtx: mysql.Message("Triggers for table `%-.64s`.`%-.64s` have no creation context", nil), - ErrTrgInvalidCreationCtx: mysql.Message("Trigger creation context of table `%-.64s`.`%-.64s` is invalid", nil), - ErrEventInvalidCreationCtx: mysql.Message("Creation context of event `%-.64s`.`%-.64s` is invalid", nil), - ErrTrgCantOpenTable: mysql.Message("Cannot open table for trigger `%-.64s`.`%-.64s`", nil), - ErrCantCreateSroutine: mysql.Message("Cannot create stored routine `%-.64s`. Check warnings", nil), - ErrNeverUsed: mysql.Message("Ambiguous slave modes combination. %s", nil), - ErrNoFormatDescriptionEventBeforeBinlogStatement: mysql.Message("The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement.", nil), - ErrSlaveCorruptEvent: mysql.Message("Corrupted replication event was detected", nil), - ErrLoadDataInvalidColumn: mysql.Message("Invalid column reference (%-.64s) in LOAD DATA", nil), - ErrLogPurgeNoFile: mysql.Message("Being purged log %s was not found", nil), - ErrXaRbtimeout: mysql.Message("XARBTIMEOUT: Transaction branch was rolled back: took too long", nil), - ErrXaRbdeadlock: mysql.Message("XARBDEADLOCK: Transaction branch was rolled back: deadlock was detected", nil), - ErrNeedReprepare: mysql.Message("Prepared statement needs to be re-prepared", nil), - ErrDelayedNotSupported: mysql.Message("DELAYED option not supported for table '%-.192s'", nil), - WarnNoMasterInfo: mysql.Message("The master info structure does not exist", nil), - WarnOptionIgnored: mysql.Message("<%-.64s> option ignored", nil), - WarnPluginDeleteBuiltin: mysql.Message("Built-in plugins cannot be deleted", nil), - WarnPluginBusy: mysql.Message("Plugin is busy and will be uninstalled on shutdown", nil), - ErrVariableIsReadonly: mysql.Message("%s variable '%s' is read-only. Use SET %s to assign the value", nil), - ErrWarnEngineTransactionRollback: mysql.Message("Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted", nil), - ErrSlaveHeartbeatFailure: mysql.Message("Unexpected master's heartbeat data: %s", nil), - ErrSlaveHeartbeatValueOutOfRange: mysql.Message("The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds).", nil), - ErrNdbReplicationSchema: mysql.Message("Bad schema for mysql.ndbReplication table. Message: %-.64s", nil), - ErrConflictFnParse: mysql.Message("Error in parsing conflict function. Message: %-.64s", nil), - ErrExceptionsWrite: mysql.Message("Write to exceptions table failed. Message: %-.128s\"", nil), - ErrTooLongTableComment: mysql.Message("Comment for table '%-.64s' is too long (max = %d)", nil), - ErrTooLongFieldComment: mysql.Message("Comment for field '%-.64s' is too long (max = %d)", nil), - ErrFuncInexistentNameCollision: mysql.Message("FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual", nil), - ErrDatabaseName: mysql.Message("Database", nil), - ErrTableName: mysql.Message("Table", nil), - ErrPartitionName: mysql.Message("Partition", nil), - ErrSubpartitionName: mysql.Message("Subpartition", nil), - ErrTemporaryName: mysql.Message("Temporary", nil), - ErrRenamedName: mysql.Message("Renamed", nil), - ErrTooManyConcurrentTrxs: mysql.Message("Too many active concurrent transactions", nil), - WarnNonASCIISeparatorNotImplemented: mysql.Message("Non-ASCII separator arguments are not fully supported", nil), - ErrDebugSyncTimeout: mysql.Message("debug sync point wait timed out", nil), - ErrDebugSyncHitLimit: mysql.Message("debug sync point hit limit reached", nil), - ErrDupSignalSet: mysql.Message("Duplicate condition information item '%s'", nil), - ErrSignalWarn: mysql.Message("Unhandled user-defined warning condition", nil), - ErrSignalNotFound: mysql.Message("Unhandled user-defined not found condition", nil), - ErrSignalException: mysql.Message("Unhandled user-defined exception condition", nil), - ErrResignalWithoutActiveHandler: mysql.Message("RESIGNAL when handler not active", nil), - ErrSignalBadConditionType: mysql.Message("SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE", nil), - WarnCondItemTruncated: mysql.Message("Data truncated for condition item '%s'", nil), - ErrCondItemTooLong: mysql.Message("Data too long for condition item '%s'", nil), - ErrUnknownLocale: mysql.Message("Unknown locale: '%-.64s'", nil), - ErrSlaveIgnoreServerIDs: mysql.Message("The requested server id %d clashes with the slave startup option --replicate-same-server-id", nil), - ErrQueryCacheDisabled: mysql.Message("Query cache is disabled; restart the server with queryCacheType=1 to enable it", nil), - ErrSameNamePartitionField: mysql.Message("Duplicate partition field name '%-.192s'", nil), - ErrPartitionColumnList: mysql.Message("Inconsistency in usage of column lists for partitioning", nil), - ErrWrongTypeColumnValue: mysql.Message("Partition column values of incorrect type", nil), - ErrTooManyPartitionFuncFields: mysql.Message("Too many fields in '%-.192s'", nil), - ErrMaxvalueInValuesIn: mysql.Message("Cannot use MAXVALUE as value in VALUES IN", nil), - ErrTooManyValues: mysql.Message("Cannot have more than one value for this type of %-.64s partitioning", nil), - ErrRowSinglePartitionField: mysql.Message("Row expressions in VALUES IN only allowed for multi-field column partitioning", nil), - ErrFieldTypeNotAllowedAsPartitionField: mysql.Message("Field '%-.192s' is of a not allowed type for this type of partitioning", nil), - ErrPartitionFieldsTooLong: mysql.Message("The total length of the partitioning fields is too large", nil), - ErrBinlogRowEngineAndStmtEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved.", nil), - ErrBinlogRowModeAndStmtEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.", nil), - ErrBinlogUnsafeAndStmtEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOGFORMAT = MIXED. %s", nil), - ErrBinlogRowInjectionAndStmtEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.", nil), - ErrBinlogStmtModeAndRowEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s", nil), - ErrBinlogRowInjectionAndStmtMode: mysql.Message("Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOGFORMAT = STATEMENT.", nil), - ErrBinlogMultipleEnginesAndSelfLoggingEngine: mysql.Message("Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.", nil), - ErrBinlogUnsafeLimit: mysql.Message("The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.", nil), - ErrBinlogUnsafeInsertDelayed: mysql.Message("The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted.", nil), - ErrBinlogUnsafeSystemTable: mysql.Message("The statement is unsafe because it uses the general log, slow query log, or performanceSchema table(s). This is unsafe because system tables may differ on slaves.", nil), - ErrBinlogUnsafeAutoincColumns: mysql.Message("Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTOINCREMENT column. Inserted values cannot be logged correctly.", nil), - ErrBinlogUnsafeUdf: mysql.Message("Statement is unsafe because it uses a UDF which may not return the same value on the slave.", nil), - ErrBinlogUnsafeSystemVariable: mysql.Message("Statement is unsafe because it uses a system variable that may have a different value on the slave.", nil), - ErrBinlogUnsafeSystemFunction: mysql.Message("Statement is unsafe because it uses a system function that may return a different value on the slave", nil), - ErrBinlogUnsafeNontransAfterTrans: mysql.Message("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.", nil), - ErrMessageAndStatement: mysql.Message("%s Statement: %s", nil), - ErrSlaveConversionFailed: mysql.Message("Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'", nil), - ErrSlaveCantCreateConversion: mysql.Message("Can't create conversion table for table '%-.192s.%-.192s'", nil), - ErrInsideTransactionPreventsSwitchBinlogFormat: mysql.Message("Cannot modify @@session.binlogFormat inside a transaction", nil), - ErrPathLength: mysql.Message("The path specified for %.64s is too long.", nil), - ErrWarnDeprecatedSyntaxNoReplacement: mysql.Message("%s is deprecated and will be removed in a future release.%s", nil), - ErrWrongNativeTableStructure: mysql.Message("Native table '%-.64s'.'%-.64s' has the wrong structure", nil), - ErrWrongPerfSchemaUsage: mysql.Message("Invalid performanceSchema usage.", nil), - ErrWarnISSkippedTable: mysql.Message("Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement", nil), - ErrInsideTransactionPreventsSwitchBinlogDirect: mysql.Message("Cannot modify @@session.binlogDirectNonTransactionalUpdates inside a transaction", nil), - ErrStoredFunctionPreventsSwitchBinlogDirect: mysql.Message("Cannot change the binlog direct flag inside a stored function or trigger", nil), - ErrSpatialMustHaveGeomCol: mysql.Message("A SPATIAL index may only contain a geometrical type column", nil), - ErrTooLongIndexComment: mysql.Message("Comment for index '%-.64s' is too long (max = %d)", nil), - ErrLockAborted: mysql.Message("Wait on a lock was aborted due to a pending exclusive lock", nil), - ErrDataOutOfRange: mysql.Message("%s value is out of range in '%s'", []int{1}), - ErrWrongSpvarTypeInLimit: mysql.Message("A variable of a non-integer based type in LIMIT clause", nil), - ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine: mysql.Message("Mixing self-logging and non-self-logging engines in a statement is unsafe.", nil), - ErrBinlogUnsafeMixedStatement: mysql.Message("Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.", nil), - ErrInsideTransactionPreventsSwitchSQLLogBin: mysql.Message("Cannot modify @@session.sqlLogBin inside a transaction", nil), - ErrStoredFunctionPreventsSwitchSQLLogBin: mysql.Message("Cannot change the sqlLogBin inside a stored function or trigger", nil), - ErrFailedReadFromParFile: mysql.Message("Failed to read from the .par file", nil), - ErrValuesIsNotIntType: mysql.Message("VALUES value for partition '%-.64s' must have type INT", nil), - ErrAccessDeniedNoPassword: mysql.Message("Access denied for user '%-.48s'@'%-.255s'", nil), - ErrSetPasswordAuthPlugin: mysql.Message("SET PASSWORD has no significance for user '%-.48s'@'%-.255s' as authentication plugin does not support it.", nil), - ErrGrantPluginUserExists: mysql.Message("GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists", nil), - ErrTruncateIllegalForeignKey: mysql.Message("Cannot truncate a table referenced in a foreign key constraint (%.192s)", nil), - ErrPluginIsPermanent: mysql.Message("Plugin '%s' is forcePlusPermanent and can not be unloaded", nil), - ErrSlaveHeartbeatValueOutOfRangeMin: mysql.Message("The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.", nil), - ErrSlaveHeartbeatValueOutOfRangeMax: mysql.Message("The requested value for the heartbeat period exceeds the value of `slaveNetTimeout' seconds. A sensible value for the period should be less than the timeout.", nil), - ErrStmtCacheFull: mysql.Message("Multi-row statements required more than 'maxBinlogStmtCacheSize' bytes of storage; increase this mysqld variable and try again", nil), - ErrMultiUpdateKeyConflict: mysql.Message("Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'.", nil), - ErrTableNeedsRebuild: mysql.Message("Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!", nil), - WarnOptionBelowLimit: mysql.Message("The value of '%s' should be no less than the value of '%s'", nil), - ErrIndexColumnTooLong: mysql.Message("Index column size too large. The maximum column size is %d bytes.", nil), - ErrErrorInTriggerBody: mysql.Message("Trigger '%-.64s' has an error in its body: '%-.256s'", nil), - ErrErrorInUnknownTriggerBody: mysql.Message("Unknown trigger has an error in its body: '%-.256s'", nil), - ErrIndexCorrupt: mysql.Message("Index %s is corrupted", nil), - ErrUndoRecordTooBig: mysql.Message("Undo log record is too big.", nil), - ErrBinlogUnsafeInsertIgnoreSelect: mysql.Message("INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeInsertSelectUpdate: mysql.Message("INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeReplaceSelect: mysql.Message("REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateIgnoreSelect: mysql.Message("CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateReplaceSelect: mysql.Message("CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeUpdateIgnore: mysql.Message("UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrPluginNoUninstall: mysql.Message("Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it.", nil), - ErrPluginNoInstall: mysql.Message("Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it.", nil), - ErrBinlogUnsafeWriteAutoincSelect: mysql.Message("Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateSelectAutoinc: mysql.Message("CREATE TABLE... SELECT... on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeInsertTwoKeys: mysql.Message("INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe", nil), - ErrTableInFkCheck: mysql.Message("Table is being used in foreign key check.", nil), - ErrUnsupportedEngine: mysql.Message("Storage engine '%s' does not support system tables. [%s.%s]", nil), - ErrBinlogUnsafeAutoincNotFirst: mysql.Message("INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.", nil), - ErrCannotLoadFromTableV2: mysql.Message("Cannot load from %s.%s. The table is probably corrupted", nil), - ErrMasterDelayValueOutOfRange: mysql.Message("The requested value %d for the master delay exceeds the maximum %d", nil), - ErrOnlyFdAndRbrEventsAllowedInBinlogStatement: mysql.Message("Only FormatDescriptionLogEvent and row events are allowed in BINLOG statements (but %s was provided)", nil), - ErrPartitionExchangeDifferentOption: mysql.Message("Non matching attribute '%-.64s' between partition and table", nil), - ErrPartitionExchangePartTable: mysql.Message("Table to exchange with partition is partitioned: '%-.64s'", nil), - ErrPartitionExchangeTempTable: mysql.Message("Table to exchange with partition is temporary: '%-.64s'", nil), - ErrPartitionInsteadOfSubpartition: mysql.Message("Subpartitioned table, use subpartition instead of partition", nil), - ErrUnknownPartition: mysql.Message("Unknown partition '%-.64s' in table '%-.64s'", nil), - ErrTablesDifferentMetadata: mysql.Message("Tables have different definitions", nil), - ErrRowDoesNotMatchPartition: mysql.Message("Found a row that does not match the partition", nil), - ErrBinlogCacheSizeGreaterThanMax: mysql.Message("Option binlogCacheSize (%d) is greater than maxBinlogCacheSize (%d); setting binlogCacheSize equal to maxBinlogCacheSize.", nil), - ErrWarnIndexNotApplicable: mysql.Message("Cannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'", nil), - ErrPartitionExchangeForeignKey: mysql.Message("Table to exchange with partition has foreign key references: '%-.64s'", nil), - ErrNoSuchKeyValue: mysql.Message("Key value '%-.192s' was not found in table '%-.192s.%-.192s'", nil), - ErrRplInfoDataTooLong: mysql.Message("Data for column '%s' too long", nil), - ErrNetworkReadEventChecksumFailure: mysql.Message("Replication event checksum verification failed while reading from network.", nil), - ErrBinlogReadEventChecksumFailure: mysql.Message("Replication event checksum verification failed while reading from a log file.", nil), - ErrBinlogStmtCacheSizeGreaterThanMax: mysql.Message("Option binlogStmtCacheSize (%d) is greater than maxBinlogStmtCacheSize (%d); setting binlogStmtCacheSize equal to maxBinlogStmtCacheSize.", nil), - ErrCantUpdateTableInCreateTableSelect: mysql.Message("Can't update table '%-.192s' while '%-.192s' is being created.", nil), - ErrPartitionClauseOnNonpartitioned: mysql.Message("PARTITION () clause on non partitioned table", nil), - ErrRowDoesNotMatchGivenPartitionSet: mysql.Message("Found a row not matching the given partition set", nil), - ErrNoSuchPartitionunused: mysql.Message("partition '%-.64s' doesn't exist", nil), - ErrChangeRplInfoRepositoryFailure: mysql.Message("Failure while changing the type of replication repository: %s.", nil), - ErrWarningNotCompleteRollbackWithCreatedTempTable: mysql.Message("The creation of some temporary tables could not be rolled back.", nil), - ErrWarningNotCompleteRollbackWithDroppedTempTable: mysql.Message("Some temporary tables were dropped, but these operations could not be rolled back.", nil), - ErrMtsFeatureIsNotSupported: mysql.Message("%s is not supported in multi-threaded slave mode. %s", nil), - ErrMtsUpdatedDBsGreaterMax: mysql.Message("The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata.", nil), - ErrMtsCantParallel: mysql.Message("Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s.", nil), - ErrMtsInconsistentData: mysql.Message("%s", nil), - ErrFulltextNotSupportedWithPartitioning: mysql.Message("FULLTEXT index is not supported for partitioned tables.", nil), - ErrDaInvalidConditionNumber: mysql.Message("Invalid condition number", nil), - ErrInsecurePlainText: mysql.Message("Sending passwords in plain text without SSL/TLS is extremely insecure.", nil), - ErrInsecureChangeMaster: mysql.Message("Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.", nil), - ErrForeignDuplicateKeyWithChildInfo: mysql.Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'", nil), - ErrForeignDuplicateKeyWithoutChildInfo: mysql.Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child table", nil), - ErrSQLthreadWithSecureSlave: mysql.Message("Setting authentication options is not possible when only the Slave SQL Thread is being started.", nil), - ErrTableHasNoFt: mysql.Message("The table does not have FULLTEXT index to support this query", nil), - ErrVariableNotSettableInSfOrTrigger: mysql.Message("The system variable %.200s cannot be set in stored functions or triggers.", nil), - ErrVariableNotSettableInTransaction: mysql.Message("The system variable %.200s cannot be set when there is an ongoing transaction.", nil), - ErrGtidNextIsNotInGtidNextList: mysql.Message("The system variable @@SESSION.GTIDNEXT has the value %.200s, which is not listed in @@SESSION.GTIDNEXTLIST.", nil), - ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull: mysql.Message("When @@SESSION.GTIDNEXTLIST == NULL, the system variable @@SESSION.GTIDNEXT cannot change inside a transaction.", nil), - ErrSetStatementCannotInvokeFunction: mysql.Message("The statement 'SET %.200s' cannot invoke a stored function.", nil), - ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull: mysql.Message("The system variable @@SESSION.GTIDNEXT cannot be 'AUTOMATIC' when @@SESSION.GTIDNEXTLIST is non-NULL.", nil), - ErrSkippingLoggedTransaction: mysql.Message("Skipping transaction %.200s because it has already been executed and logged.", nil), - ErrMalformedGtidSetSpecification: mysql.Message("Malformed GTID set specification '%.200s'.", nil), - ErrMalformedGtidSetEncoding: mysql.Message("Malformed GTID set encoding.", nil), - ErrMalformedGtidSpecification: mysql.Message("Malformed GTID specification '%.200s'.", nil), - ErrGnoExhausted: mysql.Message("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new serverUuid.", nil), - ErrBadSlaveAutoPosition: mysql.Message("Parameters MASTERLOGFILE, MASTERLOGPOS, RELAYLOGFILE and RELAYLOGPOS cannot be set when MASTERAUTOPOSITION is active.", nil), - ErrAutoPositionRequiresGtidModeOn: mysql.Message("CHANGE MASTER TO MASTERAUTOPOSITION = 1 can only be executed when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet: mysql.Message("Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTIDNEXT != AUTOMATIC or @@SESSION.GTIDNEXTLIST != NULL.", nil), - ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn: mysql.Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP2 requires @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), - ErrGtidModeRequiresBinlog: mysql.Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP1 or UPGRADESTEP2 requires --log-bin and --log-slave-updates.", nil), - ErrCantSetGtidNextToGtidWhenGtidModeIsOff: mysql.Message("@@SESSION.GTIDNEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn: mysql.Message("@@SESSION.GTIDNEXT cannot be set to ANONYMOUS when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff: mysql.Message("@@SESSION.GTIDNEXTLIST cannot be set to a non-NULL value when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrFoundGtidEventWhenGtidModeIsOff: mysql.Message("Found a GtidLogEvent or PreviousGtidsLogEvent when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrGtidUnsafeNonTransactionalTable: mysql.Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.", nil), - ErrGtidUnsafeCreateSelect: mysql.Message("CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), - ErrGtidUnsafeCreateDropTemporaryTableInTransaction: mysql.Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.", nil), - ErrGtidModeCanOnlyChangeOneStepAtATime: mysql.Message("The value of @@GLOBAL.GTIDMODE can only change one step at a time: OFF <-> UPGRADESTEP1 <-> UPGRADESTEP2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.", nil), - ErrMasterHasPurgedRequiredGtids: mysql.Message("The slave is connecting using CHANGE MASTER TO MASTERAUTOPOSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.", nil), - ErrCantSetGtidNextWhenOwningGtid: mysql.Message("@@SESSION.GTIDNEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK.", nil), - ErrUnknownExplainFormat: mysql.Message("Unknown EXPLAIN format name: '%s'", nil), - ErrCantExecuteInReadOnlyTransaction: mysql.Message("Cannot execute statement in a READ ONLY transaction.", nil), - ErrTooLongTablePartitionComment: mysql.Message("Comment for table partition '%-.64s' is too long (max = %d)", nil), - ErrSlaveConfiguration: mysql.Message("Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.", nil), - ErrInnodbFtLimit: mysql.Message("InnoDB presently supports one FULLTEXT index creation at a time", nil), - ErrInnodbNoFtTempTable: mysql.Message("Cannot create FULLTEXT index on temporary InnoDB table", nil), - ErrInnodbFtWrongDocidColumn: mysql.Message("Column '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), - ErrInnodbFtWrongDocidIndex: mysql.Message("Index '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), - ErrInnodbOnlineLogTooBig: mysql.Message("Creating index '%-.192s' required more than 'innodbOnlineAlterLogMaxSize' bytes of modification log. Please try again.", nil), - ErrUnknownAlterAlgorithm: mysql.Message("Unknown ALGORITHM '%s'", nil), - ErrUnknownAlterLock: mysql.Message("Unknown LOCK type '%s'", nil), - ErrMtsChangeMasterCantRunWithGaps: mysql.Message("CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.", nil), - ErrMtsRecoveryFailure: mysql.Message("Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MySQL error log.", nil), - ErrMtsResetWorkers: mysql.Message("Cannot clean up worker info tables. Additional error messages can be found in the MySQL error log.", nil), - ErrColCountDoesntMatchCorruptedV2: mysql.Message("Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), - ErrSlaveSilentRetryTransaction: mysql.Message("Slave must silently retry current transaction", nil), - ErrDiscardFkChecksRunning: mysql.Message("There is a foreign key check running on table '%-.192s'. Cannot discard the table.", nil), - ErrTableSchemaMismatch: mysql.Message("Schema mismatch (%s)", nil), - ErrTableInSystemTablespace: mysql.Message("Table '%-.192s' in system tablespace", nil), - ErrIoRead: mysql.Message("IO Read : (%d, %s) %s", nil), - ErrIoWrite: mysql.Message("IO Write : (%d, %s) %s", nil), - ErrTablespaceMissing: mysql.Message("Tablespace is missing for table '%-.192s'", nil), - ErrTablespaceExists: mysql.Message("Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORT.", nil), - ErrTablespaceDiscarded: mysql.Message("Tablespace has been discarded for table '%-.192s'", nil), - ErrInternal: mysql.Message("Internal : %s", nil), - ErrInnodbImport: mysql.Message("ALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %d : '%s'", nil), - ErrInnodbIndexCorrupt: mysql.Message("Index corrupt: %s", nil), - ErrInvalidYearColumnLength: mysql.Message("Supports only YEAR or YEAR(4) column", nil), - ErrNotValidPassword: mysql.Message("Your password does not satisfy the current policy requirements (%s)", nil), - ErrMustChangePassword: mysql.Message("You must reset your password using ALTER USER statement before executing this statement", nil), - ErrFkNoIndexChild: mysql.Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'", nil), - ErrForeignKeyNoIndexInParent: mysql.Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'", nil), - ErrFkFailAddSystem: mysql.Message("Failed to add the foreign key constraint '%s' to system tables", nil), - ErrForeignKeyCannotOpenParent: mysql.Message("Failed to open the referenced table '%s'", nil), - ErrFkIncorrectOption: mysql.Message("Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'", nil), - ErrFkDupName: mysql.Message("Duplicate foreign key constraint name '%s'", nil), - ErrPasswordFormat: mysql.Message("The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.", nil), - ErrFkColumnCannotDrop: mysql.Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'", nil), - ErrFkColumnCannotDropChild: mysql.Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrForeignKeyColumnNotNull: mysql.Message("Column '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULL", nil), - ErrDupIndex: mysql.Message("Duplicate index '%-.64s' defined on the table '%-.64s.%-.64s'. This is deprecated and will be disallowed in a future release.", nil), - ErrForeignKeyColumnCannotChange: mysql.Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s'", nil), - ErrForeignKeyColumnCannotChangeChild: mysql.Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrFkCannotDeleteParent: mysql.Message("Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrMalformedPacket: mysql.Message("Malformed communication packet.", nil), - ErrReadOnlyMode: mysql.Message("Running in read-only mode", nil), - ErrGtidNextTypeUndefinedGroup: mysql.Message("When @@SESSION.GTIDNEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET @@SESSION.GTIDNEXT before a transaction and forgot to set @@SESSION.GTIDNEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current @@SESSION.GTIDNEXT is '%s'.", nil), - ErrVariableNotSettableInSp: mysql.Message("The system variable %.200s cannot be set in stored procedures.", nil), - ErrCantSetGtidPurgedWhenGtidModeIsOff: mysql.Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty: mysql.Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDEXECUTED is empty.", nil), - ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty: mysql.Message("@@GLOBAL.GTIDPURGED can only be set when there are no ongoing transactions (not even in other clients).", nil), - ErrGtidPurgedWasChanged: mysql.Message("@@GLOBAL.GTIDPURGED was changed from '%s' to '%s'.", nil), - ErrGtidExecutedWasChanged: mysql.Message("@@GLOBAL.GTIDEXECUTED was changed from '%s' to '%s'.", nil), - ErrBinlogStmtModeAndNoReplTables: mysql.Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT, and both replicated and non replicated tables are written to.", nil), - ErrAlterOperationNotSupported: mysql.Message("%s is not supported for this operation. Try %s.", nil), - ErrAlterOperationNotSupportedReason: mysql.Message("%s is not supported. Reason: %s. Try %s.", nil), - ErrAlterOperationNotSupportedReasonCopy: mysql.Message("COPY algorithm requires a lock", nil), - ErrAlterOperationNotSupportedReasonPartition: mysql.Message("Partition specific operations do not yet support LOCK/ALGORITHM", nil), - ErrAlterOperationNotSupportedReasonFkRename: mysql.Message("Columns participating in a foreign key are renamed", nil), - ErrAlterOperationNotSupportedReasonColumnType: mysql.Message("Cannot change column type INPLACE", nil), - ErrAlterOperationNotSupportedReasonFkCheck: mysql.Message("Adding foreign keys needs foreignKeyChecks=OFF", nil), - ErrAlterOperationNotSupportedReasonIgnore: mysql.Message("Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows", nil), - ErrAlterOperationNotSupportedReasonNopk: mysql.Message("Dropping a primary key is not allowed without also adding a new primary key", nil), - ErrAlterOperationNotSupportedReasonAutoinc: mysql.Message("Adding an auto-increment column requires a lock", nil), - ErrAlterOperationNotSupportedReasonHiddenFts: mysql.Message("Cannot replace hidden FTSDOCID with a user-visible one", nil), - ErrAlterOperationNotSupportedReasonChangeFts: mysql.Message("Cannot drop or rename FTSDOCID", nil), - ErrAlterOperationNotSupportedReasonFts: mysql.Message("Fulltext index creation requires a lock", nil), - ErrSQLSlaveSkipCounterNotSettableInGtidMode: mysql.Message("sqlSlaveSkipCounter can not be set when the server is running with @@GLOBAL.GTIDMODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction", nil), - ErrDupUnknownInIndex: mysql.Message("Duplicate entry for key '%-.192s'", nil), - ErrIdentCausesTooLongPath: mysql.Message("Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'.", nil), - ErrAlterOperationNotSupportedReasonNotNull: mysql.Message("cannot silently convert NULL values, as required in this SQLMODE", nil), - ErrMustChangePasswordLogin: mysql.Message("Your password has expired. To log in you must change it using a client that supports expired passwords.", nil), - ErrRowInWrongPartition: mysql.Message("Found a row in wrong partition %s", []int{0}), - ErrGeneratedColumnFunctionIsNotAllowed: mysql.Message("Expression of generated column '%s' contains a disallowed function.", nil), - ErrGeneratedColumnRowValueIsNotAllowed: mysql.Message("Expression of generated column '%s' cannot refer to a row value", nil), - ErrDefValGeneratedNamedFunctionIsNotAllowed: mysql.Message("Default value expression of column '%s' contains a disallowed function: `%s`.", nil), - ErrUnsupportedAlterInplaceOnVirtualColumn: mysql.Message("INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions.", nil), - ErrWrongFKOptionForGeneratedColumn: mysql.Message("Cannot define foreign key with %s clause on a generated column.", nil), - ErrBadGeneratedColumn: mysql.Message("The value specified for generated column '%s' in table '%s' is not allowed.", nil), - ErrUnsupportedOnGeneratedColumn: mysql.Message("'%s' is not supported for generated columns.", nil), - ErrGeneratedColumnNonPrior: mysql.Message("Generated column can refer only to generated columns defined prior to it.", nil), - ErrDependentByGeneratedColumn: mysql.Message("Column '%s' has a generated column dependency.", nil), - ErrGeneratedColumnRefAutoInc: mysql.Message("Generated column '%s' cannot refer to auto-increment column.", nil), - ErrAccountHasBeenLocked: mysql.Message("Access denied for user '%s'@'%s'. Account is locked.", nil), - ErUserAccessDeniedForUserAccountBlockedByPasswordLock: mysql.Message("Access denied for user '%s'@'%s'. Account is blocked for %s day(s) (%s day(s) remaining) due to %d consecutive failed logins.", nil), - ErrWarnConflictingHint: mysql.Message("Hint %s is ignored as conflicting/duplicated.", nil), - ErrUnresolvedHintName: mysql.Message("Unresolved name '%s' for %s hint", nil), - ErrForeignKeyCascadeDepthExceeded: mysql.Message("Foreign key cascade delete/update exceeds max depth of %v.", nil), - ErrInvalidFieldSize: mysql.Message("Invalid size for column '%s'.", nil), - ErrPasswordExpireAnonymousUser: mysql.Message("The password for anonymous user cannot be expired.", nil), - ErrInvalidArgumentForLogarithm: mysql.Message("Invalid argument for logarithm", nil), - ErrAggregateOrderNonAggQuery: mysql.Message("Expression #%d of ORDER BY contains aggregate function and applies to the result of a non-aggregated query", nil), - ErrIncorrectType: mysql.Message("Incorrect type for argument %s in function %s.", nil), - ErrFieldInOrderNotSelect: mysql.Message("Expression #%d of ORDER BY clause is not in SELECT list, references column '%s' which is not in SELECT list; this is incompatible with %s", nil), - ErrAggregateInOrderNotSelect: mysql.Message("Expression #%d of ORDER BY clause is not in SELECT list, contains aggregate function; this is incompatible with %s", nil), - ErrInvalidJSONData: mysql.Message("Invalid JSON data provided to function %s: %s", nil), - ErrInvalidJSONText: mysql.Message("Invalid JSON text: %-.192s", []int{0}), - ErrInvalidJSONTextInParam: mysql.Message("Invalid JSON text in argument %d to function %s: \"%s\" at position %d.", nil), - ErrInvalidJSONPath: mysql.Message("Invalid JSON path expression. The error is around character position %d.", []int{0}), - ErrInvalidJSONCharset: mysql.Message("Cannot create a JSON value from a string with CHARACTER SET '%s'.", nil), - ErrInvalidTypeForJSON: mysql.Message("Invalid data type for JSON data in argument %d to function %s; a JSON string or JSON type is required.", nil), - ErrInvalidJSONPathMultipleSelection: mysql.Message("In this situation, path expressions may not contain the * and ** tokens or an array range.", nil), - ErrInvalidJSONContainsPathType: mysql.Message("The second argument can only be either 'one' or 'all'.", nil), - ErrJSONUsedAsKey: mysql.Message("JSON column '%-.192s' cannot be used in key specification.", nil), - ErrJSONDocumentTooDeep: mysql.Message("The JSON document exceeds the maximum depth.", nil), - ErrJSONDocumentNULLKey: mysql.Message("JSON documents may not contain NULL member names.", nil), - ErrSecureTransportRequired: mysql.Message("Connections using insecure transport are prohibited while --require_secure_transport=ON.", nil), - ErrBadUser: mysql.Message("User %s does not exist.", nil), - ErrUserAlreadyExists: mysql.Message("User %s already exists.", nil), - ErrInvalidJSONPathArrayCell: mysql.Message("A path expression is not a path to a cell in an array.", nil), - ErrInvalidEncryptionOption: mysql.Message("Invalid encryption option.", nil), - ErrTooLongValueForType: mysql.Message("Too long enumeration/set value for column %s.", nil), - ErrPKIndexCantBeInvisible: mysql.Message("A primary key index cannot be invisible", nil), - ErrWindowNoSuchWindow: mysql.Message("Window name '%s' is not defined.", nil), - ErrWindowCircularityInWindowGraph: mysql.Message("There is a circularity in the window dependency graph.", nil), - ErrWindowNoChildPartitioning: mysql.Message("A window which depends on another cannot define partitioning.", nil), - ErrWindowNoInherentFrame: mysql.Message("Window '%s' has a frame definition, so cannot be referenced by another window.", nil), - ErrWindowNoRedefineOrderBy: mysql.Message("Window '%s' cannot inherit '%s' since both contain an ORDER BY clause.", nil), - ErrWindowFrameStartIllegal: mysql.Message("Window '%s': frame start cannot be UNBOUNDED FOLLOWING.", nil), - ErrWindowFrameEndIllegal: mysql.Message("Window '%s': frame end cannot be UNBOUNDED PRECEDING.", nil), - ErrWindowFrameIllegal: mysql.Message("Window '%s': frame start or end is negative, NULL or of non-integral type", nil), - ErrWindowRangeFrameOrderType: mysql.Message("Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression, of numeric or temporal type", nil), - ErrWindowRangeFrameTemporalType: mysql.Message("Window '%s' with RANGE frame has ORDER BY expression of datetime type. Only INTERVAL bound value allowed.", nil), - ErrWindowRangeFrameNumericType: mysql.Message("Window '%s' with RANGE frame has ORDER BY expression of numeric type, INTERVAL bound value not allowed.", nil), - ErrWindowRangeBoundNotConstant: mysql.Message("Window '%s' has a non-constant frame bound.", nil), - ErrWindowDuplicateName: mysql.Message("Window '%s' is defined twice.", nil), - ErrWindowIllegalOrderBy: mysql.Message("Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression.", nil), - ErrWindowInvalidWindowFuncUse: mysql.Message("You cannot use the window function '%s' in this context.'", nil), - ErrWindowInvalidWindowFuncAliasUse: mysql.Message("You cannot use the alias '%s' of an expression containing a window function in this context.'", nil), - ErrWindowNestedWindowFuncUseInWindowSpec: mysql.Message("You cannot nest a window function in the specification of window '%s'.", nil), - ErrWindowRowsIntervalUse: mysql.Message("Window '%s': INTERVAL can only be used with RANGE frames.", nil), - ErrWindowNoGroupOrderUnused: mysql.Message("ASC or DESC with GROUP BY isn't allowed with window functions; put ASC or DESC in ORDER BY", nil), - ErrWindowExplainJSON: mysql.Message("To get information about window functions use EXPLAIN FORMAT=JSON", nil), - ErrWindowFunctionIgnoresFrame: mysql.Message("Window function '%s' ignores the frame clause of window '%s' and aggregates over the whole partition", nil), - ErrInvalidNumberOfArgs: mysql.Message("Too many arguments for function %s; maximum allowed is %d", nil), - ErrFieldInGroupingNotGroupBy: mysql.Message("Argument %s of GROUPING function is not in GROUP BY", nil), - ErrRoleNotGranted: mysql.Message("%s is not granted to %s", nil), - ErrMaxExecTimeExceeded: mysql.Message("Query execution was interrupted, maximum statement execution time exceeded", nil), - ErrLockAcquireFailAndNoWaitSet: mysql.Message("Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.", nil), - ErrNotHintUpdatable: mysql.Message("Variable '%s' might not be affected by SET_VAR hint.", nil), - ErrExistsInHistoryPassword: mysql.Message("Cannot use these credentials for '%s@%s' because they contradict the password history policy.", nil), - ErrInvalidDefaultUTF8MB4Collation: mysql.Message("Invalid default collation %s: utf8mb4_0900_ai_ci or utf8mb4_general_ci or utf8mb4_bin expected", nil), - ErrForeignKeyCannotDropParent: mysql.Message("Cannot drop table '%s' referenced by a foreign key constraint '%s' on table '%s'.", nil), - ErrForeignKeyCannotUseVirtualColumn: mysql.Message("Foreign key '%s' uses virtual column '%s' which is not supported.", nil), - ErrForeignKeyNoColumnInParent: mysql.Message("Failed to add the foreign key constraint. Missing column '%s' for constraint '%s' in the referenced table '%s'", nil), - ErrDataTruncatedFunctionalIndex: mysql.Message("Data truncated for expression index '%s' at row %d", nil), - ErrDataOutOfRangeFunctionalIndex: mysql.Message("Value is out of range for expression index '%s' at row %d", nil), - ErrFunctionalIndexOnJSONOrGeometryFunction: mysql.Message("Cannot create an expression index on a function that returns a JSON or GEOMETRY value", nil), - ErrFunctionalIndexRefAutoIncrement: mysql.Message("Expression index '%s' cannot refer to an auto-increment column", nil), - ErrCannotDropColumnFunctionalIndex: mysql.Message("Cannot drop column '%s' because it is used by an expression index. In order to drop the column, you must remove the expression index", nil), - ErrFunctionalIndexPrimaryKey: mysql.Message("The primary key cannot be an expression index", nil), - ErrFunctionalIndexOnBlob: mysql.Message("Cannot create an expression index on an expression that returns a BLOB or TEXT. Please consider using CAST", nil), - ErrFunctionalIndexFunctionIsNotAllowed: mysql.Message("Expression of expression index '%s' contains a disallowed function", nil), - ErrFulltextFunctionalIndex: mysql.Message("Fulltext expression index is not supported", nil), - ErrSpatialFunctionalIndex: mysql.Message("Spatial expression index is not supported", nil), - ErrWrongKeyColumnFunctionalIndex: mysql.Message("The used storage engine cannot index the expression '%s'", nil), - ErrFunctionalIndexOnField: mysql.Message("Expression index on a column is not supported. Consider using a regular index instead", nil), - ErrFKIncompatibleColumns: mysql.Message("Referencing column '%s' and referenced column '%s' in foreign key constraint '%s' are incompatible.", nil), - ErrFunctionalIndexRowValueIsNotAllowed: mysql.Message("Expression of expression index '%s' cannot refer to a row value", nil), - ErrNonBooleanExprForCheckConstraint: mysql.Message("An expression of non-boolean type specified to a check constraint '%s'.", nil), - ErrColumnCheckConstraintReferencesOtherColumn: mysql.Message("Column check constraint '%s' references other column.", nil), - ErrCheckConstraintNamedFunctionIsNotAllowed: mysql.Message("An expression of a check constraint '%s' contains disallowed function: %s.", nil), - ErrCheckConstraintFunctionIsNotAllowed: mysql.Message("An expression of a check constraint '%s' contains disallowed function.", nil), - ErrCheckConstraintVariables: mysql.Message("An expression of a check constraint '%s' cannot refer to a user or system variable.", nil), - ErrCheckConstraintRefersAutoIncrementColumn: mysql.Message("Check constraint '%s' cannot refer to an auto-increment column.", nil), - ErrCheckConstraintViolated: mysql.Message("Check constraint '%s' is violated.", nil), - ErrTableCheckConstraintReferUnknown: mysql.Message("Check constraint '%s' refers to non-existing column '%s'.", nil), - ErrCheckConstraintDupName: mysql.Message("Duplicate check constraint name '%s'.", nil), - ErrCheckConstraintClauseUsingFKReferActionColumn: mysql.Message("Column '%s' cannot be used in a check constraint '%s': needed in a foreign key constraint referential action.", nil), - ErrDependentByFunctionalIndex: mysql.Message("Column '%s' has an expression index dependency and cannot be dropped or renamed", nil), - ErrDependentByPartitionFunctional: mysql.Message("Column '%s' has a partitioning function dependency and cannot be dropped or renamed", nil), - ErrCannotConvertString: mysql.Message("Cannot convert string '%.64s' from %s to %s", nil), - ErrInvalidJSONType: mysql.Message("Invalid JSON type in argument %d to function %s; an %s is required.", nil), - ErrInvalidJSONValueForFuncIndex: mysql.Message("Invalid JSON value for CAST for expression index '%s'", nil), - ErrJSONValueOutOfRangeForFuncIndex: mysql.Message("Out of range JSON value for CAST for expression index '%s'", nil), - ErrFunctionalIndexDataIsTooLong: mysql.Message("Data too long for expression index '%s'", nil), - ErrFunctionalIndexNotApplicable: mysql.Message("Cannot use expression index '%s' due to type or collation conversion", nil), - ErrUnsupportedConstraintCheck: mysql.Message("%s is not supported", nil), - ErrDynamicPrivilegeNotRegistered: mysql.Message("Dynamic privilege '%s' is not registered with the server.", nil), - ErrIllegalPrivilegeLevel: mysql.Message("Illegal privilege level specified for %s", nil), - ErrCTERecursiveRequiresUnion: mysql.Message("Recursive Common Table Expression '%s' should contain a UNION", nil), - ErrCTERecursiveRequiresNonRecursiveFirst: mysql.Message("Recursive Common Table Expression '%s' should have one or more non-recursive query blocks followed by one or more recursive ones", nil), - ErrCTERecursiveForbidsAggregation: mysql.Message("Recursive Common Table Expression '%s' can contain neither aggregation nor window functions in recursive query block", nil), - ErrCTERecursiveForbiddenJoinOrder: mysql.Message("In recursive query block of Recursive Common Table Expression '%s', the recursive table must neither be in the right argument of a LEFT JOIN, nor be forced to be non-first with join order hints", nil), - ErrInvalidRequiresSingleReference: mysql.Message("In recursive query block of Recursive Common Table Expression '%s', the recursive table must be referenced only once, and not in any subquery", nil), - ErrCTEMaxRecursionDepth: mysql.Message("Recursive query aborted after %d iterations. Try increasing @@cte_max_recursion_depth to a larger value", nil), - ErrTableWithoutPrimaryKey: mysql.Message("Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.", nil), - ErrConstraintNotFound: mysql.Message("Constraint '%s' does not exist.", nil), - ErrDependentByCheckConstraint: mysql.Message("Check constraint '%s' uses column '%s', hence column cannot be dropped or renamed.", nil), - ErrJSONInBooleanContext: mysql.Message("Evaluating a JSON value in SQL boolean context does an implicit comparison against JSON integer 0; if this is not what you want, consider converting JSON to a SQL numeric type with JSON_VALUE RETURNING", nil), +var MySQLErrName = map[uint16]*ErrMessage{ + ErrHashchk: Message("hashchk", nil), + ErrNisamchk: Message("isamchk", nil), + ErrNo: Message("NO", nil), + ErrYes: Message("YES", nil), + ErrCantCreateFile: Message("Can't create file '%-.200s' (errno: %d - %s)", nil), + ErrCantCreateTable: Message("Can't create table '%-.200s' (errno: %d)", nil), + ErrCantCreateDB: Message("Can't create database '%-.192s' (errno: %d)", nil), + ErrDBCreateExists: Message("Can't create database '%-.192s'; database exists", nil), + ErrDBDropExists: Message("Can't drop database '%-.192s'; database doesn't exist", nil), + ErrDBDropDelete: Message("Error dropping database (can't delete '%-.192s', errno: %d)", nil), + ErrDBDropRmdir: Message("Error dropping database (can't rmdir '%-.192s', errno: %d)", nil), + ErrCantDeleteFile: Message("Error on delete of '%-.192s' (errno: %d - %s)", nil), + ErrCantFindSystemRec: Message("Can't read record in system table", nil), + ErrCantGetStat: Message("Can't get status of '%-.200s' (errno: %d - %s)", nil), + ErrCantGetWd: Message("Can't get working directory (errno: %d - %s)", nil), + ErrCantLock: Message("Can't lock file (errno: %d - %s)", nil), + ErrCantOpenFile: Message("Can't open file: '%-.200s' (errno: %d - %s)", nil), + ErrFileNotFound: Message("Can't find file: '%-.200s' (errno: %d - %s)", nil), + ErrCantReadDir: Message("Can't read dir of '%-.192s' (errno: %d - %s)", nil), + ErrCantSetWd: Message("Can't change dir to '%-.192s' (errno: %d - %s)", nil), + ErrCheckread: Message("Record has changed since last read in table '%-.192s'", nil), + ErrDiskFull: Message("Disk full (%s); waiting for someone to free some space... (errno: %d - %s)", nil), + ErrDupKey: Message("Can't write; duplicate key in table '%-.192s'", nil), + ErrErrorOnClose: Message("Error on close of '%-.192s' (errno: %d - %s)", nil), + ErrErrorOnRead: Message("Error reading file '%-.200s' (errno: %d - %s)", nil), + ErrErrorOnRename: Message("Error on rename of '%-.210s' to '%-.210s' (errno: %d - %s)", nil), + ErrErrorOnWrite: Message("Error writing file '%-.200s' (errno: %d - %s)", nil), + ErrFileUsed: Message("'%-.192s' is locked against change", nil), + ErrFilsortAbort: Message("Sort aborted", nil), + ErrFormNotFound: Message("View '%-.192s' doesn't exist for '%-.192s'", nil), + ErrGetErrno: Message("Got error %d from storage engine", nil), + ErrIllegalHa: Message("Table storage engine for '%-.192s' doesn't have this option", nil), + ErrKeyNotFound: Message("Can't find record in '%-.192s'", nil), + ErrNotFormFile: Message("Incorrect information in file: '%-.200s'", nil), + ErrNotKeyFile: Message("Incorrect key file for table '%-.200s'; try to repair it", nil), + ErrOldKeyFile: Message("Old key file for table '%-.192s'; repair it!", nil), + ErrOpenAsReadonly: Message("Table '%-.192s' is read only", nil), + ErrOutofMemory: Message("Out of memory; restart server and try again (needed %d bytes)", nil), + ErrOutOfSortMemory: Message("Out of sort memory, consider increasing server sort buffer size", nil), + ErrUnexpectedEOF: Message("Unexpected EOF found when reading file '%-.192s' (errno: %d - %s)", nil), + ErrConCount: Message("Too many connections", nil), + ErrOutOfResources: Message("Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", nil), + ErrBadHost: Message("Can't get hostname for your address", nil), + ErrHandshake: Message("Bad handshake", nil), + ErrDBaccessDenied: Message("Access denied for user '%-.48s'@'%-.255s' to database '%-.192s'", nil), + ErrAccessDenied: Message("Access denied for user '%-.48s'@'%-.255s' (using password: %s)", nil), + ErrNoDB: Message("No database selected", nil), + ErrUnknownCom: Message("Unknown command", nil), + ErrBadNull: Message("Column '%-.192s' cannot be null", nil), + ErrBadDB: Message("Unknown database '%-.192s'", nil), + ErrTableExists: Message("Table '%-.192s' already exists", nil), + ErrBadTable: Message("Unknown table '%-.100s'", nil), + ErrNonUniq: Message("Column '%-.192s' in %-.192s is ambiguous", nil), + ErrServerShutdown: Message("Server shutdown in progress", nil), + ErrBadField: Message("Unknown column '%-.192s' in '%-.192s'", nil), + ErrFieldNotInGroupBy: Message("Expression #%d of %s is not in GROUP BY clause and contains nonaggregated column '%s' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by", nil), + ErrWrongGroupField: Message("Can't group on '%-.192s'", nil), + ErrWrongSumSelect: Message("Statement has sum functions and columns in same statement", nil), + ErrWrongValueCount: Message("Column count doesn't match value count", nil), + ErrTooLongIdent: Message("Identifier name '%-.100s' is too long", nil), + ErrDupFieldName: Message("Duplicate column name '%-.192s'", nil), + ErrDupKeyName: Message("Duplicate key name '%-.192s'", nil), + ErrDupEntry: Message("Duplicate entry '%-.64s' for key '%-.192s'", []int{0}), + ErrWrongFieldSpec: Message("Incorrect column specifier for column '%-.192s'", nil), + ErrParse: Message("%s %s", nil), + ErrEmptyQuery: Message("Query was empty", nil), + ErrNonuniqTable: Message("Not unique table/alias: '%-.192s'", nil), + ErrInvalidDefault: Message("Invalid default value for '%-.192s'", nil), + ErrMultiplePriKey: Message("Multiple primary key defined", nil), + ErrTooManyKeys: Message("Too many keys specified; max %d keys allowed", nil), + ErrTooManyKeyParts: Message("Too many key parts specified; max %d parts allowed", nil), + ErrTooLongKey: Message("Specified key was too long (%d bytes); max key length is %d bytes", nil), + ErrKeyColumnDoesNotExits: Message("Key column '%-.192s' doesn't exist in table", nil), + ErrBlobUsedAsKey: Message("BLOB column '%-.192s' can't be used in key specification with the used table type", nil), + ErrJSONVacuousPath: Message("The path expression '$' is not allowed in this context.", nil), + ErrJSONBadOneOrAllArg: Message("The oneOrAll argument to %s may take these values: 'one' or 'all'.", nil), + ErrTooBigFieldlength: Message("Column length too big for column '%-.192s' (max = %d); use BLOB or TEXT instead", nil), + ErrWrongAutoKey: Message("Incorrect table definition; there can be only one auto column and it must be defined as a key", nil), + ErrReady: Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d", nil), + ErrNormalShutdown: Message("%s: Normal shutdown\n", nil), + ErrGotSignal: Message("%s: Got signal %d. Aborting!\n", nil), + ErrShutdownComplete: Message("%s: Shutdown complete\n", nil), + ErrForcingClose: Message("%s: Forcing close of thread %d user: '%-.48s'\n", nil), + ErrIpsock: Message("Can't create IP socket", nil), + ErrNoSuchIndex: Message("Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table", nil), + ErrWrongFieldTerminators: Message("Field separator argument is not what is expected; check the manual", nil), + ErrBlobsAndNoTerminated: Message("You can't use fixed rowlength with BLOBs; please use 'fields terminated by'", nil), + ErrTextFileNotReadable: Message("The file '%-.128s' must be in the database directory or be readable by all", nil), + ErrFileExists: Message("File '%-.200s' already exists", nil), + ErrLoadInfo: Message("Records: %d Deleted: %d Skipped: %d Warnings: %d", nil), + ErrAlterInfo: Message("Records: %d Duplicates: %d", nil), + ErrWrongSubKey: Message("Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys", nil), + ErrCantRemoveAllFields: Message("You can't delete all columns with ALTER TABLE; use DROP TABLE instead", nil), + ErrCantDropFieldOrKey: Message("Can't DROP '%-.192s'; check that column/key exists", nil), + ErrInsertInfo: Message("Records: %d Duplicates: %d Warnings: %d", nil), + ErrUpdateTableUsed: Message("You can't specify target table '%-.192s' for update in FROM clause", nil), + ErrNoSuchThread: Message("Unknown thread id: %d", nil), + ErrKillDenied: Message("You are not owner of thread %d", nil), + ErrNoTablesUsed: Message("No tables used", nil), + ErrTooBigSet: Message("Too many strings for column %-.192s and SET", nil), + ErrNoUniqueLogFile: Message("Can't generate a unique log-filename %-.200s.(1-999)\n", nil), + ErrTableNotLockedForWrite: Message("Table '%-.192s' was locked with a READ lock and can't be updated", nil), + ErrTableNotLocked: Message("Table '%-.192s' was not locked with LOCK TABLES", nil), + ErrBlobCantHaveDefault: Message("BLOB/TEXT/JSON column '%-.192s' can't have a default value", nil), + ErrWrongDBName: Message("Incorrect database name '%-.100s'", nil), + ErrWrongTableName: Message("Incorrect table name '%-.100s'", nil), + ErrTooBigSelect: Message("The SELECT would examine more than MAXJOINSIZE rows; check your WHERE and use SET SQLBIGSELECTS=1 or SET MAXJOINSIZE=# if the SELECT is okay", nil), + ErrUnknown: Message("Unknown error", nil), + ErrUnknownProcedure: Message("Unknown procedure '%-.192s'", nil), + ErrWrongParamcountToProcedure: Message("Incorrect parameter count to procedure '%-.192s'", nil), + ErrWrongParametersToProcedure: Message("Incorrect parameters to procedure '%-.192s'", nil), + ErrUnknownTable: Message("Unknown table '%-.192s' in %-.32s", nil), + ErrFieldSpecifiedTwice: Message("Column '%-.192s' specified twice", nil), + ErrInvalidGroupFuncUse: Message("Invalid use of group function", nil), + ErrUnsupportedExtension: Message("Table '%-.192s' uses an extension that doesn't exist in this MySQL version", nil), + ErrTableMustHaveColumns: Message("A table must have at least 1 column", nil), + ErrRecordFileFull: Message("The table '%-.192s' is full", nil), + ErrUnknownCharacterSet: Message("Unknown character set: '%-.64s'", nil), + ErrTooManyTables: Message("Too many tables; MySQL can only use %d tables in a join", nil), + ErrTooManyFields: Message("Too many columns", nil), + ErrTooBigRowsize: Message("Row size too large. The maximum row size for the used table type, not counting BLOBs, is %d. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs", nil), + ErrStackOverrun: Message("Thread stack overrun: Used: %d of a %d stack. Use 'mysqld --threadStack=#' to specify a bigger stack if needed", nil), + ErrWrongOuterJoin: Message("Cross dependency found in OUTER JOIN; examine your ON conditions", nil), + ErrNullColumnInIndex: Message("Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler", nil), + ErrCantFindUdf: Message("Can't load function '%-.192s'", nil), + ErrCantInitializeUdf: Message("Can't initialize function '%-.192s'; %-.80s", nil), + ErrUdfNoPaths: Message("No paths allowed for shared library", nil), + ErrUdfExists: Message("Function '%-.192s' already exists", nil), + ErrCantOpenLibrary: Message("Can't open shared library '%-.192s' (errno: %d %-.128s)", nil), + ErrCantFindDlEntry: Message("Can't find symbol '%-.128s' in library", nil), + ErrFunctionNotDefined: Message("Function '%-.192s' is not defined", nil), + ErrHostIsBlocked: Message("Host '%-.255s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", nil), + ErrHostNotPrivileged: Message("Host '%-.255s' is not allowed to connect to this MySQL server", nil), + ErrPasswordAnonymousUser: Message("You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", nil), + ErrPasswordNotAllowed: Message("You must have privileges to update tables in the mysql database to be able to change passwords for others", nil), + ErrPasswordNoMatch: Message("Can't find any matching row in the user table", nil), + ErrUpdateInfo: Message("Rows matched: %d Changed: %d Warnings: %d", nil), + ErrCantCreateThread: Message("Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", nil), + ErrWrongValueCountOnRow: Message("Column count doesn't match value count at row %d", nil), + ErrCantReopenTable: Message("Can't reopen table: '%-.192s'", nil), + ErrInvalidUseOfNull: Message("Invalid use of NULL value", nil), + ErrRegexp: Message("Got error '%-.64s' from regexp", nil), + ErrMixOfGroupFuncAndFields: Message("Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", nil), + ErrNonexistingGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.255s'", nil), + ErrTableaccessDenied: Message("%-.128s command denied to user '%-.48s'@'%-.255s' for table '%-.64s'", nil), + ErrColumnaccessDenied: Message("%-.16s command denied to user '%-.48s'@'%-.255s' for column '%-.192s' in table '%-.192s'", nil), + ErrIllegalGrantForTable: Message("Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used", nil), + ErrGrantWrongHostOrUser: Message("The host or user argument to GRANT is too long", nil), + ErrNoSuchTable: Message("Table '%-.192s.%-.192s' doesn't exist", nil), + ErrNonexistingTableGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.255s' on table '%-.192s'", nil), + ErrNotAllowedCommand: Message("The used command is not allowed with this MySQL version", nil), + ErrSyntax: Message("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use", nil), + ErrDelayedCantChangeLock: Message("Delayed insert thread couldn't get requested lock for table %-.192s", nil), + ErrTooManyDelayedThreads: Message("Too many delayed threads in use", nil), + ErrAbortingConnection: Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' (%-.64s)", nil), + ErrNetPacketTooLarge: Message("Got a packet bigger than 'max_allowed_packet' bytes", nil), + ErrNetReadErrorFromPipe: Message("Got a read error from the connection pipe", nil), + ErrNetFcntl: Message("Got an error from fcntl()", nil), + ErrNetPacketsOutOfOrder: Message("Got packets out of order", nil), + ErrNetUncompress: Message("Couldn't uncompress communication packet", nil), + ErrNetRead: Message("Got an error reading communication packets", nil), + ErrNetReadInterrupted: Message("Got timeout reading communication packets", nil), + ErrNetErrorOnWrite: Message("Got an error writing communication packets", nil), + ErrNetWriteInterrupted: Message("Got timeout writing communication packets", nil), + ErrTooLongString: Message("Result string is longer than 'maxAllowedPacket' bytes", nil), + ErrTableCantHandleBlob: Message("The used table type doesn't support BLOB/TEXT columns", nil), + ErrTableCantHandleAutoIncrement: Message("The used table type doesn't support AUTOINCREMENT columns", nil), + ErrDelayedInsertTableLocked: Message("INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES", nil), + ErrWrongColumnName: Message("Incorrect column name '%-.100s'", nil), + ErrWrongKeyColumn: Message("The used storage engine can't index column '%-.192s'", nil), + ErrWrongMrgTable: Message("Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist", nil), + ErrDupUnique: Message("Can't write, because of unique constraint, to table '%-.192s'", nil), + ErrBlobKeyWithoutLength: Message("BLOB/TEXT column '%-.192s' used in key specification without a key length", nil), + ErrPrimaryCantHaveNull: Message("All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", nil), + ErrTooManyRows: Message("Result consisted of more than one row", nil), + ErrRequiresPrimaryKey: Message("This table type requires a primary key", nil), + ErrNoRaidCompiled: Message("This version of MySQL is not compiled with RAID support", nil), + ErrUpdateWithoutKeyInSafeMode: Message("You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", nil), + ErrKeyDoesNotExist: Message("Key '%-.192s' doesn't exist in table '%-.192s'", nil), + ErrCheckNoSuchTable: Message("Can't open table", nil), + ErrCheckNotImplemented: Message("The storage engine for the table doesn't support %s", nil), + ErrCantDoThisDuringAnTransaction: Message("You are not allowed to execute this command in a transaction", nil), + ErrErrorDuringCommit: Message("Got error %d during COMMIT", nil), + ErrErrorDuringRollback: Message("Got error %d during ROLLBACK", nil), + ErrErrorDuringFlushLogs: Message("Got error %d during FLUSHLOGS", nil), + ErrErrorDuringCheckpoint: Message("Got error %d during CHECKPOINT", nil), + ErrNewAbortingConnection: Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' host: '%-.255s' (%-.64s)", nil), + ErrDumpNotImplemented: Message("The storage engine for the table does not support binary table dump", nil), + ErrFlushMasterBinlogClosed: Message("Binlog closed, cannot RESET MASTER", nil), + ErrIndexRebuild: Message("Failed rebuilding the index of dumped table '%-.192s'", nil), + ErrMaster: Message("Error from master: '%-.64s'", nil), + ErrMasterNetRead: Message("Net error reading from master", nil), + ErrMasterNetWrite: Message("Net error writing to master", nil), + ErrFtMatchingKeyNotFound: Message("Can't find FULLTEXT index matching the column list", nil), + ErrLockOrActiveTransaction: Message("Can't execute the given command because you have active locked tables or an active transaction", nil), + ErrUnknownSystemVariable: Message("Unknown system variable '%-.64s'", nil), + ErrCrashedOnUsage: Message("Table '%-.192s' is marked as crashed and should be repaired", nil), + ErrCrashedOnRepair: Message("Table '%-.192s' is marked as crashed and last (automatic?) repair failed", nil), + ErrWarningNotCompleteRollback: Message("Some non-transactional changed tables couldn't be rolled back", nil), + ErrTransCacheFull: Message("Multi-statement transaction required more than 'maxBinlogCacheSize' bytes of storage; increase this mysqld variable and try again", nil), + ErrSlaveMustStop: Message("This operation cannot be performed with a running slave; run STOP SLAVE first", nil), + ErrSlaveNotRunning: Message("This operation requires a running slave; configure slave and do START SLAVE", nil), + ErrBadSlave: Message("The server is not configured as slave; fix in config file or with CHANGE MASTER TO", nil), + ErrMasterInfo: Message("Could not initialize master info structure; more error messages can be found in the MySQL error log", nil), + ErrSlaveThread: Message("Could not create slave thread; check system resources", nil), + ErrTooManyUserConnections: Message("User %-.64s already has more than 'maxUserConnections' active connections", nil), + ErrSetConstantsOnly: Message("You may only use constant expressions with SET", nil), + ErrLockWaitTimeout: Message("Lock wait timeout exceeded; try restarting transaction", nil), + ErrLockTableFull: Message("The total number of locks exceeds the lock table size", nil), + ErrReadOnlyTransaction: Message("Update locks cannot be acquired during a READ UNCOMMITTED transaction", nil), + ErrDropDBWithReadLock: Message("DROP DATABASE not allowed while thread is holding global read lock", nil), + ErrCreateDBWithReadLock: Message("CREATE DATABASE not allowed while thread is holding global read lock", nil), + ErrWrongArguments: Message("Incorrect arguments to %s", nil), + ErrNoPermissionToCreateUser: Message("'%-.48s'@'%-.255s' is not allowed to create new users", nil), + ErrUnionTablesInDifferentDir: Message("Incorrect table definition; all MERGE tables must be in the same database", nil), + ErrLockDeadlock: Message("Deadlock found when trying to get lock; try restarting transaction", nil), + ErrTableCantHandleFt: Message("The used table type doesn't support FULLTEXT indexes", nil), + ErrCannotAddForeign: Message("Cannot add foreign key constraint", nil), + ErrNoReferencedRow: Message("Cannot add or update a child row: a foreign key constraint fails", nil), + ErrRowIsReferenced: Message("Cannot delete or update a parent row: a foreign key constraint fails", nil), + ErrConnectToMaster: Message("Error connecting to master: %-.128s", nil), + ErrQueryOnMaster: Message("Error running query on master: %-.128s", nil), + ErrErrorWhenExecutingCommand: Message("Error when executing command %s: %-.128s", nil), + ErrWrongUsage: Message("Incorrect usage of %s and %s", nil), + ErrWrongNumberOfColumnsInSelect: Message("The used SELECT statements have a different number of columns", nil), + ErrCantUpdateWithReadlock: Message("Can't execute the query because you have a conflicting read lock", nil), + ErrMixingNotAllowed: Message("Mixing of transactional and non-transactional tables is disabled", nil), + ErrDupArgument: Message("Option '%s' used twice in statement", nil), + ErrUserLimitReached: Message("User '%-.64s' has exceeded the '%s' resource (current value: %d)", nil), + ErrSpecificAccessDenied: Message("Access denied; you need (at least one of) the %-.128s privilege(s) for this operation", nil), + ErrLocalVariable: Message("Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", nil), + ErrGlobalVariable: Message("Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", nil), + ErrNoDefault: Message("Variable '%-.64s' doesn't have a default value", nil), + ErrWrongValueForVar: Message("Variable '%-.64s' can't be set to the value of '%-.200s'", nil), + ErrWrongTypeForVar: Message("Incorrect argument type to variable '%-.64s'", nil), + ErrVarCantBeRead: Message("Variable '%-.64s' can only be set, not read", nil), + ErrCantUseOptionHere: Message("Incorrect usage/placement of '%s'", nil), + ErrNotSupportedYet: Message("This version of TiDB doesn't yet support '%s'", nil), + ErrMasterFatalErrorReadingBinlog: Message("Got fatal error %d from master when reading data from binary log: '%-.320s'", nil), + ErrSlaveIgnoredTable: Message("Slave SQL thread ignored the query because of replicate-*-table rules", nil), + ErrIncorrectGlobalLocalVar: Message("Variable '%-.192s' is a %s variable", nil), + ErrWrongFkDef: Message("Incorrect foreign key definition for '%-.192s': %s", nil), + ErrKeyRefDoNotMatchTableRef: Message("Key reference and table reference don't match", nil), + ErrOperandColumns: Message("Operand should contain %d column(s)", nil), + ErrSubqueryNo1Row: Message("Subquery returns more than 1 row", nil), + ErrUnknownStmtHandler: Message("Unknown prepared statement handler (%.*s) given to %s", nil), + ErrCorruptHelpDB: Message("Help database is corrupt or does not exist", nil), + ErrCyclicReference: Message("Cyclic reference on subqueries", nil), + ErrAutoConvert: Message("Converting column '%s' from %s to %s", nil), + ErrIllegalReference: Message("Reference '%-.64s' not supported (%s)", nil), + ErrDerivedMustHaveAlias: Message("Every derived table must have its own alias", nil), + ErrSelectReduced: Message("Select %d was reduced during optimization", nil), + ErrTablenameNotAllowedHere: Message("Table '%s' from one of the %ss cannot be used in %s", nil), + ErrNotSupportedAuthMode: Message("Client does not support authentication protocol requested by server; consider upgrading MySQL client", nil), + ErrSpatialCantHaveNull: Message("All parts of a SPATIAL index must be NOT NULL", nil), + ErrCollationCharsetMismatch: Message("COLLATION '%s' is not valid for CHARACTER SET '%s'", nil), + ErrSlaveWasRunning: Message("Slave is already running", nil), + ErrSlaveWasNotRunning: Message("Slave already has been stopped", nil), + ErrTooBigForUncompress: Message("Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", nil), + ErrZlibZMem: Message("ZLIB: Not enough memory", nil), + ErrZlibZBuf: Message("ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", nil), + ErrZlibZData: Message("ZLIB: Input data corrupted", nil), + ErrCutValueGroupConcat: Message("Some rows were cut by GROUPCONCAT(%s)", []int{0}), + ErrWarnTooFewRecords: Message("Row %d doesn't contain data for all columns", nil), + ErrWarnTooManyRecords: Message("Row %d was truncated; it contained more data than there were input columns", nil), + ErrWarnNullToNotnull: Message("Column set to default value; NULL supplied to NOT NULL column '%s' at row %d", nil), + ErrWarnDataOutOfRange: Message("Out of range value for column '%s' at row %d", nil), + WarnDataTruncated: Message("Data truncated for column '%s' at row %d", nil), + ErrWarnUsingOtherHandler: Message("Using storage engine %s for table '%s'", nil), + ErrCantAggregate2collations: Message("Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", nil), + ErrDropUser: Message("Cannot drop one or more of the requested users", nil), + ErrRevokeGrants: Message("Can't revoke all privileges for one or more of the requested users", nil), + ErrCantAggregate3collations: Message("Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", nil), + ErrCantAggregateNcollations: Message("Illegal mix of collations for operation '%s'", nil), + ErrVariableIsNotStruct: Message("Variable '%-.64s' is not a variable component (can't be used as XXXX.variableName)", nil), + ErrUnknownCollation: Message("Unknown collation: '%-.64s'", nil), + ErrSlaveIgnoredSslParams: Message("SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", nil), + ErrServerIsInSecureAuthMode: Message("Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", nil), + ErrWarnFieldResolved: Message("Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d", nil), + ErrBadSlaveUntilCond: Message("Incorrect parameter or combination of parameters for START SLAVE UNTIL", nil), + ErrMissingSkipSlave: Message("It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart", nil), + ErrUntilCondIgnored: Message("SQL thread is not to be started so UNTIL options are ignored", nil), + ErrWrongNameForIndex: Message("Incorrect index name '%-.100s'", nil), + ErrWrongNameForCatalog: Message("Incorrect catalog name '%-.100s'", nil), + ErrWarnQcResize: Message("Query cache failed to set size %d; new query cache size is %d", nil), + ErrBadFtColumn: Message("Column '%-.192s' cannot be part of FULLTEXT index", nil), + ErrUnknownKeyCache: Message("Unknown key cache '%-.100s'", nil), + ErrWarnHostnameWontWork: Message("MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work", nil), + ErrUnknownStorageEngine: Message("Unknown storage engine '%s'", nil), + ErrWarnDeprecatedSyntax: Message("'%s' is deprecated and will be removed in a future release. Please use %s instead", nil), + ErrNonUpdatableTable: Message("The target table %-.100s of the %s is not updatable", nil), + ErrFeatureDisabled: Message("The '%s' feature is disabled; you need MySQL built with '%s' to have it working", nil), + ErrOptionPreventsStatement: Message("The MySQL server is running with the %s option so it cannot execute this statement", nil), + ErrDuplicatedValueInType: Message("Column '%-.100s' has duplicated value '%-.64s' in %s", []int{1}), + ErrTruncatedWrongValue: Message("Truncated incorrect %-.64s value: '%-.128s'", []int{1}), + ErrTooMuchAutoTimestampCols: Message("Incorrect table definition; there can be only one TIMESTAMP column with CURRENTTIMESTAMP in DEFAULT or ON UPDATE clause", nil), + ErrInvalidOnUpdate: Message("Invalid ON UPDATE clause for '%-.192s' column", nil), + ErrUnsupportedPs: Message("This command is not supported in the prepared statement protocol yet", nil), + ErrGetErrmsg: Message("Got error %d '%-.100s' from %s", nil), + ErrGetTemporaryErrmsg: Message("Got temporary error %d '%-.100s' from %s", nil), + ErrUnknownTimeZone: Message("Unknown or incorrect time zone: '%-.64s'", nil), + ErrWarnInvalidTimestamp: Message("Invalid TIMESTAMP value in column '%s' at row %d", nil), + ErrInvalidCharacterString: Message("Invalid %s character string: '%.64s'", []int{1}), + ErrWarnAllowedPacketOverflowed: Message("Result of %s() was larger than max_allowed_packet (%d) - truncated", nil), + ErrConflictingDeclarations: Message("Conflicting declarations: '%s%s' and '%s%s'", nil), + ErrSpNoRecursiveCreate: Message("Can't create a %s from within another stored routine", nil), + ErrSpAlreadyExists: Message("%s %s already exists", nil), + ErrSpDoesNotExist: Message("%s %s does not exist", nil), + ErrSpDropFailed: Message("Failed to DROP %s %s", nil), + ErrSpStoreFailed: Message("Failed to CREATE %s %s", nil), + ErrSpLilabelMismatch: Message("%s with no matching label: %s", nil), + ErrSpLabelRedefine: Message("Redefining label %s", nil), + ErrSpLabelMismatch: Message("End-label %s without match", nil), + ErrSpUninitVar: Message("Referring to uninitialized variable %s", nil), + ErrSpBadselect: Message("PROCEDURE %s can't return a result set in the given context", nil), + ErrSpBadreturn: Message("RETURN is only allowed in a FUNCTION", nil), + ErrSpBadstatement: Message("%s is not allowed in stored procedures", nil), + ErrUpdateLogDeprecatedIgnored: Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been ignored.", nil), + ErrUpdateLogDeprecatedTranslated: Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been translated to SET SQLLOGBIN.", nil), + ErrQueryInterrupted: Message("Query execution was interrupted", nil), + ErrSpWrongNoOfArgs: Message("Incorrect number of arguments for %s %s; expected %d, got %d", nil), + ErrSpCondMismatch: Message("Undefined CONDITION: %s", nil), + ErrSpNoreturn: Message("No RETURN found in FUNCTION %s", nil), + ErrSpNoreturnend: Message("FUNCTION %s ended without RETURN", nil), + ErrSpBadCursorQuery: Message("Cursor statement must be a SELECT", nil), + ErrSpBadCursorSelect: Message("Cursor SELECT must not have INTO", nil), + ErrSpCursorMismatch: Message("Undefined CURSOR: %s", nil), + ErrSpCursorAlreadyOpen: Message("Cursor is already open", nil), + ErrSpCursorNotOpen: Message("Cursor is not open", nil), + ErrSpUndeclaredVar: Message("Undeclared variable: %s", nil), + ErrSpWrongNoOfFetchArgs: Message("Incorrect number of FETCH variables", nil), + ErrSpFetchNoData: Message("No data - zero rows fetched, selected, or processed", nil), + ErrSpDupParam: Message("Duplicate parameter: %s", nil), + ErrSpDupVar: Message("Duplicate variable: %s", nil), + ErrSpDupCond: Message("Duplicate condition: %s", nil), + ErrSpDupCurs: Message("Duplicate cursor: %s", nil), + ErrSpCantAlter: Message("Failed to ALTER %s %s", nil), + ErrSpSubselectNyi: Message("Subquery value not supported", nil), + ErrStmtNotAllowedInSfOrTrg: Message("%s is not allowed in stored function or trigger", nil), + ErrSpVarcondAfterCurshndlr: Message("Variable or condition declaration after cursor or handler declaration", nil), + ErrSpCursorAfterHandler: Message("Cursor declaration after handler declaration", nil), + ErrSpCaseNotFound: Message("Case not found for CASE statement", nil), + ErrFparserTooBigFile: Message("Configuration file '%-.192s' is too big", nil), + ErrFparserBadHeader: Message("Malformed file type header in file '%-.192s'", nil), + ErrFparserEOFInComment: Message("Unexpected end of file while parsing comment '%-.200s'", nil), + ErrFparserErrorInParameter: Message("Error while parsing parameter '%-.192s' (line: '%-.192s')", nil), + ErrFparserEOFInUnknownParameter: Message("Unexpected end of file while skipping unknown parameter '%-.192s'", nil), + ErrViewNoExplain: Message("EXPLAIN/SHOW can not be issued; lacking privileges for underlying table", nil), + ErrFrmUnknownType: Message("File '%-.192s' has unknown type '%-.64s' in its header", nil), + ErrWrongObject: Message("'%-.192s.%-.192s' is not %s", nil), + ErrNonupdateableColumn: Message("Column '%-.192s' is not updatable", nil), + ErrViewSelectDerived: Message("View's SELECT contains a subquery in the FROM clause", nil), + ErrViewSelectClause: Message("View's SELECT contains a '%s' clause", nil), + ErrViewSelectVariable: Message("View's SELECT contains a variable or parameter", nil), + ErrViewSelectTmptable: Message("View's SELECT refers to a temporary table '%-.192s'", nil), + ErrViewWrongList: Message("In definition of view, derived table or common table expression, SELECT list and column names list have different column counts", nil), + ErrWarnViewMerge: Message("View merge algorithm can't be used here for now (assumed undefined algorithm)", nil), + ErrWarnViewWithoutKey: Message("View being updated does not have complete key of underlying table in it", nil), + ErrViewInvalid: Message("View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them", nil), + ErrSpNoDropSp: Message("Can't drop or alter a %s from within another stored routine", nil), + ErrSpGotoInHndlr: Message("GOTO is not allowed in a stored procedure handler", nil), + ErrTrgAlreadyExists: Message("Trigger already exists", nil), + ErrTrgDoesNotExist: Message("Trigger does not exist", nil), + ErrTrgOnViewOrTempTable: Message("Trigger's '%-.192s' is view or temporary table", nil), + ErrTrgCantChangeRow: Message("Updating of %s row is not allowed in %strigger", nil), + ErrTrgNoSuchRowInTrg: Message("There is no %s row in %s trigger", nil), + ErrNoDefaultForField: Message("Field '%-.192s' doesn't have a default value", nil), + ErrDivisionByZero: Message("Division by 0", nil), + ErrTruncatedWrongValueForField: Message("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %d", []int{0, 1}), + ErrIllegalValueForType: Message("Illegal %s '%-.192s' value found during parsing", []int{1}), + ErrViewNonupdCheck: Message("CHECK OPTION on non-updatable view '%-.192s.%-.192s'", nil), + ErrViewCheckFailed: Message("CHECK OPTION failed '%-.192s.%-.192s'", nil), + ErrProcaccessDenied: Message("%-.16s command denied to user '%-.48s'@'%-.255s' for routine '%-.192s'", nil), + ErrRelayLogFail: Message("Failed purging old relay logs: %s", nil), + ErrPasswdLength: Message("Password hash should be a %d-digit hexadecimal number", nil), + ErrUnknownTargetBinlog: Message("Target log not found in binlog index", nil), + ErrIoErrLogIndexRead: Message("I/O error reading log index file", nil), + ErrBinlogPurgeProhibited: Message("Server configuration does not permit binlog purge", nil), + ErrFseekFail: Message("Failed on fseek()", nil), + ErrBinlogPurgeFatalErr: Message("Fatal error during log purge", nil), + ErrLogInUse: Message("A purgeable log is in use, will not purge", nil), + ErrLogPurgeUnknownErr: Message("Unknown error during log purge", nil), + ErrRelayLogInit: Message("Failed initializing relay log position: %s", nil), + ErrNoBinaryLogging: Message("You are not using binary logging", nil), + ErrReservedSyntax: Message("The '%-.64s' syntax is reserved for purposes internal to the MySQL server", nil), + ErrWsasFailed: Message("WSAStartup Failed", nil), + ErrDiffGroupsProc: Message("Can't handle procedures with different groups yet", nil), + ErrNoGroupForProc: Message("Select must have a group with this procedure", nil), + ErrOrderWithProc: Message("Can't use ORDER clause with this procedure", nil), + ErrLoggingProhibitChangingOf: Message("Binary logging and replication forbid changing the global server %s", nil), + ErrNoFileMapping: Message("Can't map file: %-.200s, errno: %d", nil), + ErrWrongMagic: Message("Wrong magic in %-.64s", nil), + ErrPsManyParam: Message("Prepared statement contains too many placeholders", nil), + ErrKeyPart0: Message("Key part '%-.192s' length cannot be 0", nil), + ErrViewChecksum: Message("View text checksum failed", nil), + ErrViewMultiupdate: Message("Can not modify more than one base table through a join view '%-.192s.%-.192s'", nil), + ErrViewNoInsertFieldList: Message("Can not insert into join view '%-.192s.%-.192s' without fields list", nil), + ErrViewDeleteMergeView: Message("Can not delete from join view '%-.192s.%-.192s'", nil), + ErrCannotUser: Message("Operation %s failed for %.256s", nil), + ErrGrantRole: Message("Unknown authorization ID %.256s", nil), + ErrXaerNota: Message("XAERNOTA: Unknown XID", nil), + ErrXaerInval: Message("XAERINVAL: Invalid arguments (or unsupported command)", nil), + ErrXaerRmfail: Message("XAERRMFAIL: The command cannot be executed when global transaction is in the %.64s state", nil), + ErrXaerOutside: Message("XAEROUTSIDE: Some work is done outside global transaction", nil), + ErrXaerRmerr: Message("XAERRMERR: Fatal error occurred in the transaction branch - check your data for consistency", nil), + ErrXaRbrollback: Message("XARBROLLBACK: Transaction branch was rolled back", nil), + ErrNonexistingProcGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.255s' on routine '%-.192s'", nil), + ErrProcAutoGrantFail: Message("Failed to grant EXECUTE and ALTER ROUTINE privileges", nil), + ErrProcAutoRevokeFail: Message("Failed to revoke all privileges to dropped routine", nil), + ErrDataTooLong: Message("Data too long for column '%s' at row %d", nil), + ErrSpBadSQLstate: Message("Bad SQLSTATE: '%s'", nil), + ErrStartup: Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d %s", nil), + ErrLoadFromFixedSizeRowsToVar: Message("Can't load value from file with fixed size rows to variable", nil), + ErrCantCreateUserWithGrant: Message("You are not allowed to create a user with GRANT", nil), + ErrWrongValueForType: Message("Incorrect %-.32s value: '%-.128s' for function %-.32s", nil), + ErrTableDefChanged: Message("Table definition has changed, please retry transaction", nil), + ErrSpDupHandler: Message("Duplicate handler declared in the same block", nil), + ErrSpNotVarArg: Message("OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger", nil), + ErrSpNoRetset: Message("Not allowed to return a result set from a %s", nil), + ErrCantCreateGeometryObject: Message("Cannot get geometry object from data you send to the GEOMETRY field", nil), + ErrFailedRoutineBreakBinlog: Message("A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes", nil), + ErrBinlogUnsafeRoutine: Message("This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), + ErrBinlogCreateRoutineNeedSuper: Message("You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), + ErrExecStmtWithOpenCursor: Message("You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it.", nil), + ErrStmtHasNoOpenCursor: Message("The statement (%d) has no open cursor.", nil), + ErrCommitNotAllowedInSfOrTrg: Message("Explicit or implicit commit is not allowed in stored function or trigger.", nil), + ErrNoDefaultForViewField: Message("Field of view '%-.192s.%-.192s' underlying table doesn't have a default value", nil), + ErrSpNoRecursion: Message("Recursive stored functions and triggers are not allowed.", nil), + ErrTooBigScale: Message("Too big scale %d specified for column '%-.192s'. Maximum is %d.", nil), + ErrTooBigPrecision: Message("Too-big precision %d specified for '%-.192s'. Maximum is %d.", nil), + ErrMBiggerThanD: Message("For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s').", nil), + ErrWrongLockOfSystemTable: Message("You can't combine write-locking of system tables with other tables or lock types", nil), + ErrConnectToForeignDataSource: Message("Unable to connect to foreign data source: %.64s", nil), + ErrQueryOnForeignDataSource: Message("There was a problem processing the query on the foreign data source. Data source : %-.64s", nil), + ErrForeignDataSourceDoesntExist: Message("The foreign data source you are trying to reference does not exist. Data source : %-.64s", nil), + ErrForeignDataStringInvalidCantCreate: Message("Can't create federated table. The data source connection string '%-.64s' is not in the correct format", nil), + ErrForeignDataStringInvalid: Message("The data source connection string '%-.64s' is not in the correct format", nil), + ErrCantCreateFederatedTable: Message("Can't create federated table. Foreign data src : %-.64s", nil), + ErrTrgInWrongSchema: Message("Trigger in wrong schema", nil), + ErrStackOverrunNeedMore: Message("Thread stack overrun: %d bytes used of a %d byte stack, and %d bytes needed. Use 'mysqld --threadStack=#' to specify a bigger stack.", nil), + ErrTooLongBody: Message("Routine body for '%-.100s' is too long", nil), + ErrWarnCantDropDefaultKeycache: Message("Cannot drop default keycache", nil), + ErrTooBigDisplaywidth: Message("Display width out of range for column '%-.192s' (max = %d)", nil), + ErrXaerDupid: Message("XAERDUPID: The XID already exists", nil), + ErrDatetimeFunctionOverflow: Message("Datetime function: %-.32s field overflow", nil), + ErrCantUpdateUsedTableInSfOrTrg: Message("Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.", nil), + ErrViewPreventUpdate: Message("The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'.", nil), + ErrPsNoRecursion: Message("The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner", nil), + ErrSpCantSetAutocommit: Message("Not allowed to set autocommit from a stored function or trigger", nil), + ErrMalformedDefiner: Message("Definer is not fully qualified", nil), + ErrViewFrmNoUser: Message("View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!", nil), + ErrViewOtherUser: Message("You need the SUPER privilege for creation view with '%-.192s'@'%-.255s' definer", nil), + ErrNoSuchUser: Message("The user specified as a definer ('%-.64s'@'%-.255s') does not exist", nil), + ErrForbidSchemaChange: Message("Changing schema from '%-.192s' to '%-.192s' is not allowed.", nil), + ErrRowIsReferenced2: Message("Cannot delete or update a parent row: a foreign key constraint fails (%.192s)", nil), + ErrNoReferencedRow2: Message("Cannot add or update a child row: a foreign key constraint fails (%.192s)", nil), + ErrSpBadVarShadow: Message("Variable '%-.64s' must be quoted with `...`, or renamed", nil), + ErrTrgNoDefiner: Message("No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.", nil), + ErrOldFileFormat: Message("'%-.192s' has an old format, you should re-create the '%s' object(s)", nil), + ErrSpRecursionLimit: Message("Recursive limit %d (as set by the maxSpRecursionDepth variable) was exceeded for routine %.192s", nil), + ErrSpProcTableCorrupt: Message("Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)", nil), + ErrSpWrongName: Message("Incorrect routine name '%-.192s'", nil), + ErrTableNeedsUpgrade: Message("Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\"", nil), + ErrSpNoAggregate: Message("AGGREGATE is not supported for stored functions", nil), + ErrMaxPreparedStmtCountReached: Message("Can't create more than maxPreparedStmtCount statements (current value: %d)", nil), + ErrViewRecursive: Message("`%-.192s`.`%-.192s` contains view recursion", nil), + ErrNonGroupingFieldUsed: Message("Non-grouping field '%-.192s' is used in %-.64s clause", nil), + ErrTableCantHandleSpkeys: Message("The used table type doesn't support SPATIAL indexes", nil), + ErrNoTriggersOnSystemSchema: Message("Triggers can not be created on system tables", nil), + ErrRemovedSpaces: Message("Leading spaces are removed from name '%s'", nil), + ErrAutoincReadFailed: Message("Failed to read auto-increment value from storage engine", nil), + ErrUsername: Message("user name", nil), + ErrHostname: Message("host name", nil), + ErrWrongStringLength: Message("String '%-.70s' is too long for %s (should be no longer than %d)", nil), + ErrNonInsertableTable: Message("The target table %-.100s of the %s is not insertable-into", nil), + ErrAdminWrongMrgTable: Message("Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist", nil), + ErrTooHighLevelOfNestingForSelect: Message("Too high level of nesting for select", nil), + ErrNameBecomesEmpty: Message("Name '%-.64s' has become ''", nil), + ErrAmbiguousFieldTerm: Message("First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY", nil), + ErrForeignServerExists: Message("The foreign server, %s, you are trying to create already exists.", nil), + ErrForeignServerDoesntExist: Message("The foreign server name you are trying to reference does not exist. Data source : %-.64s", nil), + ErrIllegalHaCreateOption: Message("Table storage engine '%-.64s' does not support the create option '%.64s'", nil), + ErrPartitionRequiresValues: Message("Syntax : %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition", nil), + ErrPartitionWrongValues: Message("Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition", []int{1}), + ErrPartitionMaxvalue: Message("MAXVALUE can only be used in last partition definition", nil), + ErrPartitionSubpartition: Message("Subpartitions can only be hash partitions and by key", nil), + ErrPartitionSubpartMix: Message("Must define subpartitions on all partitions if on one partition", nil), + ErrPartitionWrongNoPart: Message("Wrong number of partitions defined, mismatch with previous setting", nil), + ErrPartitionWrongNoSubpart: Message("Wrong number of subpartitions defined, mismatch with previous setting", nil), + ErrWrongExprInPartitionFunc: Message("Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed", nil), + ErrNoConstExprInRangeOrList: Message("Expression in RANGE/LIST VALUES must be constant", nil), + ErrFieldNotFoundPart: Message("Field in list of fields for partition function not found in table", nil), + ErrListOfFieldsOnlyInHash: Message("List of fields is only allowed in KEY partitions", nil), + ErrInconsistentPartitionInfo: Message("The partition info in the frm file is not consistent with what can be written into the frm file", nil), + ErrPartitionFuncNotAllowed: Message("The %-.192s function returns the wrong type", nil), + ErrPartitionsMustBeDefined: Message("For %-.64s partitions each partition must be defined", nil), + ErrRangeNotIncreasing: Message("VALUES LESS THAN value must be strictly increasing for each partition", nil), + ErrInconsistentTypeOfFunctions: Message("VALUES value must be of same type as partition function", nil), + ErrMultipleDefConstInListPart: Message("Multiple definition of same constant in list partitioning", nil), + ErrPartitionEntry: Message("Partitioning can not be used stand-alone in query", nil), + ErrMixHandler: Message("The mix of handlers in the partitions is not allowed in this version of MySQL", nil), + ErrPartitionNotDefined: Message("For the partitioned engine it is necessary to define all %-.64s", nil), + ErrTooManyPartitions: Message("Too many partitions (including subpartitions) were defined", nil), + ErrSubpartition: Message("It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning", nil), + ErrCantCreateHandlerFile: Message("Failed to create specific handler file", nil), + ErrBlobFieldInPartFunc: Message("A BLOB field is not allowed in partition function", nil), + ErrUniqueKeyNeedAllFieldsInPf: Message("A %-.192s must include all columns in the table's partitioning function", nil), + ErrNoParts: Message("Number of %-.64s = 0 is not an allowed value", []int{0}), + ErrPartitionMgmtOnNonpartitioned: Message("Partition management on a not partitioned table is not possible", nil), + ErrForeignKeyOnPartitioned: Message("Foreign key clause is not yet supported in conjunction with partitioning", nil), + ErrDropPartitionNonExistent: Message("Error in list of partitions to %-.64s", nil), + ErrDropLastPartition: Message("Cannot remove all partitions, use DROP TABLE instead", nil), + ErrCoalesceOnlyOnHashPartition: Message("COALESCE PARTITION can only be used on HASH/KEY partitions", nil), + ErrReorgHashOnlyOnSameNo: Message("REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers", nil), + ErrReorgNoParam: Message("REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs", nil), + ErrOnlyOnRangeListPartition: Message("%-.64s PARTITION can only be used on RANGE/LIST partitions", nil), + ErrAddPartitionSubpart: Message("Trying to Add partition(s) with wrong number of subpartitions", nil), + ErrAddPartitionNoNewPartition: Message("At least one partition must be added", nil), + ErrCoalescePartitionNoPartition: Message("At least one partition must be coalesced", nil), + ErrReorgPartitionNotExist: Message("More partitions to reorganize than there are partitions", nil), + ErrSameNamePartition: Message("Duplicate partition name %-.192s", nil), + ErrNoBinlog: Message("It is not allowed to shut off binlog on this command", nil), + ErrConsecutiveReorgPartitions: Message("When reorganizing a set of partitions they must be in consecutive order", nil), + ErrReorgOutsideRange: Message("Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range", nil), + ErrPartitionFunctionFailure: Message("Partition function not supported in this version for this handler", nil), + ErrPartState: Message("Partition state cannot be defined from CREATE/ALTER TABLE", nil), + ErrLimitedPartRange: Message("The %-.64s handler only supports 32 bit integers in VALUES", nil), + ErrPluginIsNotLoaded: Message("Plugin '%-.192s' is not loaded", nil), + ErrWrongValue: Message("Incorrect %-.32s value: '%-.128s'", []int{1}), + ErrNoPartitionForGivenValue: Message("Table has no partition for value %-.64s", []int{0}), + ErrFilegroupOptionOnlyOnce: Message("It is not allowed to specify %s more than once", nil), + ErrCreateFilegroupFailed: Message("Failed to create %s", nil), + ErrDropFilegroupFailed: Message("Failed to drop %s", nil), + ErrTablespaceAutoExtend: Message("The handler doesn't support autoextend of tablespaces", nil), + ErrWrongSizeNumber: Message("A size parameter was incorrectly specified, either number or on the form 10M", nil), + ErrSizeOverflow: Message("The size number was correct but we don't allow the digit part to be more than 2 billion", nil), + ErrAlterFilegroupFailed: Message("Failed to alter: %s", nil), + ErrBinlogRowLoggingFailed: Message("Writing one row to the row-based binary log failed", nil), + ErrBinlogRowWrongTableDef: Message("Table definition on master and slave does not match: %s", nil), + ErrBinlogRowRbrToSbr: Message("Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events", nil), + ErrEventAlreadyExists: Message("Event '%-.192s' already exists", nil), + ErrEventStoreFailed: Message("Failed to store event %s. Error code %d from storage engine.", nil), + ErrEventDoesNotExist: Message("Unknown event '%-.192s'", nil), + ErrEventCantAlter: Message("Failed to alter event '%-.192s'", nil), + ErrEventDropFailed: Message("Failed to drop %s", nil), + ErrEventIntervalNotPositiveOrTooBig: Message("INTERVAL is either not positive or too big", nil), + ErrEventEndsBeforeStarts: Message("ENDS is either invalid or before STARTS", nil), + ErrEventExecTimeInThePast: Message("Event execution time is in the past. Event has been disabled", nil), + ErrEventOpenTableFailed: Message("Failed to open mysql.event", nil), + ErrEventNeitherMExprNorMAt: Message("No datetime expression provided", nil), + ErrObsoleteColCountDoesntMatchCorrupted: Message("Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), + ErrObsoleteCannotLoadFromTable: Message("Cannot load from mysql.%s. The table is probably corrupted", nil), + ErrEventCannotDelete: Message("Failed to delete the event from mysql.event", nil), + ErrEventCompile: Message("Error during compilation of event's body", nil), + ErrEventSameName: Message("Same old and new event name", nil), + ErrEventDataTooLong: Message("Data for column '%s' too long", nil), + ErrDropIndexNeededInForeignKey: Message("Cannot drop index '%-.192s': needed in a foreign key constraint", nil), + ErrWarnDeprecatedSyntaxWithVer: Message("The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead", nil), + ErrCantWriteLockLogTable: Message("You can't write-lock a log table. Only read access is possible", nil), + ErrCantLockLogTable: Message("You can't use locks with log tables.", nil), + ErrForeignDuplicateKeyOldUnused: Message("Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry", nil), + ErrColCountDoesntMatchPleaseUpdate: Message("Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysqlUpgrade to fix this error.", nil), + ErrTempTablePreventsSwitchOutOfRbr: Message("Cannot switch out of the row-based binary log format when the session has open temporary tables", nil), + ErrStoredFunctionPreventsSwitchBinlogFormat: Message("Cannot change the binary logging format inside a stored function or trigger", nil), + ErrNdbCantSwitchBinlogFormat: Message("The NDB cluster engine does not support changing the binlog format on the fly yet", nil), + ErrPartitionNoTemporary: Message("Cannot create temporary table with partitions", nil), + ErrPartitionConstDomain: Message("Partition constant is out of partition function domain", nil), + ErrPartitionFunctionIsNotAllowed: Message("This partition function is not allowed", nil), + ErrDdlLog: Message("Error in DDL log", nil), + ErrNullInValuesLessThan: Message("Not allowed to use NULL value in VALUES LESS THAN", nil), + ErrWrongPartitionName: Message("Incorrect partition name", nil), + ErrCantChangeTxCharacteristics: Message("Transaction characteristics can't be changed while a transaction is in progress", nil), + ErrDupEntryAutoincrementCase: Message("ALTER TABLE causes autoIncrement resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'", nil), + ErrEventModifyQueue: Message("Internal scheduler error %d", nil), + ErrEventSetVar: Message("Error during starting/stopping of the scheduler. Error code %d", nil), + ErrPartitionMerge: Message("Engine cannot be used in partitioned tables", nil), + ErrCantActivateLog: Message("Cannot activate '%-.64s' log", nil), + ErrRbrNotAvailable: Message("The server was not built with row-based replication", nil), + ErrBase64Decode: Message("Decoding of base64 string failed", nil), + ErrEventRecursionForbidden: Message("Recursion of EVENT DDL statements is forbidden when body is present", nil), + ErrEventsDB: Message("Cannot proceed because system tables used by Event Scheduler were found damaged at server start", nil), + ErrOnlyIntegersAllowed: Message("Only integers allowed as number here", nil), + ErrUnsuportedLogEngine: Message("This storage engine cannot be used for log tables\"", nil), + ErrBadLogStatement: Message("You cannot '%s' a log table if logging is enabled", nil), + ErrCantRenameLogTable: Message("Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'", nil), + ErrWrongParamcountToNativeFct: Message("Incorrect parameter count in the call to native function '%-.192s'", nil), + ErrWrongParametersToNativeFct: Message("Incorrect parameters in the call to native function '%-.192s'", nil), + ErrWrongParametersToStoredFct: Message("Incorrect parameters in the call to stored function '%-.192s'", nil), + ErrNativeFctNameCollision: Message("This function '%-.192s' has the same name as a native function", nil), + ErrDupEntryWithKeyName: Message("Duplicate entry '%-.64s' for key '%-.192s'", nil), + ErrBinlogPurgeEmFile: Message("Too many files opened, please execute the command again", nil), + ErrEventCannotCreateInThePast: Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.", nil), + ErrEventCannotAlterInThePast: Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.", nil), + ErrSlaveIncident: Message("The incident %s occurred on the master. Message: %-.64s", nil), + ErrNoPartitionForGivenValueSilent: Message("Table has no partition for some existing values", nil), + ErrBinlogUnsafeStatement: Message("Unsafe statement written to the binary log using statement format since BINLOGFORMAT = STATEMENT. %s", nil), + ErrSlaveFatal: Message("Fatal : %s", nil), + ErrSlaveRelayLogReadFailure: Message("Relay log read failure: %s", nil), + ErrSlaveRelayLogWriteFailure: Message("Relay log write failure: %s", nil), + ErrSlaveCreateEventFailure: Message("Failed to create %s", nil), + ErrSlaveMasterComFailure: Message("Master command %s failed: %s", nil), + ErrBinlogLoggingImpossible: Message("Binary logging not possible. Message: %s", nil), + ErrViewNoCreationCtx: Message("View `%-.64s`.`%-.64s` has no creation context", nil), + ErrViewInvalidCreationCtx: Message("Creation context of view `%-.64s`.`%-.64s' is invalid", nil), + ErrSrInvalidCreationCtx: Message("Creation context of stored routine `%-.64s`.`%-.64s` is invalid", nil), + ErrTrgCorruptedFile: Message("Corrupted TRG file for table `%-.64s`.`%-.64s`", nil), + ErrTrgNoCreationCtx: Message("Triggers for table `%-.64s`.`%-.64s` have no creation context", nil), + ErrTrgInvalidCreationCtx: Message("Trigger creation context of table `%-.64s`.`%-.64s` is invalid", nil), + ErrEventInvalidCreationCtx: Message("Creation context of event `%-.64s`.`%-.64s` is invalid", nil), + ErrTrgCantOpenTable: Message("Cannot open table for trigger `%-.64s`.`%-.64s`", nil), + ErrCantCreateSroutine: Message("Cannot create stored routine `%-.64s`. Check warnings", nil), + ErrNeverUsed: Message("Ambiguous slave modes combination. %s", nil), + ErrNoFormatDescriptionEventBeforeBinlogStatement: Message("The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement.", nil), + ErrSlaveCorruptEvent: Message("Corrupted replication event was detected", nil), + ErrLoadDataInvalidColumn: Message("Invalid column reference (%-.64s) in LOAD DATA", nil), + ErrLogPurgeNoFile: Message("Being purged log %s was not found", nil), + ErrXaRbtimeout: Message("XARBTIMEOUT: Transaction branch was rolled back: took too long", nil), + ErrXaRbdeadlock: Message("XARBDEADLOCK: Transaction branch was rolled back: deadlock was detected", nil), + ErrNeedReprepare: Message("Prepared statement needs to be re-prepared", nil), + ErrDelayedNotSupported: Message("DELAYED option not supported for table '%-.192s'", nil), + WarnNoMasterInfo: Message("The master info structure does not exist", nil), + WarnOptionIgnored: Message("<%-.64s> option ignored", nil), + WarnPluginDeleteBuiltin: Message("Built-in plugins cannot be deleted", nil), + WarnPluginBusy: Message("Plugin is busy and will be uninstalled on shutdown", nil), + ErrVariableIsReadonly: Message("%s variable '%s' is read-only. Use SET %s to assign the value", nil), + ErrWarnEngineTransactionRollback: Message("Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted", nil), + ErrSlaveHeartbeatFailure: Message("Unexpected master's heartbeat data: %s", nil), + ErrSlaveHeartbeatValueOutOfRange: Message("The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds).", nil), + ErrNdbReplicationSchema: Message("Bad schema for mysql.ndbReplication table. Message: %-.64s", nil), + ErrConflictFnParse: Message("Error in parsing conflict function. Message: %-.64s", nil), + ErrExceptionsWrite: Message("Write to exceptions table failed. Message: %-.128s\"", nil), + ErrTooLongTableComment: Message("Comment for table '%-.64s' is too long (max = %d)", nil), + ErrTooLongFieldComment: Message("Comment for field '%-.64s' is too long (max = %d)", nil), + ErrFuncInexistentNameCollision: Message("FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual", nil), + ErrDatabaseName: Message("Database", nil), + ErrTableName: Message("Table", nil), + ErrPartitionName: Message("Partition", nil), + ErrSubpartitionName: Message("Subpartition", nil), + ErrTemporaryName: Message("Temporary", nil), + ErrRenamedName: Message("Renamed", nil), + ErrTooManyConcurrentTrxs: Message("Too many active concurrent transactions", nil), + WarnNonASCIISeparatorNotImplemented: Message("Non-ASCII separator arguments are not fully supported", nil), + ErrDebugSyncTimeout: Message("debug sync point wait timed out", nil), + ErrDebugSyncHitLimit: Message("debug sync point hit limit reached", nil), + ErrDupSignalSet: Message("Duplicate condition information item '%s'", nil), + ErrSignalWarn: Message("Unhandled user-defined warning condition", nil), + ErrSignalNotFound: Message("Unhandled user-defined not found condition", nil), + ErrSignalException: Message("Unhandled user-defined exception condition", nil), + ErrResignalWithoutActiveHandler: Message("RESIGNAL when handler not active", nil), + ErrSignalBadConditionType: Message("SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE", nil), + WarnCondItemTruncated: Message("Data truncated for condition item '%s'", nil), + ErrCondItemTooLong: Message("Data too long for condition item '%s'", nil), + ErrUnknownLocale: Message("Unknown locale: '%-.64s'", nil), + ErrSlaveIgnoreServerIDs: Message("The requested server id %d clashes with the slave startup option --replicate-same-server-id", nil), + ErrQueryCacheDisabled: Message("Query cache is disabled; restart the server with queryCacheType=1 to enable it", nil), + ErrSameNamePartitionField: Message("Duplicate partition field name '%-.192s'", nil), + ErrPartitionColumnList: Message("Inconsistency in usage of column lists for partitioning", nil), + ErrWrongTypeColumnValue: Message("Partition column values of incorrect type", nil), + ErrTooManyPartitionFuncFields: Message("Too many fields in '%-.192s'", nil), + ErrMaxvalueInValuesIn: Message("Cannot use MAXVALUE as value in VALUES IN", nil), + ErrTooManyValues: Message("Cannot have more than one value for this type of %-.64s partitioning", nil), + ErrRowSinglePartitionField: Message("Row expressions in VALUES IN only allowed for multi-field column partitioning", nil), + ErrFieldTypeNotAllowedAsPartitionField: Message("Field '%-.192s' is of a not allowed type for this type of partitioning", nil), + ErrPartitionFieldsTooLong: Message("The total length of the partitioning fields is too large", nil), + ErrBinlogRowEngineAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved.", nil), + ErrBinlogRowModeAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.", nil), + ErrBinlogUnsafeAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOGFORMAT = MIXED. %s", nil), + ErrBinlogRowInjectionAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.", nil), + ErrBinlogStmtModeAndRowEngine: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s", nil), + ErrBinlogRowInjectionAndStmtMode: Message("Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOGFORMAT = STATEMENT.", nil), + ErrBinlogMultipleEnginesAndSelfLoggingEngine: Message("Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.", nil), + ErrBinlogUnsafeLimit: Message("The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.", nil), + ErrBinlogUnsafeInsertDelayed: Message("The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted.", nil), + ErrBinlogUnsafeSystemTable: Message("The statement is unsafe because it uses the general log, slow query log, or performanceSchema table(s). This is unsafe because system tables may differ on slaves.", nil), + ErrBinlogUnsafeAutoincColumns: Message("Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTOINCREMENT column. Inserted values cannot be logged correctly.", nil), + ErrBinlogUnsafeUdf: Message("Statement is unsafe because it uses a UDF which may not return the same value on the slave.", nil), + ErrBinlogUnsafeSystemVariable: Message("Statement is unsafe because it uses a system variable that may have a different value on the slave.", nil), + ErrBinlogUnsafeSystemFunction: Message("Statement is unsafe because it uses a system function that may return a different value on the slave", nil), + ErrBinlogUnsafeNontransAfterTrans: Message("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.", nil), + ErrMessageAndStatement: Message("%s Statement: %s", nil), + ErrSlaveConversionFailed: Message("Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'", nil), + ErrSlaveCantCreateConversion: Message("Can't create conversion table for table '%-.192s.%-.192s'", nil), + ErrInsideTransactionPreventsSwitchBinlogFormat: Message("Cannot modify @@session.binlogFormat inside a transaction", nil), + ErrPathLength: Message("The path specified for %.64s is too long.", nil), + ErrWarnDeprecatedSyntaxNoReplacement: Message("%s is deprecated and will be removed in a future release.%s", nil), + ErrWrongNativeTableStructure: Message("Native table '%-.64s'.'%-.64s' has the wrong structure", nil), + ErrWrongPerfSchemaUsage: Message("Invalid performanceSchema usage.", nil), + ErrWarnISSkippedTable: Message("Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement", nil), + ErrInsideTransactionPreventsSwitchBinlogDirect: Message("Cannot modify @@session.binlogDirectNonTransactionalUpdates inside a transaction", nil), + ErrStoredFunctionPreventsSwitchBinlogDirect: Message("Cannot change the binlog direct flag inside a stored function or trigger", nil), + ErrSpatialMustHaveGeomCol: Message("A SPATIAL index may only contain a geometrical type column", nil), + ErrTooLongIndexComment: Message("Comment for index '%-.64s' is too long (max = %d)", nil), + ErrLockAborted: Message("Wait on a lock was aborted due to a pending exclusive lock", nil), + ErrDataOutOfRange: Message("%s value is out of range in '%s'", []int{1}), + ErrWrongSpvarTypeInLimit: Message("A variable of a non-integer based type in LIMIT clause", nil), + ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine: Message("Mixing self-logging and non-self-logging engines in a statement is unsafe.", nil), + ErrBinlogUnsafeMixedStatement: Message("Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.", nil), + ErrInsideTransactionPreventsSwitchSQLLogBin: Message("Cannot modify @@session.sqlLogBin inside a transaction", nil), + ErrStoredFunctionPreventsSwitchSQLLogBin: Message("Cannot change the sqlLogBin inside a stored function or trigger", nil), + ErrFailedReadFromParFile: Message("Failed to read from the .par file", nil), + ErrValuesIsNotIntType: Message("VALUES value for partition '%-.64s' must have type INT", nil), + ErrAccessDeniedNoPassword: Message("Access denied for user '%-.48s'@'%-.255s'", nil), + ErrSetPasswordAuthPlugin: Message("SET PASSWORD has no significance for user '%-.48s'@'%-.255s' as authentication plugin does not support it.", nil), + ErrGrantPluginUserExists: Message("GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists", nil), + ErrTruncateIllegalForeignKey: Message("Cannot truncate a table referenced in a foreign key constraint (%.192s)", nil), + ErrPluginIsPermanent: Message("Plugin '%s' is forcePlusPermanent and can not be unloaded", nil), + ErrSlaveHeartbeatValueOutOfRangeMin: Message("The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.", nil), + ErrSlaveHeartbeatValueOutOfRangeMax: Message("The requested value for the heartbeat period exceeds the value of `slaveNetTimeout' seconds. A sensible value for the period should be less than the timeout.", nil), + ErrStmtCacheFull: Message("Multi-row statements required more than 'maxBinlogStmtCacheSize' bytes of storage; increase this mysqld variable and try again", nil), + ErrMultiUpdateKeyConflict: Message("Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'.", nil), + ErrTableNeedsRebuild: Message("Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!", nil), + WarnOptionBelowLimit: Message("The value of '%s' should be no less than the value of '%s'", nil), + ErrIndexColumnTooLong: Message("Index column size too large. The maximum column size is %d bytes.", nil), + ErrErrorInTriggerBody: Message("Trigger '%-.64s' has an error in its body: '%-.256s'", nil), + ErrErrorInUnknownTriggerBody: Message("Unknown trigger has an error in its body: '%-.256s'", nil), + ErrIndexCorrupt: Message("Index %s is corrupted", nil), + ErrUndoRecordTooBig: Message("Undo log record is too big.", nil), + ErrBinlogUnsafeInsertIgnoreSelect: Message("INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeInsertSelectUpdate: Message("INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeReplaceSelect: Message("REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeCreateIgnoreSelect: Message("CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeCreateReplaceSelect: Message("CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeUpdateIgnore: Message("UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), + ErrPluginNoUninstall: Message("Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it.", nil), + ErrPluginNoInstall: Message("Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it.", nil), + ErrBinlogUnsafeWriteAutoincSelect: Message("Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeCreateSelectAutoinc: Message("CREATE TABLE... SELECT... on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave.", nil), + ErrBinlogUnsafeInsertTwoKeys: Message("INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe", nil), + ErrTableInFkCheck: Message("Table is being used in foreign key check.", nil), + ErrUnsupportedEngine: Message("Storage engine '%s' does not support system tables. [%s.%s]", nil), + ErrBinlogUnsafeAutoincNotFirst: Message("INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.", nil), + ErrCannotLoadFromTableV2: Message("Cannot load from %s.%s. The table is probably corrupted", nil), + ErrMasterDelayValueOutOfRange: Message("The requested value %d for the master delay exceeds the maximum %d", nil), + ErrOnlyFdAndRbrEventsAllowedInBinlogStatement: Message("Only FormatDescriptionLogEvent and row events are allowed in BINLOG statements (but %s was provided)", nil), + ErrPartitionExchangeDifferentOption: Message("Non matching attribute '%-.64s' between partition and table", nil), + ErrPartitionExchangePartTable: Message("Table to exchange with partition is partitioned: '%-.64s'", nil), + ErrPartitionExchangeTempTable: Message("Table to exchange with partition is temporary: '%-.64s'", nil), + ErrPartitionInsteadOfSubpartition: Message("Subpartitioned table, use subpartition instead of partition", nil), + ErrUnknownPartition: Message("Unknown partition '%-.64s' in table '%-.64s'", nil), + ErrTablesDifferentMetadata: Message("Tables have different definitions", nil), + ErrRowDoesNotMatchPartition: Message("Found a row that does not match the partition", nil), + ErrBinlogCacheSizeGreaterThanMax: Message("Option binlogCacheSize (%d) is greater than maxBinlogCacheSize (%d); setting binlogCacheSize equal to maxBinlogCacheSize.", nil), + ErrWarnIndexNotApplicable: Message("Cannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'", nil), + ErrPartitionExchangeForeignKey: Message("Table to exchange with partition has foreign key references: '%-.64s'", nil), + ErrNoSuchKeyValue: Message("Key value '%-.192s' was not found in table '%-.192s.%-.192s'", nil), + ErrRplInfoDataTooLong: Message("Data for column '%s' too long", nil), + ErrNetworkReadEventChecksumFailure: Message("Replication event checksum verification failed while reading from network.", nil), + ErrBinlogReadEventChecksumFailure: Message("Replication event checksum verification failed while reading from a log file.", nil), + ErrBinlogStmtCacheSizeGreaterThanMax: Message("Option binlogStmtCacheSize (%d) is greater than maxBinlogStmtCacheSize (%d); setting binlogStmtCacheSize equal to maxBinlogStmtCacheSize.", nil), + ErrCantUpdateTableInCreateTableSelect: Message("Can't update table '%-.192s' while '%-.192s' is being created.", nil), + ErrPartitionClauseOnNonpartitioned: Message("PARTITION () clause on non partitioned table", nil), + ErrRowDoesNotMatchGivenPartitionSet: Message("Found a row not matching the given partition set", nil), + ErrNoSuchPartitionunused: Message("partition '%-.64s' doesn't exist", nil), + ErrChangeRplInfoRepositoryFailure: Message("Failure while changing the type of replication repository: %s.", nil), + ErrWarningNotCompleteRollbackWithCreatedTempTable: Message("The creation of some temporary tables could not be rolled back.", nil), + ErrWarningNotCompleteRollbackWithDroppedTempTable: Message("Some temporary tables were dropped, but these operations could not be rolled back.", nil), + ErrMtsFeatureIsNotSupported: Message("%s is not supported in multi-threaded slave mode. %s", nil), + ErrMtsUpdatedDBsGreaterMax: Message("The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata.", nil), + ErrMtsCantParallel: Message("Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s.", nil), + ErrMtsInconsistentData: Message("%s", nil), + ErrFulltextNotSupportedWithPartitioning: Message("FULLTEXT index is not supported for partitioned tables.", nil), + ErrDaInvalidConditionNumber: Message("Invalid condition number", nil), + ErrInsecurePlainText: Message("Sending passwords in plain text without SSL/TLS is extremely insecure.", nil), + ErrInsecureChangeMaster: Message("Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.", nil), + ErrForeignDuplicateKeyWithChildInfo: Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'", nil), + ErrForeignDuplicateKeyWithoutChildInfo: Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child table", nil), + ErrSQLthreadWithSecureSlave: Message("Setting authentication options is not possible when only the Slave SQL Thread is being started.", nil), + ErrTableHasNoFt: Message("The table does not have FULLTEXT index to support this query", nil), + ErrVariableNotSettableInSfOrTrigger: Message("The system variable %.200s cannot be set in stored functions or triggers.", nil), + ErrVariableNotSettableInTransaction: Message("The system variable %.200s cannot be set when there is an ongoing transaction.", nil), + ErrGtidNextIsNotInGtidNextList: Message("The system variable @@SESSION.GTIDNEXT has the value %.200s, which is not listed in @@SESSION.GTIDNEXTLIST.", nil), + ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull: Message("When @@SESSION.GTIDNEXTLIST == NULL, the system variable @@SESSION.GTIDNEXT cannot change inside a transaction.", nil), + ErrSetStatementCannotInvokeFunction: Message("The statement 'SET %.200s' cannot invoke a stored function.", nil), + ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull: Message("The system variable @@SESSION.GTIDNEXT cannot be 'AUTOMATIC' when @@SESSION.GTIDNEXTLIST is non-NULL.", nil), + ErrSkippingLoggedTransaction: Message("Skipping transaction %.200s because it has already been executed and logged.", nil), + ErrMalformedGtidSetSpecification: Message("Malformed GTID set specification '%.200s'.", nil), + ErrMalformedGtidSetEncoding: Message("Malformed GTID set encoding.", nil), + ErrMalformedGtidSpecification: Message("Malformed GTID specification '%.200s'.", nil), + ErrGnoExhausted: Message("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new serverUuid.", nil), + ErrBadSlaveAutoPosition: Message("Parameters MASTERLOGFILE, MASTERLOGPOS, RELAYLOGFILE and RELAYLOGPOS cannot be set when MASTERAUTOPOSITION is active.", nil), + ErrAutoPositionRequiresGtidModeOn: Message("CHANGE MASTER TO MASTERAUTOPOSITION = 1 can only be executed when @@GLOBAL.GTIDMODE = ON.", nil), + ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet: Message("Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTIDNEXT != AUTOMATIC or @@SESSION.GTIDNEXTLIST != NULL.", nil), + ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn: Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP2 requires @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), + ErrGtidModeRequiresBinlog: Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP1 or UPGRADESTEP2 requires --log-bin and --log-slave-updates.", nil), + ErrCantSetGtidNextToGtidWhenGtidModeIsOff: Message("@@SESSION.GTIDNEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTIDMODE = OFF.", nil), + ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn: Message("@@SESSION.GTIDNEXT cannot be set to ANONYMOUS when @@GLOBAL.GTIDMODE = ON.", nil), + ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff: Message("@@SESSION.GTIDNEXTLIST cannot be set to a non-NULL value when @@GLOBAL.GTIDMODE = OFF.", nil), + ErrFoundGtidEventWhenGtidModeIsOff: Message("Found a GtidLogEvent or PreviousGtidsLogEvent when @@GLOBAL.GTIDMODE = OFF.", nil), + ErrGtidUnsafeNonTransactionalTable: Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.", nil), + ErrGtidUnsafeCreateSelect: Message("CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), + ErrGtidUnsafeCreateDropTemporaryTableInTransaction: Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.", nil), + ErrGtidModeCanOnlyChangeOneStepAtATime: Message("The value of @@GLOBAL.GTIDMODE can only change one step at a time: OFF <-> UPGRADESTEP1 <-> UPGRADESTEP2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.", nil), + ErrMasterHasPurgedRequiredGtids: Message("The slave is connecting using CHANGE MASTER TO MASTERAUTOPOSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.", nil), + ErrCantSetGtidNextWhenOwningGtid: Message("@@SESSION.GTIDNEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK.", nil), + ErrUnknownExplainFormat: Message("Unknown EXPLAIN format name: '%s'", nil), + ErrCantExecuteInReadOnlyTransaction: Message("Cannot execute statement in a READ ONLY transaction.", nil), + ErrTooLongTablePartitionComment: Message("Comment for table partition '%-.64s' is too long (max = %d)", nil), + ErrSlaveConfiguration: Message("Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.", nil), + ErrInnodbFtLimit: Message("InnoDB presently supports one FULLTEXT index creation at a time", nil), + ErrInnodbNoFtTempTable: Message("Cannot create FULLTEXT index on temporary InnoDB table", nil), + ErrInnodbFtWrongDocidColumn: Message("Column '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), + ErrInnodbFtWrongDocidIndex: Message("Index '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), + ErrInnodbOnlineLogTooBig: Message("Creating index '%-.192s' required more than 'innodbOnlineAlterLogMaxSize' bytes of modification log. Please try again.", nil), + ErrUnknownAlterAlgorithm: Message("Unknown ALGORITHM '%s'", nil), + ErrUnknownAlterLock: Message("Unknown LOCK type '%s'", nil), + ErrMtsChangeMasterCantRunWithGaps: Message("CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.", nil), + ErrMtsRecoveryFailure: Message("Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MySQL error log.", nil), + ErrMtsResetWorkers: Message("Cannot clean up worker info tables. Additional error messages can be found in the MySQL error log.", nil), + ErrColCountDoesntMatchCorruptedV2: Message("Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), + ErrSlaveSilentRetryTransaction: Message("Slave must silently retry current transaction", nil), + ErrDiscardFkChecksRunning: Message("There is a foreign key check running on table '%-.192s'. Cannot discard the table.", nil), + ErrTableSchemaMismatch: Message("Schema mismatch (%s)", nil), + ErrTableInSystemTablespace: Message("Table '%-.192s' in system tablespace", nil), + ErrIoRead: Message("IO Read : (%d, %s) %s", nil), + ErrIoWrite: Message("IO Write : (%d, %s) %s", nil), + ErrTablespaceMissing: Message("Tablespace is missing for table '%-.192s'", nil), + ErrTablespaceExists: Message("Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORT.", nil), + ErrTablespaceDiscarded: Message("Tablespace has been discarded for table '%-.192s'", nil), + ErrInternal: Message("Internal : %s", nil), + ErrInnodbImport: Message("ALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %d : '%s'", nil), + ErrInnodbIndexCorrupt: Message("Index corrupt: %s", nil), + ErrInvalidYearColumnLength: Message("Supports only YEAR or YEAR(4) column", nil), + ErrNotValidPassword: Message("Your password does not satisfy the current policy requirements (%s)", nil), + ErrMustChangePassword: Message("You must reset your password using ALTER USER statement before executing this statement", nil), + ErrFkNoIndexChild: Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'", nil), + ErrForeignKeyNoIndexInParent: Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'", nil), + ErrFkFailAddSystem: Message("Failed to add the foreign key constraint '%s' to system tables", nil), + ErrForeignKeyCannotOpenParent: Message("Failed to open the referenced table '%s'", nil), + ErrFkIncorrectOption: Message("Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'", nil), + ErrFkDupName: Message("Duplicate foreign key constraint name '%s'", nil), + ErrPasswordFormat: Message("The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.", nil), + ErrFkColumnCannotDrop: Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'", nil), + ErrFkColumnCannotDropChild: Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table '%-.192s'", nil), + ErrForeignKeyColumnNotNull: Message("Column '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULL", nil), + ErrDupIndex: Message("Duplicate index '%-.64s' defined on the table '%-.64s.%-.64s'. This is deprecated and will be disallowed in a future release.", nil), + ErrForeignKeyColumnCannotChange: Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s'", nil), + ErrForeignKeyColumnCannotChangeChild: Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'", nil), + ErrFkCannotDeleteParent: Message("Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'", nil), + ErrMalformedPacket: Message("Malformed communication packet.", nil), + ErrReadOnlyMode: Message("Running in read-only mode", nil), + ErrGtidNextTypeUndefinedGroup: Message("When @@SESSION.GTIDNEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET @@SESSION.GTIDNEXT before a transaction and forgot to set @@SESSION.GTIDNEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current @@SESSION.GTIDNEXT is '%s'.", nil), + ErrVariableNotSettableInSp: Message("The system variable %.200s cannot be set in stored procedures.", nil), + ErrCantSetGtidPurgedWhenGtidModeIsOff: Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDMODE = ON.", nil), + ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty: Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDEXECUTED is empty.", nil), + ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty: Message("@@GLOBAL.GTIDPURGED can only be set when there are no ongoing transactions (not even in other clients).", nil), + ErrGtidPurgedWasChanged: Message("@@GLOBAL.GTIDPURGED was changed from '%s' to '%s'.", nil), + ErrGtidExecutedWasChanged: Message("@@GLOBAL.GTIDEXECUTED was changed from '%s' to '%s'.", nil), + ErrBinlogStmtModeAndNoReplTables: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT, and both replicated and non replicated tables are written to.", nil), + ErrAlterOperationNotSupported: Message("%s is not supported for this operation. Try %s.", nil), + ErrAlterOperationNotSupportedReason: Message("%s is not supported. Reason: %s. Try %s.", nil), + ErrAlterOperationNotSupportedReasonCopy: Message("COPY algorithm requires a lock", nil), + ErrAlterOperationNotSupportedReasonPartition: Message("Partition specific operations do not yet support LOCK/ALGORITHM", nil), + ErrAlterOperationNotSupportedReasonFkRename: Message("Columns participating in a foreign key are renamed", nil), + ErrAlterOperationNotSupportedReasonColumnType: Message("Cannot change column type INPLACE", nil), + ErrAlterOperationNotSupportedReasonFkCheck: Message("Adding foreign keys needs foreignKeyChecks=OFF", nil), + ErrAlterOperationNotSupportedReasonIgnore: Message("Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows", nil), + ErrAlterOperationNotSupportedReasonNopk: Message("Dropping a primary key is not allowed without also adding a new primary key", nil), + ErrAlterOperationNotSupportedReasonAutoinc: Message("Adding an auto-increment column requires a lock", nil), + ErrAlterOperationNotSupportedReasonHiddenFts: Message("Cannot replace hidden FTSDOCID with a user-visible one", nil), + ErrAlterOperationNotSupportedReasonChangeFts: Message("Cannot drop or rename FTSDOCID", nil), + ErrAlterOperationNotSupportedReasonFts: Message("Fulltext index creation requires a lock", nil), + ErrSQLSlaveSkipCounterNotSettableInGtidMode: Message("sqlSlaveSkipCounter can not be set when the server is running with @@GLOBAL.GTIDMODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction", nil), + ErrDupUnknownInIndex: Message("Duplicate entry for key '%-.192s'", nil), + ErrIdentCausesTooLongPath: Message("Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'.", nil), + ErrAlterOperationNotSupportedReasonNotNull: Message("cannot silently convert NULL values, as required in this SQLMODE", nil), + ErrMustChangePasswordLogin: Message("Your password has expired. To log in you must change it using a client that supports expired passwords.", nil), + ErrRowInWrongPartition: Message("Found a row in wrong partition %s", []int{0}), + ErrGeneratedColumnFunctionIsNotAllowed: Message("Expression of generated column '%s' contains a disallowed function.", nil), + ErrGeneratedColumnRowValueIsNotAllowed: Message("Expression of generated column '%s' cannot refer to a row value", nil), + ErrDefValGeneratedNamedFunctionIsNotAllowed: Message("Default value expression of column '%s' contains a disallowed function: `%s`.", nil), + ErrUnsupportedAlterInplaceOnVirtualColumn: Message("INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions.", nil), + ErrWrongFKOptionForGeneratedColumn: Message("Cannot define foreign key with %s clause on a generated column.", nil), + ErrBadGeneratedColumn: Message("The value specified for generated column '%s' in table '%s' is not allowed.", nil), + ErrUnsupportedOnGeneratedColumn: Message("'%s' is not supported for generated columns.", nil), + ErrGeneratedColumnNonPrior: Message("Generated column can refer only to generated columns defined prior to it.", nil), + ErrDependentByGeneratedColumn: Message("Column '%s' has a generated column dependency.", nil), + ErrGeneratedColumnRefAutoInc: Message("Generated column '%s' cannot refer to auto-increment column.", nil), + ErrAccountHasBeenLocked: Message("Access denied for user '%s'@'%s'. Account is locked.", nil), + ErUserAccessDeniedForUserAccountBlockedByPasswordLock: Message("Access denied for user '%s'@'%s'. Account is blocked for %s day(s) (%s day(s) remaining) due to %d consecutive failed logins.", nil), + ErrWarnConflictingHint: Message("Hint %s is ignored as conflicting/duplicated.", nil), + ErrUnresolvedHintName: Message("Unresolved name '%s' for %s hint", nil), + ErrForeignKeyCascadeDepthExceeded: Message("Foreign key cascade delete/update exceeds max depth of %v.", nil), + ErrInvalidFieldSize: Message("Invalid size for column '%s'.", nil), + ErrPasswordExpireAnonymousUser: Message("The password for anonymous user cannot be expired.", nil), + ErrInvalidArgumentForLogarithm: Message("Invalid argument for logarithm", nil), + ErrAggregateOrderNonAggQuery: Message("Expression #%d of ORDER BY contains aggregate function and applies to the result of a non-aggregated query", nil), + ErrIncorrectType: Message("Incorrect type for argument %s in function %s.", nil), + ErrFieldInOrderNotSelect: Message("Expression #%d of ORDER BY clause is not in SELECT list, references column '%s' which is not in SELECT list; this is incompatible with %s", nil), + ErrAggregateInOrderNotSelect: Message("Expression #%d of ORDER BY clause is not in SELECT list, contains aggregate function; this is incompatible with %s", nil), + ErrInvalidJSONData: Message("Invalid JSON data provided to function %s: %s", nil), + ErrInvalidJSONText: Message("Invalid JSON text: %-.192s", []int{0}), + ErrInvalidJSONTextInParam: Message("Invalid JSON text in argument %d to function %s: \"%s\" at position %d.", nil), + ErrInvalidJSONPath: Message("Invalid JSON path expression. The error is around character position %d.", []int{0}), + ErrInvalidJSONCharset: Message("Cannot create a JSON value from a string with CHARACTER SET '%s'.", nil), + ErrInvalidTypeForJSON: Message("Invalid data type for JSON data in argument %d to function %s; a JSON string or JSON type is required.", nil), + ErrInvalidJSONPathMultipleSelection: Message("In this situation, path expressions may not contain the * and ** tokens or an array range.", nil), + ErrInvalidJSONContainsPathType: Message("The second argument can only be either 'one' or 'all'.", nil), + ErrJSONUsedAsKey: Message("JSON column '%-.192s' cannot be used in key specification.", nil), + ErrJSONDocumentTooDeep: Message("The JSON document exceeds the maximum depth.", nil), + ErrJSONDocumentNULLKey: Message("JSON documents may not contain NULL member names.", nil), + ErrSecureTransportRequired: Message("Connections using insecure transport are prohibited while --require_secure_transport=ON.", nil), + ErrBadUser: Message("User %s does not exist.", nil), + ErrUserAlreadyExists: Message("User %s already exists.", nil), + ErrInvalidJSONPathArrayCell: Message("A path expression is not a path to a cell in an array.", nil), + ErrInvalidEncryptionOption: Message("Invalid encryption option.", nil), + ErrTooLongValueForType: Message("Too long enumeration/set value for column %s.", nil), + ErrPKIndexCantBeInvisible: Message("A primary key index cannot be invisible", nil), + ErrWindowNoSuchWindow: Message("Window name '%s' is not defined.", nil), + ErrWindowCircularityInWindowGraph: Message("There is a circularity in the window dependency graph.", nil), + ErrWindowNoChildPartitioning: Message("A window which depends on another cannot define partitioning.", nil), + ErrWindowNoInherentFrame: Message("Window '%s' has a frame definition, so cannot be referenced by another window.", nil), + ErrWindowNoRedefineOrderBy: Message("Window '%s' cannot inherit '%s' since both contain an ORDER BY clause.", nil), + ErrWindowFrameStartIllegal: Message("Window '%s': frame start cannot be UNBOUNDED FOLLOWING.", nil), + ErrWindowFrameEndIllegal: Message("Window '%s': frame end cannot be UNBOUNDED PRECEDING.", nil), + ErrWindowFrameIllegal: Message("Window '%s': frame start or end is negative, NULL or of non-integral type", nil), + ErrWindowRangeFrameOrderType: Message("Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression, of numeric or temporal type", nil), + ErrWindowRangeFrameTemporalType: Message("Window '%s' with RANGE frame has ORDER BY expression of datetime type. Only INTERVAL bound value allowed.", nil), + ErrWindowRangeFrameNumericType: Message("Window '%s' with RANGE frame has ORDER BY expression of numeric type, INTERVAL bound value not allowed.", nil), + ErrWindowRangeBoundNotConstant: Message("Window '%s' has a non-constant frame bound.", nil), + ErrWindowDuplicateName: Message("Window '%s' is defined twice.", nil), + ErrWindowIllegalOrderBy: Message("Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression.", nil), + ErrWindowInvalidWindowFuncUse: Message("You cannot use the window function '%s' in this context.'", nil), + ErrWindowInvalidWindowFuncAliasUse: Message("You cannot use the alias '%s' of an expression containing a window function in this context.'", nil), + ErrWindowNestedWindowFuncUseInWindowSpec: Message("You cannot nest a window function in the specification of window '%s'.", nil), + ErrWindowRowsIntervalUse: Message("Window '%s': INTERVAL can only be used with RANGE frames.", nil), + ErrWindowNoGroupOrderUnused: Message("ASC or DESC with GROUP BY isn't allowed with window functions; put ASC or DESC in ORDER BY", nil), + ErrWindowExplainJSON: Message("To get information about window functions use EXPLAIN FORMAT=JSON", nil), + ErrWindowFunctionIgnoresFrame: Message("Window function '%s' ignores the frame clause of window '%s' and aggregates over the whole partition", nil), + ErrInvalidNumberOfArgs: Message("Too many arguments for function %s; maximum allowed is %d", nil), + ErrFieldInGroupingNotGroupBy: Message("Argument %s of GROUPING function is not in GROUP BY", nil), + ErrRoleNotGranted: Message("%s is not granted to %s", nil), + ErrMaxExecTimeExceeded: Message("Query execution was interrupted, maximum statement execution time exceeded", nil), + ErrLockAcquireFailAndNoWaitSet: Message("Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.", nil), + ErrNotHintUpdatable: Message("Variable '%s' might not be affected by SET_VAR hint.", nil), + ErrExistsInHistoryPassword: Message("Cannot use these credentials for '%s@%s' because they contradict the password history policy.", nil), + ErrInvalidDefaultUTF8MB4Collation: Message("Invalid default collation %s: utf8mb4_0900_ai_ci or utf8mb4_general_ci or utf8mb4_bin expected", nil), + ErrForeignKeyCannotDropParent: Message("Cannot drop table '%s' referenced by a foreign key constraint '%s' on table '%s'.", nil), + ErrForeignKeyCannotUseVirtualColumn: Message("Foreign key '%s' uses virtual column '%s' which is not supported.", nil), + ErrForeignKeyNoColumnInParent: Message("Failed to add the foreign key constraint. Missing column '%s' for constraint '%s' in the referenced table '%s'", nil), + ErrDataTruncatedFunctionalIndex: Message("Data truncated for expression index '%s' at row %d", nil), + ErrDataOutOfRangeFunctionalIndex: Message("Value is out of range for expression index '%s' at row %d", nil), + ErrFunctionalIndexOnJSONOrGeometryFunction: Message("Cannot create an expression index on a function that returns a JSON or GEOMETRY value", nil), + ErrFunctionalIndexRefAutoIncrement: Message("Expression index '%s' cannot refer to an auto-increment column", nil), + ErrCannotDropColumnFunctionalIndex: Message("Cannot drop column '%s' because it is used by an expression index. In order to drop the column, you must remove the expression index", nil), + ErrFunctionalIndexPrimaryKey: Message("The primary key cannot be an expression index", nil), + ErrFunctionalIndexOnBlob: Message("Cannot create an expression index on an expression that returns a BLOB or TEXT. Please consider using CAST", nil), + ErrFunctionalIndexFunctionIsNotAllowed: Message("Expression of expression index '%s' contains a disallowed function", nil), + ErrFulltextFunctionalIndex: Message("Fulltext expression index is not supported", nil), + ErrSpatialFunctionalIndex: Message("Spatial expression index is not supported", nil), + ErrWrongKeyColumnFunctionalIndex: Message("The used storage engine cannot index the expression '%s'", nil), + ErrFunctionalIndexOnField: Message("Expression index on a column is not supported. Consider using a regular index instead", nil), + ErrFKIncompatibleColumns: Message("Referencing column '%s' and referenced column '%s' in foreign key constraint '%s' are incompatible.", nil), + ErrFunctionalIndexRowValueIsNotAllowed: Message("Expression of expression index '%s' cannot refer to a row value", nil), + ErrNonBooleanExprForCheckConstraint: Message("An expression of non-boolean type specified to a check constraint '%s'.", nil), + ErrColumnCheckConstraintReferencesOtherColumn: Message("Column check constraint '%s' references other column.", nil), + ErrCheckConstraintNamedFunctionIsNotAllowed: Message("An expression of a check constraint '%s' contains disallowed function: %s.", nil), + ErrCheckConstraintFunctionIsNotAllowed: Message("An expression of a check constraint '%s' contains disallowed function.", nil), + ErrCheckConstraintVariables: Message("An expression of a check constraint '%s' cannot refer to a user or system variable.", nil), + ErrCheckConstraintRefersAutoIncrementColumn: Message("Check constraint '%s' cannot refer to an auto-increment column.", nil), + ErrCheckConstraintViolated: Message("Check constraint '%s' is violated.", nil), + ErrTableCheckConstraintReferUnknown: Message("Check constraint '%s' refers to non-existing column '%s'.", nil), + ErrCheckConstraintDupName: Message("Duplicate check constraint name '%s'.", nil), + ErrCheckConstraintClauseUsingFKReferActionColumn: Message("Column '%s' cannot be used in a check constraint '%s': needed in a foreign key constraint referential action.", nil), + ErrDependentByFunctionalIndex: Message("Column '%s' has an expression index dependency and cannot be dropped or renamed", nil), + ErrDependentByPartitionFunctional: Message("Column '%s' has a partitioning function dependency and cannot be dropped or renamed", nil), + ErrCannotConvertString: Message("Cannot convert string '%.64s' from %s to %s", nil), + ErrInvalidJSONType: Message("Invalid JSON type in argument %d to function %s; an %s is required.", nil), + ErrInvalidJSONValueForFuncIndex: Message("Invalid JSON value for CAST for expression index '%s'", nil), + ErrJSONValueOutOfRangeForFuncIndex: Message("Out of range JSON value for CAST for expression index '%s'", nil), + ErrFunctionalIndexDataIsTooLong: Message("Data too long for expression index '%s'", nil), + ErrFunctionalIndexNotApplicable: Message("Cannot use expression index '%s' due to type or collation conversion", nil), + ErrUnsupportedConstraintCheck: Message("%s is not supported", nil), + ErrDynamicPrivilegeNotRegistered: Message("Dynamic privilege '%s' is not registered with the server.", nil), + ErrIllegalPrivilegeLevel: Message("Illegal privilege level specified for %s", nil), + ErrCTERecursiveRequiresUnion: Message("Recursive Common Table Expression '%s' should contain a UNION", nil), + ErrCTERecursiveRequiresNonRecursiveFirst: Message("Recursive Common Table Expression '%s' should have one or more non-recursive query blocks followed by one or more recursive ones", nil), + ErrCTERecursiveForbidsAggregation: Message("Recursive Common Table Expression '%s' can contain neither aggregation nor window functions in recursive query block", nil), + ErrCTERecursiveForbiddenJoinOrder: Message("In recursive query block of Recursive Common Table Expression '%s', the recursive table must neither be in the right argument of a LEFT JOIN, nor be forced to be non-first with join order hints", nil), + ErrInvalidRequiresSingleReference: Message("In recursive query block of Recursive Common Table Expression '%s', the recursive table must be referenced only once, and not in any subquery", nil), + ErrCTEMaxRecursionDepth: Message("Recursive query aborted after %d iterations. Try increasing @@cte_max_recursion_depth to a larger value", nil), + ErrTableWithoutPrimaryKey: Message("Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.", nil), + ErrConstraintNotFound: Message("Constraint '%s' does not exist.", nil), + ErrDependentByCheckConstraint: Message("Check constraint '%s' uses column '%s', hence column cannot be dropped or renamed.", nil), + ErrJSONInBooleanContext: Message("Evaluating a JSON value in SQL boolean context does an implicit comparison against JSON integer 0; if this is not what you want, consider converting JSON to a SQL numeric type with JSON_VALUE RETURNING", nil), // MariaDB errors. - ErrOnlyOneDefaultPartionAllowed: mysql.Message("Only one DEFAULT partition allowed", nil), - ErrWrongPartitionTypeExpectedSystemTime: mysql.Message("Wrong partitioning type, expected type: `SYSTEM_TIME`", nil), - ErrSystemVersioningWrongPartitions: mysql.Message("Wrong Partitions: must have at least one HISTORY and exactly one last CURRENT", nil), - ErrSequenceRunOut: mysql.Message("Sequence '%-.64s.%-.64s' has run out", nil), - ErrSequenceInvalidData: mysql.Message("Sequence '%-.64s.%-.64s' values are conflicting", nil), - ErrSequenceAccessFail: mysql.Message("Sequence '%-.64s.%-.64s' access error", nil), - ErrNotSequence: mysql.Message("'%-.64s.%-.64s' is not a SEQUENCE", nil), - ErrUnknownSequence: mysql.Message("Unknown SEQUENCE: '%-.300s'", nil), - ErrWrongInsertIntoSequence: mysql.Message("Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mysqldump). If you want to change the SEQUENCE, use ALTER SEQUENCE instead.", nil), - ErrSequenceInvalidTableStructure: mysql.Message("Sequence '%-.64s.%-.64s' table structure is invalid (%s)", nil), + ErrOnlyOneDefaultPartionAllowed: Message("Only one DEFAULT partition allowed", nil), + ErrWrongPartitionTypeExpectedSystemTime: Message("Wrong partitioning type, expected type: `SYSTEM_TIME`", nil), + ErrSystemVersioningWrongPartitions: Message("Wrong Partitions: must have at least one HISTORY and exactly one last CURRENT", nil), + ErrSequenceRunOut: Message("Sequence '%-.64s.%-.64s' has run out", nil), + ErrSequenceInvalidData: Message("Sequence '%-.64s.%-.64s' values are conflicting", nil), + ErrSequenceAccessFail: Message("Sequence '%-.64s.%-.64s' access error", nil), + ErrNotSequence: Message("'%-.64s.%-.64s' is not a SEQUENCE", nil), + ErrUnknownSequence: Message("Unknown SEQUENCE: '%-.300s'", nil), + ErrWrongInsertIntoSequence: Message("Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mysqldump). If you want to change the SEQUENCE, use ALTER SEQUENCE instead.", nil), + ErrSequenceInvalidTableStructure: Message("Sequence '%-.64s.%-.64s' table structure is invalid (%s)", nil), // TiDB errors. - ErrMemExceedThreshold: mysql.Message("%s holds %dB memory, exceeds threshold %dB.%s", nil), - ErrForUpdateCantRetry: mysql.Message("[%d] can not retry select for update statement", nil), - ErrAdminCheckTable: mysql.Message("TiDB admin check table failed.", nil), - ErrOptOnTemporaryTable: mysql.Message("`%s` is unsupported on temporary tables.", nil), - ErrDropTableOnTemporaryTable: mysql.Message("`drop global temporary table` can only drop global temporary table", nil), - ErrTxnTooLarge: mysql.Message("Transaction is too large, size: %d", nil), - ErrWriteConflictInTiDB: mysql.Message("Write conflict, txnStartTS %d is stale", nil), - ErrInvalidPluginID: mysql.Message("Wrong plugin id: %s, valid plugin id is [name]-[version], and version should not contain '-'", nil), - ErrInvalidPluginManifest: mysql.Message("Cannot read plugin %s's manifest", nil), - ErrInvalidPluginName: mysql.Message("Plugin load with %s but got wrong name %s", nil), - ErrInvalidPluginVersion: mysql.Message("Plugin load with %s but got %s", nil), - ErrDuplicatePlugin: mysql.Message("Plugin [%s] is redeclared", nil), - ErrInvalidPluginSysVarName: mysql.Message("Plugin %s's sysVar %s must start with its plugin name %s", nil), - ErrRequireVersionCheckFail: mysql.Message("Plugin %s require %s be %v but got %v", nil), - ErrUnsupportedReloadPlugin: mysql.Message("Plugin %s isn't loaded so cannot be reloaded", nil), - ErrUnsupportedReloadPluginVar: mysql.Message("Reload plugin with different sysVar is unsupported %v", nil), - ErrTableLocked: mysql.Message("Table '%s' was locked in %s by %v", nil), - ErrNotExist: mysql.Message("Error: key not exist", nil), - ErrTxnRetryable: mysql.Message("Error: KV error safe to retry %s ", []int{0}), - ErrCannotSetNilValue: mysql.Message("can not set nil value", nil), - ErrInvalidTxn: mysql.Message("invalid transaction", nil), - ErrEntryTooLarge: mysql.Message("entry too large, the max entry size is %d, the size of data is %d", nil), - ErrNotImplemented: mysql.Message("not implemented", nil), - ErrInfoSchemaExpired: mysql.Message("Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV", nil), - ErrInfoSchemaChanged: mysql.Message("Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`", nil), - ErrBadNumber: mysql.Message("Bad Number", nil), - ErrCastAsSignedOverflow: mysql.Message("Cast to signed converted positive out-of-range integer to its negative complement", nil), - ErrCastNegIntAsUnsigned: mysql.Message("Cast to unsigned converted negative integer to it's positive complement", nil), - ErrInvalidYearFormat: mysql.Message("invalid year format", nil), - ErrInvalidYear: mysql.Message("invalid year", nil), - ErrIncorrectDatetimeValue: mysql.Message("Incorrect datetime value: '%s'", []int{0}), - ErrInvalidTimeFormat: mysql.Message("invalid time format: '%v'", []int{0}), - ErrInvalidWeekModeFormat: mysql.Message("invalid week mode format: '%v'", nil), - ErrFieldGetDefaultFailed: mysql.Message("Field '%s' get default value fail", nil), - ErrIndexOutBound: mysql.Message("Index column %s offset out of bound, offset: %d, row: %v", []int{2}), - ErrUnsupportedOp: mysql.Message("operation not supported", nil), - ErrRowNotFound: mysql.Message("can not find the row: %s", []int{0}), - ErrTableStateCantNone: mysql.Message("table %s can't be in none state", nil), - ErrColumnStateCantNone: mysql.Message("column %s can't be in none state", nil), - ErrColumnStateNonPublic: mysql.Message("can not use non-public column", nil), - ErrIndexStateCantNone: mysql.Message("index %s can't be in none state", nil), - ErrInvalidRecordKey: mysql.Message("invalid record key", nil), - ErrUnsupportedValueForVar: mysql.Message("variable '%s' does not yet support value: %s", nil), - ErrUnsupportedIsolationLevel: mysql.Message("The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error", nil), - ErrInvalidDDLWorker: mysql.Message("Invalid DDL worker", nil), - ErrUnsupportedDDLOperation: mysql.Message("Unsupported %s", nil), - ErrNotOwner: mysql.Message("TiDB server is not a DDL owner", nil), - ErrCantDecodeRecord: mysql.Message("Cannot decode %s value, because %v", nil), - ErrInvalidDDLJob: mysql.Message("Invalid DDL job", nil), - ErrInvalidDDLJobFlag: mysql.Message("Invalid DDL job flag", nil), - ErrWaitReorgTimeout: mysql.Message("Timeout waiting for data reorganization", nil), - ErrInvalidStoreVersion: mysql.Message("Invalid storage current version: %d", nil), - ErrUnknownTypeLength: mysql.Message("Unknown length for type %d", nil), - ErrUnknownFractionLength: mysql.Message("Unknown length for type %d and fraction %d", nil), - ErrInvalidDDLJobVersion: mysql.Message("Version %d of DDL job is greater than current one: %d", nil), - ErrInvalidSplitRegionRanges: mysql.Message("Failed to split region ranges: %s", nil), - ErrReorgPanic: mysql.Message("Reorg worker panic", nil), - ErrInvalidDDLState: mysql.Message("Invalid %s state: %v", nil), - ErrCancelledDDLJob: mysql.Message("Cancelled DDL job", nil), - ErrRepairTable: mysql.Message("Failed to repair table: %s", nil), - ErrLoadPrivilege: mysql.Message("Load privilege table fail: %s", nil), - ErrInvalidPrivilegeType: mysql.Message("unknown privilege type %s", nil), - ErrUnknownFieldType: mysql.Message("unknown field type", nil), - ErrInvalidSequence: mysql.Message("invalid sequence", nil), - ErrInvalidType: mysql.Message("invalid type", nil), - ErrCantGetValidID: mysql.Message("Cannot get a valid auto-ID when retrying the statement", nil), - ErrCantSetToNull: mysql.Message("cannot set variable to null", nil), - ErrSnapshotTooOld: mysql.Message("snapshot is older than GC safe point %s", nil), - ErrInvalidTableID: mysql.Message("invalid TableID", nil), - ErrInvalidAutoRandom: mysql.Message("Invalid auto random: %s", nil), - ErrInvalidHashKeyFlag: mysql.Message("invalid encoded hash key flag", nil), - ErrInvalidListIndex: mysql.Message("invalid list index", nil), - ErrInvalidListMetaData: mysql.Message("invalid list meta data", nil), - ErrWriteOnSnapshot: mysql.Message("write on snapshot", nil), - ErrInvalidKey: mysql.Message("invalid key", nil), - ErrInvalidIndexKey: mysql.Message("invalid index key", nil), - ErrDataInconsistent: mysql.Message("data inconsistency in table: %s, index: %s, handle: %s, index-values:%#v != record-values:%#v", []int{2, 3, 4}), - ErrDDLReorgElementNotExist: mysql.Message("DDL reorg element does not exist", nil), - ErrDDLJobNotFound: mysql.Message("DDL Job:%v not found", nil), - ErrCancelFinishedDDLJob: mysql.Message("This job:%v is finished, so can't be cancelled", nil), - ErrCannotCancelDDLJob: mysql.Message("This job:%v is almost finished, can't be cancelled now", nil), - ErrUnknownAllocatorType: mysql.Message("Invalid allocator type", nil), - ErrAutoRandReadFailed: mysql.Message("Failed to read auto-random value from storage engine", nil), - ErrInvalidIncrementAndOffset: mysql.Message("Invalid auto_increment settings: auto_increment_increment: %d, auto_increment_offset: %d, both of them must be in range [1..65535]", nil), - ErrDataInconsistentMismatchCount: mysql.Message("data inconsistency in table: %s, index: %s, index-count:%d != record-count:%d", nil), - ErrDataInconsistentMismatchIndex: mysql.Message("data inconsistency in table: %s, index: %s, col: %s, handle: %#v, index-values:%#v != record-values:%#v, compare err:%#v", []int{3, 4, 5, 6}), - ErrInconsistentRowValue: mysql.Message("writing inconsistent data in table: %s, expected-values:{%s} != record-values:{%s}", []int{1, 2}), - ErrInconsistentHandle: mysql.Message("writing inconsistent data in table: %s, index: %s, index-handle:%#v != record-handle:%#v, index: %#v, record: %#v", []int{2, 3, 4, 5}), - ErrInconsistentIndexedValue: mysql.Message("writing inconsistent data in table: %s, index: %s, col: %s, indexed-value:{%s} != record-value:{%s}", []int{3, 4}), - ErrAssertionFailed: mysql.Message("assertion failed: key: %s, assertion: %s, start_ts: %v, existing start ts: %v, existing commit ts: %v", []int{0}), - ErrInstanceScope: mysql.Message("modifying %s will require SET GLOBAL in a future version of TiDB", nil), - ErrNonTransactionalJobFailure: mysql.Message("non-transactional job failed, job id: %d, total jobs: %d. job range: [%s, %s], job sql: %s, err: %v", []int{2, 3, 4}), - ErrSettingNoopVariable: mysql.Message("setting %s has no effect in TiDB", nil), - ErrGettingNoopVariable: mysql.Message("variable %s has no effect in TiDB", nil), - ErrCannotMigrateSession: mysql.Message("cannot migrate the current session: %s", nil), - ErrLazyUniquenessCheckFailure: mysql.Message("transaction aborted because lazy uniqueness check is enabled and an error occurred: %s", nil), - ErrUnsupportedColumnInTTLConfig: mysql.Message("Field '%-.192s' is of a not supported type for TTL config, expect DATETIME, DATE or TIMESTAMP", nil), - ErrTTLColumnCannotDrop: mysql.Message("Cannot drop column '%-.192s': needed in TTL config", nil), - ErrSetTTLOptionForNonTTLTable: mysql.Message("Cannot set %s on a table without TTL config", nil), - ErrTempTableNotAllowedWithTTL: mysql.Message("Set TTL for temporary table is not allowed", nil), - ErrUnsupportedTTLReferencedByFK: mysql.Message("Set TTL for a table referenced by foreign key is not allowed", nil), - ErrUnsupportedPrimaryKeyTypeWithTTL: mysql.Message("Unsupported clustered primary key type FLOAT/DOUBLE for TTL", nil), - ErrLoadDataFromServerDisk: mysql.Message("Don't support load data from tidb-server's disk. Or if you want to load local data via client, the path of INFILE '%s' needs to specify the clause of LOCAL first", nil), - ErrLoadParquetFromLocal: mysql.Message("Do not support loading parquet files from local. Please try to load the parquet files from the cloud storage", nil), - ErrLoadDataEmptyPath: mysql.Message("The value of INFILE must not be empty when LOAD DATA from LOCAL", nil), - ErrLoadDataUnsupportedFormat: mysql.Message("The FORMAT '%s' is not supported", nil), - ErrLoadDataInvalidURI: mysql.Message("The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access-key={your_access_key_id ID}&secret-access-key={your_secret_access_key}&session-token={your_session_token}'", nil), - ErrLoadDataCantAccess: mysql.Message("Access to the %s has been denied. Reason: %s. Please check the URI, access key and secret access key are correct", nil), - ErrLoadDataCantRead: mysql.Message("Failed to read source files. Reason: %s. %s", nil), - ErrLoadDataWrongFormatConfig: mysql.Message("", nil), - ErrUnknownOption: mysql.Message("Unknown option %s", nil), - ErrInvalidOptionVal: mysql.Message("Invalid option value for %s", nil), - ErrDuplicateOption: mysql.Message("Option %s specified more than once", nil), - ErrLoadDataUnsupportedOption: mysql.Message("Unsupported option %s for %s", nil), - ErrLoadDataJobNotFound: mysql.Message("Job ID %d doesn't exist", nil), - ErrLoadDataInvalidOperation: mysql.Message("The current job status cannot perform the operation. %s", nil), - ErrLoadDataLocalUnsupportedOption: mysql.Message("Unsupported option for LOAD DATA LOCAL INFILE: %s", nil), - ErrLoadDataPreCheckFailed: mysql.Message("PreCheck failed: %s", nil), - ErrMemoryExceedForQuery: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=%d]", nil), - ErrMemoryExceedForInstance: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for the tidb-server instance and this query is currently using the most memory. Please try narrowing your query scope or increase the tidb_server_memory_limit and try again.[conn=%d]", nil), - ErrDeleteNotFoundColumn: mysql.Message("Delete can not find column %s for table %s", nil), - ErrKeyTooLarge: mysql.Message("key is too large, the size of given key is %d", nil), + ErrMemExceedThreshold: Message("%s holds %dB memory, exceeds threshold %dB.%s", nil), + ErrForUpdateCantRetry: Message("[%d] can not retry select for update statement", nil), + ErrAdminCheckTable: Message("TiDB admin check table failed.", nil), + ErrOptOnTemporaryTable: Message("`%s` is unsupported on temporary tables.", nil), + ErrDropTableOnTemporaryTable: Message("`drop global temporary table` can only drop global temporary table", nil), + ErrTxnTooLarge: Message("Transaction is too large, size: %d", nil), + ErrWriteConflictInTiDB: Message("Write conflict, txnStartTS %d is stale", nil), + ErrInvalidPluginID: Message("Wrong plugin id: %s, valid plugin id is [name]-[version], and version should not contain '-'", nil), + ErrInvalidPluginManifest: Message("Cannot read plugin %s's manifest", nil), + ErrInvalidPluginName: Message("Plugin load with %s but got wrong name %s", nil), + ErrInvalidPluginVersion: Message("Plugin load with %s but got %s", nil), + ErrDuplicatePlugin: Message("Plugin [%s] is redeclared", nil), + ErrInvalidPluginSysVarName: Message("Plugin %s's sysVar %s must start with its plugin name %s", nil), + ErrRequireVersionCheckFail: Message("Plugin %s require %s be %v but got %v", nil), + ErrUnsupportedReloadPlugin: Message("Plugin %s isn't loaded so cannot be reloaded", nil), + ErrUnsupportedReloadPluginVar: Message("Reload plugin with different sysVar is unsupported %v", nil), + ErrTableLocked: Message("Table '%s' was locked in %s by %v", nil), + ErrNotExist: Message("Error: key not exist", nil), + ErrTxnRetryable: Message("Error: KV error safe to retry %s ", []int{0}), + ErrCannotSetNilValue: Message("can not set nil value", nil), + ErrInvalidTxn: Message("invalid transaction", nil), + ErrEntryTooLarge: Message("entry too large, the max entry size is %d, the size of data is %d", nil), + ErrNotImplemented: Message("not implemented", nil), + ErrInfoSchemaExpired: Message("Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV", nil), + ErrInfoSchemaChanged: Message("Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`", nil), + ErrBadNumber: Message("Bad Number", nil), + ErrCastAsSignedOverflow: Message("Cast to signed converted positive out-of-range integer to its negative complement", nil), + ErrCastNegIntAsUnsigned: Message("Cast to unsigned converted negative integer to it's positive complement", nil), + ErrInvalidYearFormat: Message("invalid year format", nil), + ErrInvalidYear: Message("invalid year", nil), + ErrIncorrectDatetimeValue: Message("Incorrect datetime value: '%s'", []int{0}), + ErrInvalidTimeFormat: Message("invalid time format: '%v'", []int{0}), + ErrInvalidWeekModeFormat: Message("invalid week mode format: '%v'", nil), + ErrFieldGetDefaultFailed: Message("Field '%s' get default value fail", nil), + ErrIndexOutBound: Message("Index column %s offset out of bound, offset: %d, row: %v", []int{2}), + ErrUnsupportedOp: Message("operation not supported", nil), + ErrRowNotFound: Message("can not find the row: %s", []int{0}), + ErrTableStateCantNone: Message("table %s can't be in none state", nil), + ErrColumnStateCantNone: Message("column %s can't be in none state", nil), + ErrColumnStateNonPublic: Message("can not use non-public column", nil), + ErrIndexStateCantNone: Message("index %s can't be in none state", nil), + ErrInvalidRecordKey: Message("invalid record key", nil), + ErrUnsupportedValueForVar: Message("variable '%s' does not yet support value: %s", nil), + ErrUnsupportedIsolationLevel: Message("The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error", nil), + ErrInvalidDDLWorker: Message("Invalid DDL worker", nil), + ErrUnsupportedDDLOperation: Message("Unsupported %s", nil), + ErrNotOwner: Message("TiDB server is not a DDL owner", nil), + ErrCantDecodeRecord: Message("Cannot decode %s value, because %v", nil), + ErrInvalidDDLJob: Message("Invalid DDL job", nil), + ErrInvalidDDLJobFlag: Message("Invalid DDL job flag", nil), + ErrWaitReorgTimeout: Message("Timeout waiting for data reorganization", nil), + ErrInvalidStoreVersion: Message("Invalid storage current version: %d", nil), + ErrUnknownTypeLength: Message("Unknown length for type %d", nil), + ErrUnknownFractionLength: Message("Unknown length for type %d and fraction %d", nil), + ErrInvalidDDLJobVersion: Message("Version %d of DDL job is greater than current one: %d", nil), + ErrInvalidSplitRegionRanges: Message("Failed to split region ranges: %s", nil), + ErrReorgPanic: Message("Reorg worker panic", nil), + ErrInvalidDDLState: Message("Invalid %s state: %v", nil), + ErrCancelledDDLJob: Message("Cancelled DDL job", nil), + ErrRepairTable: Message("Failed to repair table: %s", nil), + ErrLoadPrivilege: Message("Load privilege table fail: %s", nil), + ErrInvalidPrivilegeType: Message("unknown privilege type %s", nil), + ErrUnknownFieldType: Message("unknown field type", nil), + ErrInvalidSequence: Message("invalid sequence", nil), + ErrInvalidType: Message("invalid type", nil), + ErrCantGetValidID: Message("Cannot get a valid auto-ID when retrying the statement", nil), + ErrCantSetToNull: Message("cannot set variable to null", nil), + ErrSnapshotTooOld: Message("snapshot is older than GC safe point %s", nil), + ErrInvalidTableID: Message("invalid TableID", nil), + ErrInvalidAutoRandom: Message("Invalid auto random: %s", nil), + ErrInvalidHashKeyFlag: Message("invalid encoded hash key flag", nil), + ErrInvalidListIndex: Message("invalid list index", nil), + ErrInvalidListMetaData: Message("invalid list meta data", nil), + ErrWriteOnSnapshot: Message("write on snapshot", nil), + ErrInvalidKey: Message("invalid key", nil), + ErrInvalidIndexKey: Message("invalid index key", nil), + ErrDataInconsistent: Message("data inconsistency in table: %s, index: %s, handle: %s, index-values:%#v != record-values:%#v", []int{2, 3, 4}), + ErrDDLReorgElementNotExist: Message("DDL reorg element does not exist", nil), + ErrDDLJobNotFound: Message("DDL Job:%v not found", nil), + ErrCancelFinishedDDLJob: Message("This job:%v is finished, so can't be cancelled", nil), + ErrCannotCancelDDLJob: Message("This job:%v is almost finished, can't be cancelled now", nil), + ErrUnknownAllocatorType: Message("Invalid allocator type", nil), + ErrAutoRandReadFailed: Message("Failed to read auto-random value from storage engine", nil), + ErrInvalidIncrementAndOffset: Message("Invalid auto_increment settings: auto_increment_increment: %d, auto_increment_offset: %d, both of them must be in range [1..65535]", nil), + ErrDataInconsistentMismatchCount: Message("data inconsistency in table: %s, index: %s, index-count:%d != record-count:%d", nil), + ErrDataInconsistentMismatchIndex: Message("data inconsistency in table: %s, index: %s, col: %s, handle: %#v, index-values:%#v != record-values:%#v, compare err:%#v", []int{3, 4, 5, 6}), + ErrInconsistentRowValue: Message("writing inconsistent data in table: %s, expected-values:{%s} != record-values:{%s}", []int{1, 2}), + ErrInconsistentHandle: Message("writing inconsistent data in table: %s, index: %s, index-handle:%#v != record-handle:%#v, index: %#v, record: %#v", []int{2, 3, 4, 5}), + ErrInconsistentIndexedValue: Message("writing inconsistent data in table: %s, index: %s, col: %s, indexed-value:{%s} != record-value:{%s}", []int{3, 4}), + ErrAssertionFailed: Message("assertion failed: key: %s, assertion: %s, start_ts: %v, existing start ts: %v, existing commit ts: %v", []int{0}), + ErrInstanceScope: Message("modifying %s will require SET GLOBAL in a future version of TiDB", nil), + ErrNonTransactionalJobFailure: Message("non-transactional job failed, job id: %d, total jobs: %d. job range: [%s, %s], job sql: %s, err: %v", []int{2, 3, 4}), + ErrSettingNoopVariable: Message("setting %s has no effect in TiDB", nil), + ErrGettingNoopVariable: Message("variable %s has no effect in TiDB", nil), + ErrCannotMigrateSession: Message("cannot migrate the current session: %s", nil), + ErrLazyUniquenessCheckFailure: Message("transaction aborted because lazy uniqueness check is enabled and an error occurred: %s", nil), + ErrUnsupportedColumnInTTLConfig: Message("Field '%-.192s' is of a not supported type for TTL config, expect DATETIME, DATE or TIMESTAMP", nil), + ErrTTLColumnCannotDrop: Message("Cannot drop column '%-.192s': needed in TTL config", nil), + ErrSetTTLOptionForNonTTLTable: Message("Cannot set %s on a table without TTL config", nil), + ErrTempTableNotAllowedWithTTL: Message("Set TTL for temporary table is not allowed", nil), + ErrUnsupportedTTLReferencedByFK: Message("Set TTL for a table referenced by foreign key is not allowed", nil), + ErrUnsupportedPrimaryKeyTypeWithTTL: Message("Unsupported clustered primary key type FLOAT/DOUBLE for TTL", nil), + ErrLoadDataFromServerDisk: Message("Don't support load data from tidb-server's disk. Or if you want to load local data via client, the path of INFILE '%s' needs to specify the clause of LOCAL first", nil), + ErrLoadParquetFromLocal: Message("Do not support loading parquet files from local. Please try to load the parquet files from the cloud storage", nil), + ErrLoadDataEmptyPath: Message("The value of INFILE must not be empty when LOAD DATA from LOCAL", nil), + ErrLoadDataUnsupportedFormat: Message("The FORMAT '%s' is not supported", nil), + ErrLoadDataInvalidURI: Message("The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access-key={your_access_key_id ID}&secret-access-key={your_secret_access_key}&session-token={your_session_token}'", nil), + ErrLoadDataCantAccess: Message("Access to the %s has been denied. Reason: %s. Please check the URI, access key and secret access key are correct", nil), + ErrLoadDataCantRead: Message("Failed to read source files. Reason: %s. %s", nil), + ErrLoadDataWrongFormatConfig: Message("", nil), + ErrUnknownOption: Message("Unknown option %s", nil), + ErrInvalidOptionVal: Message("Invalid option value for %s", nil), + ErrDuplicateOption: Message("Option %s specified more than once", nil), + ErrLoadDataUnsupportedOption: Message("Unsupported option %s for %s", nil), + ErrLoadDataJobNotFound: Message("Job ID %d doesn't exist", nil), + ErrLoadDataInvalidOperation: Message("The current job status cannot perform the operation. %s", nil), + ErrLoadDataLocalUnsupportedOption: Message("Unsupported option for LOAD DATA LOCAL INFILE: %s", nil), + ErrLoadDataPreCheckFailed: Message("PreCheck failed: %s", nil), + ErrMemoryExceedForQuery: Message("Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=%d]", nil), + ErrMemoryExceedForInstance: Message("Your query has been cancelled due to exceeding the allowed memory limit for the tidb-server instance and this query is currently using the most memory. Please try narrowing your query scope or increase the tidb_server_memory_limit and try again.[conn=%d]", nil), + ErrDeleteNotFoundColumn: Message("Delete can not find column %s for table %s", nil), + ErrKeyTooLarge: Message("key is too large, the size of given key is %d", nil), - ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil), + ErrHTTPServiceError: Message("HTTP request failed with status %s", nil), - ErrWarnOptimizerHintInvalidInteger: mysql.Message("integer value is out of range in '%s'", nil), - ErrWarnOptimizerHintUnsupportedHint: mysql.Message("Optimizer hint %s is not supported by TiDB and is ignored", nil), - ErrWarnOptimizerHintInvalidToken: mysql.Message("Cannot use %s '%s' (tok = %d) in an optimizer hint", nil), - ErrWarnMemoryQuotaOverflow: mysql.Message("Max value of MEMORY_QUOTA is %d bytes, ignore this invalid limit", nil), - ErrWarnOptimizerHintParseError: mysql.Message("Optimizer hint syntax error at %v", nil), - ErrWarnOptimizerHintWrongPos: mysql.Message("Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.", nil), + ErrWarnOptimizerHintInvalidInteger: Message("integer value is out of range in '%s'", nil), + ErrWarnOptimizerHintUnsupportedHint: Message("Optimizer hint %s is not supported by TiDB and is ignored", nil), + ErrWarnOptimizerHintInvalidToken: Message("Cannot use %s '%s' (tok = %d) in an optimizer hint", nil), + ErrWarnMemoryQuotaOverflow: Message("Max value of MEMORY_QUOTA is %d bytes, ignore this invalid limit", nil), + ErrWarnOptimizerHintParseError: Message("Optimizer hint syntax error at %v", nil), + ErrWarnOptimizerHintWrongPos: Message("Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.", nil), - ErrSequenceUnsupportedTableOption: mysql.Message("Unsupported sequence table-option %s", nil), - ErrColumnTypeUnsupportedNextValue: mysql.Message("Unsupported sequence default value for column type '%s'", nil), - ErrAddColumnWithSequenceAsDefault: mysql.Message("Unsupported using sequence as default value in add column '%s'", nil), - ErrUnsupportedType: mysql.Message("Unsupported type %T", nil), - ErrAnalyzeMissIndex: mysql.Message("Index '%s' in field list does not exist in table '%s'", nil), - ErrAnalyzeMissColumn: mysql.Message("Column '%s' in ANALYZE column option does not exist in table '%s'", nil), - ErrCartesianProductUnsupported: mysql.Message("Cartesian product is unsupported", nil), - ErrPreparedStmtNotFound: mysql.Message("Prepared statement not found", nil), - ErrWrongParamCount: mysql.Message("Wrong parameter count", nil), - ErrSchemaChanged: mysql.Message("Schema has changed", nil), - ErrUnknownPlan: mysql.Message("Unknown plan", nil), - ErrPrepareMulti: mysql.Message("Can not prepare multiple statements", nil), - ErrPrepareDDL: mysql.Message("Can not prepare DDL statements with parameters", nil), - ErrResultIsEmpty: mysql.Message("Result is empty", nil), - ErrBuildExecutor: mysql.Message("Failed to build executor", nil), - ErrBatchInsertFail: mysql.Message("Batch insert failed, please clean the table and try again.", nil), - ErrGetStartTS: mysql.Message("Can not get start ts", nil), - ErrPrivilegeCheckFail: mysql.Message("privilege check for '%s' fail", nil), // this error message should begin lowercased to be compatible with the test - ErrInvalidWildCard: mysql.Message("Wildcard fields without any table name appears in wrong place", nil), - ErrMixOfGroupFuncAndFieldsIncompatible: mysql.Message("In aggregated query without GROUP BY, expression #%d of SELECT list contains nonaggregated column '%s'; this is incompatible with sql_mode=only_full_group_by", nil), - ErrUnsupportedSecondArgumentType: mysql.Message("JSON_OBJECTAGG: unsupported second argument type %v", nil), - ErrColumnNotMatched: mysql.Message("Load data: unmatched columns", nil), - ErrLockExpire: mysql.Message("TTL manager has timed out, pessimistic locks may expire, please commit or rollback this transaction", nil), - ErrTableOptionUnionUnsupported: mysql.Message("CREATE/ALTER table with union option is not supported", nil), - ErrTableOptionInsertMethodUnsupported: mysql.Message("CREATE/ALTER table with insert method option is not supported", nil), - ErrUserLockDeadlock: mysql.Message("Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.", nil), - ErrUserLockWrongName: mysql.Message("Incorrect user-level lock name '%s'.", nil), + ErrSequenceUnsupportedTableOption: Message("Unsupported sequence table-option %s", nil), + ErrColumnTypeUnsupportedNextValue: Message("Unsupported sequence default value for column type '%s'", nil), + ErrAddColumnWithSequenceAsDefault: Message("Unsupported using sequence as default value in add column '%s'", nil), + ErrUnsupportedType: Message("Unsupported type %T", nil), + ErrAnalyzeMissIndex: Message("Index '%s' in field list does not exist in table '%s'", nil), + ErrAnalyzeMissColumn: Message("Column '%s' in ANALYZE column option does not exist in table '%s'", nil), + ErrCartesianProductUnsupported: Message("Cartesian product is unsupported", nil), + ErrPreparedStmtNotFound: Message("Prepared statement not found", nil), + ErrWrongParamCount: Message("Wrong parameter count", nil), + ErrSchemaChanged: Message("Schema has changed", nil), + ErrUnknownPlan: Message("Unknown plan", nil), + ErrPrepareMulti: Message("Can not prepare multiple statements", nil), + ErrPrepareDDL: Message("Can not prepare DDL statements with parameters", nil), + ErrResultIsEmpty: Message("Result is empty", nil), + ErrBuildExecutor: Message("Failed to build executor", nil), + ErrBatchInsertFail: Message("Batch insert failed, please clean the table and try again.", nil), + ErrGetStartTS: Message("Can not get start ts", nil), + ErrPrivilegeCheckFail: Message("privilege check for '%s' fail", nil), // this error message should begin lowercased to be compatible with the test + ErrInvalidWildCard: Message("Wildcard fields without any table name appears in wrong place", nil), + ErrMixOfGroupFuncAndFieldsIncompatible: Message("In aggregated query without GROUP BY, expression #%d of SELECT list contains nonaggregated column '%s'; this is incompatible with sql_mode=only_full_group_by", nil), + ErrUnsupportedSecondArgumentType: Message("JSON_OBJECTAGG: unsupported second argument type %v", nil), + ErrColumnNotMatched: Message("Load data: unmatched columns", nil), + ErrLockExpire: Message("TTL manager has timed out, pessimistic locks may expire, please commit or rollback this transaction", nil), + ErrTableOptionUnionUnsupported: Message("CREATE/ALTER table with union option is not supported", nil), + ErrTableOptionInsertMethodUnsupported: Message("CREATE/ALTER table with insert method option is not supported", nil), + ErrUserLockDeadlock: Message("Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.", nil), + ErrUserLockWrongName: Message("Incorrect user-level lock name '%s'.", nil), - ErrBRIEBackupFailed: mysql.Message("Backup failed: %s", nil), - ErrBRIERestoreFailed: mysql.Message("Restore failed: %s", nil), - ErrBRIEImportFailed: mysql.Message("Import failed: %s", nil), - ErrBRIEExportFailed: mysql.Message("Export failed: %s", nil), - ErrBRJobNotFound: mysql.Message("BRIE Job %d not found", nil), + ErrBRIEBackupFailed: Message("Backup failed: %s", nil), + ErrBRIERestoreFailed: Message("Restore failed: %s", nil), + ErrBRIEImportFailed: Message("Import failed: %s", nil), + ErrBRIEExportFailed: Message("Export failed: %s", nil), + ErrBRJobNotFound: Message("BRIE Job %d not found", nil), - ErrInvalidTableSample: mysql.Message("Invalid TABLESAMPLE: %s", nil), + ErrInvalidTableSample: Message("Invalid TABLESAMPLE: %s", nil), - ErrJSONObjectKeyTooLong: mysql.Message("TiDB does not yet support JSON objects with the key length >= 65536", nil), - ErrPartitionStatsMissing: mysql.Message("Build global-level stats failed due to missing partition-level stats: %s", nil), - ErrPartitionColumnStatsMissing: mysql.Message("Build global-level stats failed due to missing partition-level column stats: %s, please run analyze table to refresh columns of all partitions", nil), - ErrDDLSetting: mysql.Message("Error happened when %s DDL: %s", nil), - ErrIngestFailed: mysql.Message("Ingest failed: %s", nil), - ErrIngestCheckEnvFailed: mysql.Message("Check ingest environment failed: %s", nil), - ErrNotSupportedWithSem: mysql.Message("Feature '%s' is not supported when security enhanced mode is enabled", nil), + ErrJSONObjectKeyTooLong: Message("TiDB does not yet support JSON objects with the key length >= 65536", nil), + ErrPartitionStatsMissing: Message("Build global-level stats failed due to missing partition-level stats: %s", nil), + ErrPartitionColumnStatsMissing: Message("Build global-level stats failed due to missing partition-level column stats: %s, please run analyze table to refresh columns of all partitions", nil), + ErrDDLSetting: Message("Error happened when %s DDL: %s", nil), + ErrIngestFailed: Message("Ingest failed: %s", nil), + ErrIngestCheckEnvFailed: Message("Check ingest environment failed: %s", nil), + ErrNotSupportedWithSem: Message("Feature '%s' is not supported when security enhanced mode is enabled", nil), - ErrPlacementPolicyCheck: mysql.Message("Placement policy didn't meet the constraint, reason: %s", nil), - ErrMultiStatementDisabled: mysql.Message("client has multi-statement capability disabled. Run SET GLOBAL tidb_multi_statement_mode='ON' after you understand the security risk", nil), - ErrAsOf: mysql.Message("invalid as of timestamp: %s", nil), - ErrVariableNoLongerSupported: mysql.Message("option '%s' is no longer supported. Reason: %s", nil), - ErrInvalidAttributesSpec: mysql.Message("Invalid attributes: %s", nil), - ErrPlacementPolicyExists: mysql.Message("Placement policy '%-.192s' already exists", nil), - ErrPlacementPolicyNotExists: mysql.Message("Unknown placement policy '%-.192s'", nil), - ErrPlacementPolicyWithDirectOption: mysql.Message("Placement policy '%s' can't co-exist with direct placement options", nil), - ErrPlacementPolicyInUse: mysql.Message("Placement policy '%-.192s' is still in use", nil), - ErrOptOnCacheTable: mysql.Message("'%s' is unsupported on cache tables.", nil), - ErrResourceGroupExists: mysql.Message("Resource group '%-.192s' already exists", nil), - ErrResourceGroupNotExists: mysql.Message("Unknown resource group '%-.192s'", nil), - ErrResourceGroupInvalidForRole: mysql.Message("Cannot set resource group for a role", nil), + ErrPlacementPolicyCheck: Message("Placement policy didn't meet the constraint, reason: %s", nil), + ErrMultiStatementDisabled: Message("client has multi-statement capability disabled. Run SET GLOBAL tidb_multi_statement_mode='ON' after you understand the security risk", nil), + ErrAsOf: Message("invalid as of timestamp: %s", nil), + ErrVariableNoLongerSupported: Message("option '%s' is no longer supported. Reason: %s", nil), + ErrInvalidAttributesSpec: Message("Invalid attributes: %s", nil), + ErrPlacementPolicyExists: Message("Placement policy '%-.192s' already exists", nil), + ErrPlacementPolicyNotExists: Message("Unknown placement policy '%-.192s'", nil), + ErrPlacementPolicyWithDirectOption: Message("Placement policy '%s' can't co-exist with direct placement options", nil), + ErrPlacementPolicyInUse: Message("Placement policy '%-.192s' is still in use", nil), + ErrOptOnCacheTable: Message("'%s' is unsupported on cache tables.", nil), + ErrResourceGroupExists: Message("Resource group '%-.192s' already exists", nil), + ErrResourceGroupNotExists: Message("Unknown resource group '%-.192s'", nil), + ErrResourceGroupInvalidForRole: Message("Cannot set resource group for a role", nil), - ErrColumnInChange: mysql.Message("column %s id %d does not exist, this column may have been updated by other DDL ran in parallel", nil), - ErrResourceGroupSupportDisabled: mysql.Message("Resource control feature is disabled. Run `SET GLOBAL tidb_enable_resource_control='on'` to enable the feature", nil), - ErrResourceGroupConfigUnavailable: mysql.Message("Resource group configuration is unavailable", nil), - ErrResourceGroupThrottled: mysql.Message("Exceeded resource group quota limitation", nil), - ErrResourceGroupQueryRunawayInterrupted: mysql.Message("Query execution was interrupted, identified as runaway query [%s]", nil), - ErrResourceGroupQueryRunawayQuarantine: mysql.Message("Quarantined and interrupted because of being in runaway watch list", nil), - ErrResourceGroupInvalidBackgroundTaskName: mysql.Message("Unknown background task name '%-.192s'", nil), + ErrColumnInChange: Message("column %s id %d does not exist, this column may have been updated by other DDL ran in parallel", nil), + ErrResourceGroupSupportDisabled: Message("Resource control feature is disabled. Run `SET GLOBAL tidb_enable_resource_control='on'` to enable the feature", nil), + ErrResourceGroupConfigUnavailable: Message("Resource group configuration is unavailable", nil), + ErrResourceGroupThrottled: Message("Exceeded resource group quota limitation", nil), + ErrResourceGroupQueryRunawayInterrupted: Message("Query execution was interrupted, identified as runaway query [%s]", nil), + ErrResourceGroupQueryRunawayQuarantine: Message("Quarantined and interrupted because of being in runaway watch list", nil), + ErrResourceGroupInvalidBackgroundTaskName: Message("Unknown background task name '%-.192s'", nil), // TiKV/PD errors. - ErrPDServerTimeout: mysql.Message("PD server timeout: %s", nil), - ErrTiKVServerTimeout: mysql.Message("TiKV server timeout", nil), - ErrTiKVServerBusy: mysql.Message("TiKV server is busy", nil), - ErrTiFlashServerTimeout: mysql.Message("TiFlash server timeout", nil), - ErrTiFlashServerBusy: mysql.Message("TiFlash server is busy", nil), - ErrTiFlashBackfillIndex: mysql.Message("TiFlash backfill index failed: %s", nil), - ErrResolveLockTimeout: mysql.Message("Resolve lock timeout", nil), - ErrRegionUnavailable: mysql.Message("Region is unavailable", nil), - ErrGCTooEarly: mysql.Message("GC life time is shorter than transaction duration, transaction starts at %v, GC safe point is %v", nil), - ErrWriteConflict: mysql.Message("Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s%s%s%s, reason=%s", []int{3, 4, 5, 6}), // the first and third parts of the key are the optional database names and table names - ErrTiKVStoreLimit: mysql.Message("Store token is up to the limit, store id = %d", nil), - ErrPrometheusAddrIsNotSet: mysql.Message("Prometheus address is not set in PD and etcd", nil), - ErrTiKVStaleCommand: mysql.Message("TiKV server reports stale command", nil), - ErrTiKVMaxTimestampNotSynced: mysql.Message("TiKV max timestamp is not synced", nil), + ErrPDServerTimeout: Message("PD server timeout: %s", nil), + ErrTiKVServerTimeout: Message("TiKV server timeout", nil), + ErrTiKVServerBusy: Message("TiKV server is busy", nil), + ErrTiFlashServerTimeout: Message("TiFlash server timeout", nil), + ErrTiFlashServerBusy: Message("TiFlash server is busy", nil), + ErrTiFlashBackfillIndex: Message("TiFlash backfill index failed: %s", nil), + ErrResolveLockTimeout: Message("Resolve lock timeout", nil), + ErrRegionUnavailable: Message("Region is unavailable", nil), + ErrGCTooEarly: Message("GC life time is shorter than transaction duration, transaction starts at %v, GC safe point is %v", nil), + ErrWriteConflict: Message("Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s%s%s%s, reason=%s", []int{3, 4, 5, 6}), // the first and third parts of the key are the optional database names and table names + ErrTiKVStoreLimit: Message("Store token is up to the limit, store id = %d", nil), + ErrPrometheusAddrIsNotSet: Message("Prometheus address is not set in PD and etcd", nil), + ErrTiKVStaleCommand: Message("TiKV server reports stale command", nil), + ErrTiKVMaxTimestampNotSynced: Message("TiKV max timestamp is not synced", nil), - ErrCannotPauseDDLJob: mysql.Message("Job [%v] can't be paused: %s", nil), - ErrCannotResumeDDLJob: mysql.Message("Job [%v] can't be resumed: %s", nil), - ErrPausedDDLJob: mysql.Message("Job [%v] has already been paused", nil), - ErrBDRRestrictedDDL: mysql.Message("The operation is not allowed while the bdr role of this cluster is set to %s.", nil), + ErrCannotPauseDDLJob: Message("Job [%v] can't be paused: %s", nil), + ErrCannotResumeDDLJob: Message("Job [%v] can't be resumed: %s", nil), + ErrPausedDDLJob: Message("Job [%v] has already been paused", nil), + ErrBDRRestrictedDDL: Message("The operation is not allowed while the bdr role of this cluster is set to %s.", nil), - ErrGlobalIndexNotExplicitlySet: mysql.Message("Global Index is needed for index '%-.192s', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption", nil), + ErrGlobalIndexNotExplicitlySet: Message("Global Index is needed for index '%-.192s', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption", nil), - ErrWarnGlobalIndexNeedManuallyAnalyze: mysql.Message("Auto analyze is not effective for index '%-.192s', need analyze manually", nil), + ErrWarnGlobalIndexNeedManuallyAnalyze: Message("Auto analyze is not effective for index '%-.192s', need analyze manually", nil), } diff --git a/pkg/executor/importer/kv_encode.go b/pkg/executor/importer/kv_encode.go index a1c908ad0d4bf..39e53a527fe4d 100644 --- a/pkg/executor/importer/kv_encode.go +++ b/pkg/executor/importer/kv_encode.go @@ -78,7 +78,7 @@ func NewTableKVEncoder( func (en *tableKVEncoder) Encode(row []types.Datum, rowID int64) (*kv.Pairs, error) { // we ignore warnings when encoding rows now, but warnings uses the same memory as parser, since the input // row []types.Datum share the same underlying buf, and when doing CastValue, we're using hack.String/hack.Slice. - // when generating error such as mysql.ErrDataOutOfRange, the data will be part of the error, causing the buf + // when generating error such as errno.ErrDataOutOfRange, the data will be part of the error, causing the buf // unable to release. So we truncate the warnings here. defer en.TruncateWarns() record, err := en.parserData2TableData(row, rowID) diff --git a/pkg/executor/insert.go b/pkg/executor/insert.go index f6fc14d49c840..7796761483a9b 100644 --- a/pkg/executor/insert.go +++ b/pkg/executor/insert.go @@ -565,7 +565,7 @@ func (e *InsertExec) setMessage() { numDuplicates = stmtCtx.UpdatedRows() } } - msg := fmt.Sprintf(mysql.MySQLErrName[mysql.ErrInsertInfo].Raw, numRecords, numDuplicates, numWarnings) + msg := fmt.Sprintf(errno.MySQLErrName[errno.ErrInsertInfo].Raw, numRecords, numDuplicates, numWarnings) stmtCtx.SetMessage(msg) } } diff --git a/pkg/executor/internal/querywatch/query_watch_test.go b/pkg/executor/internal/querywatch/query_watch_test.go index ead75f0f63877..39026c2d389bb 100644 --- a/pkg/executor/internal/querywatch/query_watch_test.go +++ b/pkg/executor/internal/querywatch/query_watch_test.go @@ -21,7 +21,7 @@ import ( "time" "github.com/pingcap/failpoint" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/sessionctx/variable" "github.com/pingcap/tidb/pkg/testkit" @@ -129,13 +129,13 @@ func TestQueryWatch(t *testing.T) { require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/store/copr/sleepCoprRequest")) tk.MustExec("alter resource group default QUERY_LIMIT=(EXEC_ELAPSED='50ms' ACTION=DRYRUN)") - tk.MustGetErrCode("select * from t3", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select * from t3", errno.ErrResourceGroupQueryRunawayQuarantine) tk.MustQuery("select * from t2").Check(testkit.Rows("1")) tk.MustQuery("select /*+ resource_group(rg1) */ * from t1").Check(testkit.Rows("1")) tk.MustExec("SET RESOURCE GROUP rg1") // hit and schema will affect sql digest - tk.MustGetErrCode("select * from test.t2", mysql.ErrResourceGroupQueryRunawayQuarantine) - tk.MustGetErrCode("select /*+ resource_group(rg2) */ * from t3", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select * from test.t2", errno.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg2) */ * from t3", errno.ErrResourceGroupQueryRunawayQuarantine) tk.MustExec("alter resource group rg1 RU_PER_SEC=1000 QUERY_LIMIT=()") tk.EventuallyMustQueryAndCheck("select SQL_NO_CACHE resource_group_name, watch_text, action, watch from information_schema.runaway_watches order by id", nil, @@ -166,7 +166,7 @@ func TestQueryWatch(t *testing.T) { require.NoError(t, err) require.Nil(t, rs) time.Sleep(1 * time.Second) - tk.MustGetErrCode("select * from test.t1", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select * from test.t1", errno.ErrResourceGroupQueryRunawayQuarantine) } func TestQueryWatchIssue56897(t *testing.T) { diff --git a/pkg/executor/load_data.go b/pkg/executor/load_data.go index e034098518532..4c629bbe96d09 100644 --- a/pkg/executor/load_data.go +++ b/pkg/executor/load_data.go @@ -26,6 +26,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/br/pkg/storage" "github.com/pingcap/tidb/pkg/errctx" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor/importer" "github.com/pingcap/tidb/pkg/executor/internal/exec" "github.com/pingcap/tidb/pkg/expression" @@ -276,7 +277,7 @@ func (e *LoadDataWorker) setResult(colAssignExprWarnings []contextutil.SQLWarn) numWarnings = math.MaxUint16 } - msg := fmt.Sprintf(mysql.MySQLErrName[mysql.ErrLoadInfo].Raw, numRecords, numDeletes, numSkipped, numWarnings) + msg := fmt.Sprintf(errno.MySQLErrName[errno.ErrLoadInfo].Raw, numRecords, numDeletes, numSkipped, numWarnings) warns := make([]contextutil.SQLWarn, numWarnings) n := copy(warns, stmtCtx.GetWarnings()) for i := 0; i < int(numRecords) && n < len(warns); i++ { diff --git a/pkg/executor/replace.go b/pkg/executor/replace.go index 3b9e9b4101d34..6db5fe01c695e 100644 --- a/pkg/executor/replace.go +++ b/pkg/executor/replace.go @@ -20,10 +20,10 @@ import ( "runtime/trace" "time" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor/internal/exec" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/meta/autoid" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/table" "github.com/pingcap/tidb/pkg/table/tables" "github.com/pingcap/tidb/pkg/tablecodec" @@ -213,7 +213,7 @@ func (e *ReplaceExec) setMessage() { if e.SelectExec != nil || numRecords > 1 { numWarnings := stmtCtx.WarningCount() numDuplicates := stmtCtx.AffectedRows() - numRecords - msg := fmt.Sprintf(mysql.MySQLErrName[mysql.ErrInsertInfo].Raw, numRecords, numDuplicates, numWarnings) + msg := fmt.Sprintf(errno.MySQLErrName[errno.ErrInsertInfo].Raw, numRecords, numDuplicates, numWarnings) stmtCtx.SetMessage(msg) } } diff --git a/pkg/executor/set_test.go b/pkg/executor/set_test.go index f4111f6cd8129..bbeebd373ead6 100644 --- a/pkg/executor/set_test.go +++ b/pkg/executor/set_test.go @@ -537,10 +537,10 @@ func TestSetVar(t *testing.T) { varList := []string{"character_set_server", "character_set_client", "character_set_filesystem", "character_set_database"} for _, v := range varList { - tk.MustGetErrCode(fmt.Sprintf("SET @@global.%s = @global_start_value;", v), mysql.ErrWrongValueForVar) - tk.MustGetErrCode(fmt.Sprintf("SET @@%s = @global_start_value;", v), mysql.ErrWrongValueForVar) - tk.MustGetErrCode(fmt.Sprintf("SET @@%s = NULL;", v), mysql.ErrWrongValueForVar) - tk.MustGetErrCode(fmt.Sprintf("SET @@%s = \"\";", v), mysql.ErrWrongValueForVar) + tk.MustGetErrCode(fmt.Sprintf("SET @@global.%s = @global_start_value;", v), errno.ErrWrongValueForVar) + tk.MustGetErrCode(fmt.Sprintf("SET @@%s = @global_start_value;", v), errno.ErrWrongValueForVar) + tk.MustGetErrCode(fmt.Sprintf("SET @@%s = NULL;", v), errno.ErrWrongValueForVar) + tk.MustGetErrCode(fmt.Sprintf("SET @@%s = \"\";", v), errno.ErrWrongValueForVar) tk.MustGetErrMsg(fmt.Sprintf("SET @@%s = \"somecharset\";", v), "Unknown charset somecharset") // we do not support set character_set_xxx or collation_xxx to a collation id. tk.MustGetErrMsg(fmt.Sprintf("SET @@global.%s = 46;", v), "Unknown charset 46") @@ -804,8 +804,8 @@ func TestSetVar(t *testing.T) { tk.MustQuery("select @@session.tidb_enable_analyze_snapshot").Check(testkit.Rows("0")) // test variables `init_connect' - tk.MustGetErrCode("set global init_connect = '-1'", mysql.ErrWrongTypeForVar) - tk.MustGetErrCode("set global init_connect = 'invalidstring'", mysql.ErrWrongTypeForVar) + tk.MustGetErrCode("set global init_connect = '-1'", errno.ErrWrongTypeForVar) + tk.MustGetErrCode("set global init_connect = 'invalidstring'", errno.ErrWrongTypeForVar) tk.MustExec("set global init_connect = 'select now(); select timestamp()'") // test variable 'tidb_session_plan_cache_size' diff --git a/pkg/executor/show.go b/pkg/executor/show.go index d2931285aa1a8..6990a58088f95 100644 --- a/pkg/executor/show.go +++ b/pkg/executor/show.go @@ -35,6 +35,7 @@ import ( "github.com/pingcap/tidb/pkg/disttask/importinto" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/domain/infosync" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor/importer" "github.com/pingcap/tidb/pkg/executor/internal/exec" "github.com/pingcap/tidb/pkg/expression" @@ -1986,7 +1987,7 @@ func (e *ShowExec) fetchShowWarnings(errOnly bool) error { if warn != nil { err = warn.Error() } - e.appendRow([]any{w.Level, int64(mysql.ErrUnknown), err}) + e.appendRow([]any{w.Level, int64(errno.ErrUnknown), err}) } } return nil diff --git a/pkg/executor/test/admintest/admin_test.go b/pkg/executor/test/admintest/admin_test.go index dda1139c486f7..c049c8cf1547f 100644 --- a/pkg/executor/test/admintest/admin_test.go +++ b/pkg/executor/test/admintest/admin_test.go @@ -27,7 +27,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/ddl" "github.com/pingcap/tidb/pkg/domain" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/meta/model" @@ -332,8 +332,8 @@ func TestClusteredIndexAdminRecoverIndex(t *testing.T) { require.NoError(t, err) err = txn.Commit(context.Background()) require.NoError(t, err) - tk.MustGetErrCode("admin check table t", mysql.ErrDataInconsistent) - tk.MustGetErrCode("admin check index t idx", mysql.ErrDataInconsistent) + tk.MustGetErrCode("admin check table t", errno.ErrDataInconsistent) + tk.MustGetErrCode("admin check index t idx", errno.ErrDataInconsistent) tk.MustQuery("SELECT COUNT(*) FROM t USE INDEX(idx)").Check(testkit.Rows("2")) tk.MustQuery("admin recover index t idx").Check(testkit.Rows("1 3")) @@ -349,8 +349,8 @@ func TestClusteredIndexAdminRecoverIndex(t *testing.T) { require.NoError(t, err) err = txn.Commit(context.Background()) require.NoError(t, err) - tk.MustGetErrCode("admin check table t", mysql.ErrDataInconsistent) - tk.MustGetErrCode("admin check index t idx1", mysql.ErrDataInconsistent) + tk.MustGetErrCode("admin check table t", errno.ErrDataInconsistent) + tk.MustGetErrCode("admin check index t idx1", errno.ErrDataInconsistent) tk.MustQuery("SELECT COUNT(*) FROM t USE INDEX(idx1)").Check(testkit.Rows("2")) tk.MustQuery("admin recover index t idx1").Check(testkit.Rows("1 3")) diff --git a/pkg/executor/test/executor/executor_test.go b/pkg/executor/test/executor/executor_test.go index 8d53c1a212da2..17712f090ab66 100644 --- a/pkg/executor/test/executor/executor_test.go +++ b/pkg/executor/test/executor/executor_test.go @@ -36,6 +36,7 @@ import ( "github.com/pingcap/tidb/pkg/ddl" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/domain/infosync" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor" "github.com/pingcap/tidb/pkg/executor/internal/exec" "github.com/pingcap/tidb/pkg/expression" @@ -1775,12 +1776,12 @@ func TestUnion2(t *testing.T) { err := tk.ExecToErr("select 1 from (select a from t limit 1 union all select a from t limit 1) tmp") require.Error(t, err) terr := errors.Cause(err).(*terror.Error) - require.Equal(t, errors.ErrCode(mysql.ErrWrongUsage), terr.Code()) + require.Equal(t, errors.ErrCode(errno.ErrWrongUsage), terr.Code()) err = tk.ExecToErr("select 1 from (select a from t order by a union all select a from t limit 1) tmp") require.Error(t, err) terr = errors.Cause(err).(*terror.Error) - require.Equal(t, errors.ErrCode(mysql.ErrWrongUsage), terr.Code()) + require.Equal(t, errors.ErrCode(errno.ErrWrongUsage), terr.Code()) tk.MustGetDBError("(select a from t order by a) union all select a from t limit 1 union all select a from t limit 1", plannererrors.ErrWrongUsage) diff --git a/pkg/executor/test/simpletest/simple_test.go b/pkg/executor/test/simpletest/simple_test.go index c9e45f5013cd7..bc38bdc85aa5d 100644 --- a/pkg/executor/test/simpletest/simple_test.go +++ b/pkg/executor/test/simpletest/simple_test.go @@ -22,9 +22,9 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/tidb/pkg/config" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/auth" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/server" "github.com/pingcap/tidb/pkg/session" @@ -247,7 +247,7 @@ func TestUser(t *testing.T) { // Create duplicate user without IfNotExists will cause error. createUserSQL = `CREATE USER 'test'@'localhost' IDENTIFIED BY '123';` - tk.MustGetErrCode(createUserSQL, mysql.ErrCannotUser) + tk.MustGetErrCode(createUserSQL, errno.ErrCannotUser) createUserSQL = `CREATE USER IF NOT EXISTS 'test'@'localhost' IDENTIFIED BY '123';` tk.MustExec(createUserSQL) tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Note|3163|User 'test'@'localhost' already exists.")) @@ -293,9 +293,9 @@ func TestUser(t *testing.T) { result = tk.MustQuery(`SELECT authentication_string FROM mysql.User WHERE User="test1" and Host="localhost"`) result.Check(testkit.Rows(auth.EncodePassword("111"))) alterUserSQL = `ALTER USER 'test_not_exist'@'localhost' IDENTIFIED BY '111';` - tk.MustGetErrCode(alterUserSQL, mysql.ErrCannotUser) + tk.MustGetErrCode(alterUserSQL, errno.ErrCannotUser) alterUserSQL = `ALTER USER 'test1'@'localhost' IDENTIFIED BY '222', 'test_not_exist'@'localhost' IDENTIFIED BY '111';` - tk.MustGetErrCode(alterUserSQL, mysql.ErrCannotUser) + tk.MustGetErrCode(alterUserSQL, errno.ErrCannotUser) result = tk.MustQuery(`SELECT authentication_string FROM mysql.User WHERE User="test1" and Host="localhost"`) result.Check(testkit.Rows(auth.EncodePassword("111"))) alterUserSQL = `ALTER USER 'test4'@'localhost' IDENTIFIED WITH 'auth_socket';` @@ -340,7 +340,7 @@ func TestUser(t *testing.T) { createUserSQL = `CREATE USER 'test1'@'localhost', 'test3'@'localhost';` tk.MustExec(createUserSQL) dropUserSQL = `DROP USER 'test1'@'localhost', 'test2'@'localhost', 'test3'@'localhost';` - tk.MustGetErrCode(dropUserSQL, mysql.ErrCannotUser) + tk.MustGetErrCode(dropUserSQL, errno.ErrCannotUser) dropUserSQL = `DROP USER 'test3'@'localhost';` tk.MustExec(dropUserSQL) dropUserSQL = `DROP USER 'test1'@'localhost';` diff --git a/pkg/executor/update.go b/pkg/executor/update.go index 8e237e8a21286..381eb3911461f 100644 --- a/pkg/executor/update.go +++ b/pkg/executor/update.go @@ -21,6 +21,7 @@ import ( "runtime/trace" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/executor/internal/exec" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/kv" @@ -566,7 +567,7 @@ func (e *UpdateExec) setMessage() { numMatched := e.matched numChanged := stmtCtx.UpdatedRows() numWarnings := stmtCtx.WarningCount() - msg := fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUpdateInfo].Raw, numMatched, numChanged, numWarnings) + msg := fmt.Sprintf(errno.MySQLErrName[errno.ErrUpdateInfo].Raw, numMatched, numChanged, numWarnings) stmtCtx.SetMessage(msg) } diff --git a/pkg/expression/builtin_miscellaneous.go b/pkg/expression/builtin_miscellaneous.go index 5dce7287b7180..cb44a687efad5 100644 --- a/pkg/expression/builtin_miscellaneous.go +++ b/pkg/expression/builtin_miscellaneous.go @@ -27,6 +27,7 @@ import ( "github.com/google/uuid" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/expression/expropt" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" @@ -251,9 +252,9 @@ func (b *builtinLockSig) evalInt(ctx EvalContext, row chunk.Row) (int64, bool, e if err != nil { if terr, ok := errors.Cause(err).(*terror.Error); ok { switch terr.Code() { - case mysql.ErrLockWaitTimeout: + case errno.ErrLockWaitTimeout: return 0, false, nil // Another user has the lock - case mysql.ErrLockDeadlock: + case errno.ErrLockDeadlock: // Currently this code is not reachable because each Advisory Lock // Uses a separate session. Deadlock detection does not work across // independent sessions. diff --git a/pkg/expression/errors.go b/pkg/expression/errors.go index 55e2c6b16fd22..1e48d7a43e70a 100644 --- a/pkg/expression/errors.go +++ b/pkg/expression/errors.go @@ -16,8 +16,7 @@ package expression import ( "github.com/pingcap/errors" - mysql "github.com/pingcap/tidb/pkg/errno" - pmysql "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/types" "github.com/pingcap/tidb/pkg/util/dbterror" ) @@ -25,46 +24,46 @@ import ( // Error instances. var ( // All the exported errors are defined here: - ErrIncorrectParameterCount = dbterror.ClassExpression.NewStd(mysql.ErrWrongParamcountToNativeFct) - ErrDivisionByZero = dbterror.ClassExpression.NewStd(mysql.ErrDivisionByZero) - ErrRegexp = dbterror.ClassExpression.NewStd(mysql.ErrRegexp) - ErrOperandColumns = dbterror.ClassExpression.NewStd(mysql.ErrOperandColumns) - ErrCutValueGroupConcat = dbterror.ClassExpression.NewStd(mysql.ErrCutValueGroupConcat) - ErrFunctionsNoopImpl = dbterror.ClassExpression.NewStdErr(mysql.ErrNotSupportedYet, pmysql.Message("function %s has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions", nil)) - ErrInvalidArgumentForLogarithm = dbterror.ClassExpression.NewStd(mysql.ErrInvalidArgumentForLogarithm) - ErrIncorrectType = dbterror.ClassExpression.NewStd(mysql.ErrIncorrectType) - ErrInvalidTypeForJSON = dbterror.ClassExpression.NewStd(mysql.ErrInvalidTypeForJSON) - ErrInvalidTableSample = dbterror.ClassExpression.NewStd(mysql.ErrInvalidTableSample) - ErrNotSupportedYet = dbterror.ClassExpression.NewStd(mysql.ErrNotSupportedYet) - ErrInvalidJSONForFuncIndex = dbterror.ClassExpression.NewStd(mysql.ErrInvalidJSONValueForFuncIndex) - ErrDataOutOfRangeFuncIndex = dbterror.ClassExpression.NewStd(mysql.ErrDataOutOfRangeFunctionalIndex) - ErrFuncIndexDataIsTooLong = dbterror.ClassExpression.NewStd(mysql.ErrFunctionalIndexDataIsTooLong) - ErrFunctionNotExists = dbterror.ClassExpression.NewStd(mysql.ErrSpDoesNotExist) + ErrIncorrectParameterCount = dbterror.ClassExpression.NewStd(errno.ErrWrongParamcountToNativeFct) + ErrDivisionByZero = dbterror.ClassExpression.NewStd(errno.ErrDivisionByZero) + ErrRegexp = dbterror.ClassExpression.NewStd(errno.ErrRegexp) + ErrOperandColumns = dbterror.ClassExpression.NewStd(errno.ErrOperandColumns) + ErrCutValueGroupConcat = dbterror.ClassExpression.NewStd(errno.ErrCutValueGroupConcat) + ErrFunctionsNoopImpl = dbterror.ClassExpression.NewStdErr(errno.ErrNotSupportedYet, errno.Message("function %s has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions", nil)) + ErrInvalidArgumentForLogarithm = dbterror.ClassExpression.NewStd(errno.ErrInvalidArgumentForLogarithm) + ErrIncorrectType = dbterror.ClassExpression.NewStd(errno.ErrIncorrectType) + ErrInvalidTypeForJSON = dbterror.ClassExpression.NewStd(errno.ErrInvalidTypeForJSON) + ErrInvalidTableSample = dbterror.ClassExpression.NewStd(errno.ErrInvalidTableSample) + ErrNotSupportedYet = dbterror.ClassExpression.NewStd(errno.ErrNotSupportedYet) + ErrInvalidJSONForFuncIndex = dbterror.ClassExpression.NewStd(errno.ErrInvalidJSONValueForFuncIndex) + ErrDataOutOfRangeFuncIndex = dbterror.ClassExpression.NewStd(errno.ErrDataOutOfRangeFunctionalIndex) + ErrFuncIndexDataIsTooLong = dbterror.ClassExpression.NewStd(errno.ErrFunctionalIndexDataIsTooLong) + ErrFunctionNotExists = dbterror.ClassExpression.NewStd(errno.ErrSpDoesNotExist) // All the un-exported errors are defined here: - errZlibZData = dbterror.ClassExpression.NewStd(mysql.ErrZlibZData) - errZlibZBuf = dbterror.ClassExpression.NewStd(mysql.ErrZlibZBuf) - errIncorrectArgs = dbterror.ClassExpression.NewStd(mysql.ErrWrongArguments) - errUnknownCharacterSet = dbterror.ClassExpression.NewStd(mysql.ErrUnknownCharacterSet) - errDefaultValue = dbterror.ClassExpression.NewStdErr(mysql.ErrInvalidDefault, pmysql.Message("invalid default value", nil)) - errDeprecatedSyntaxNoReplacement = dbterror.ClassExpression.NewStd(mysql.ErrWarnDeprecatedSyntaxNoReplacement) - errWarnAllowedPacketOverflowed = dbterror.ClassExpression.NewStd(mysql.ErrWarnAllowedPacketOverflowed) - errWarnOptionIgnored = dbterror.ClassExpression.NewStd(mysql.WarnOptionIgnored) - errTruncatedWrongValue = dbterror.ClassExpression.NewStd(mysql.ErrTruncatedWrongValue) - errUnknownLocale = dbterror.ClassExpression.NewStd(mysql.ErrUnknownLocale) - errNonUniq = dbterror.ClassExpression.NewStd(mysql.ErrNonUniq) - errWrongValueForType = dbterror.ClassExpression.NewStd(mysql.ErrWrongValueForType) - errUnknown = dbterror.ClassExpression.NewStd(mysql.ErrUnknown) - errSpecificAccessDenied = dbterror.ClassExpression.NewStd(mysql.ErrSpecificAccessDenied) - errUserLockDeadlock = dbterror.ClassExpression.NewStd(mysql.ErrUserLockDeadlock) - errUserLockWrongName = dbterror.ClassExpression.NewStd(mysql.ErrUserLockWrongName) - errJSONInBooleanContext = dbterror.ClassExpression.NewStd(mysql.ErrJSONInBooleanContext) - errBadNull = dbterror.ClassExpression.NewStd(mysql.ErrBadNull) + errZlibZData = dbterror.ClassExpression.NewStd(errno.ErrZlibZData) + errZlibZBuf = dbterror.ClassExpression.NewStd(errno.ErrZlibZBuf) + errIncorrectArgs = dbterror.ClassExpression.NewStd(errno.ErrWrongArguments) + errUnknownCharacterSet = dbterror.ClassExpression.NewStd(errno.ErrUnknownCharacterSet) + errDefaultValue = dbterror.ClassExpression.NewStdErr(errno.ErrInvalidDefault, errno.Message("invalid default value", nil)) + errDeprecatedSyntaxNoReplacement = dbterror.ClassExpression.NewStd(errno.ErrWarnDeprecatedSyntaxNoReplacement) + errWarnAllowedPacketOverflowed = dbterror.ClassExpression.NewStd(errno.ErrWarnAllowedPacketOverflowed) + errWarnOptionIgnored = dbterror.ClassExpression.NewStd(errno.WarnOptionIgnored) + errTruncatedWrongValue = dbterror.ClassExpression.NewStd(errno.ErrTruncatedWrongValue) + errUnknownLocale = dbterror.ClassExpression.NewStd(errno.ErrUnknownLocale) + errNonUniq = dbterror.ClassExpression.NewStd(errno.ErrNonUniq) + errWrongValueForType = dbterror.ClassExpression.NewStd(errno.ErrWrongValueForType) + errUnknown = dbterror.ClassExpression.NewStd(errno.ErrUnknown) + errSpecificAccessDenied = dbterror.ClassExpression.NewStd(errno.ErrSpecificAccessDenied) + errUserLockDeadlock = dbterror.ClassExpression.NewStd(errno.ErrUserLockDeadlock) + errUserLockWrongName = dbterror.ClassExpression.NewStd(errno.ErrUserLockWrongName) + errJSONInBooleanContext = dbterror.ClassExpression.NewStd(errno.ErrJSONInBooleanContext) + errBadNull = dbterror.ClassExpression.NewStd(errno.ErrBadNull) // Sequence usage privilege check. - errSequenceAccessDenied = dbterror.ClassExpression.NewStd(mysql.ErrTableaccessDenied) - errUnsupportedJSONComparison = dbterror.ClassExpression.NewStdErr(mysql.ErrNotSupportedYet, - pmysql.Message("comparison of JSON in the LEAST and GREATEST operators", nil)) + errSequenceAccessDenied = dbterror.ClassExpression.NewStd(errno.ErrTableaccessDenied) + errUnsupportedJSONComparison = dbterror.ClassExpression.NewStdErr(errno.ErrNotSupportedYet, + errno.Message("comparison of JSON in the LEAST and GREATEST operators", nil)) ) // handleInvalidTimeError reports error or warning depend on the context. diff --git a/pkg/expression/integration_test/integration_test.go b/pkg/expression/integration_test/integration_test.go index 941f6726e5054..592bd0a9e5fc7 100644 --- a/pkg/expression/integration_test/integration_test.go +++ b/pkg/expression/integration_test/integration_test.go @@ -1064,7 +1064,7 @@ func TestGetLock(t *testing.T) { err := tk.ExecToErr("SELECT get_lock('testlock')") require.Error(t, err) terr := errors.Cause(err).(*terror.Error) - require.Equal(t, errors.ErrCode(mysql.ErrWrongParamcountToNativeFct), terr.Code()) + require.Equal(t, errors.ErrCode(errno.ErrWrongParamcountToNativeFct), terr.Code()) // 0 timeout = immediate // Negative timeout = convert to max value @@ -1952,7 +1952,7 @@ func TestBuiltinFuncJSONMergePatch_InColumn(t *testing.T) { {[2]any{`{"a":1}`, "null"}, `null`, true, 0}, // Invalid json text - {[2]any{`{"a":1}`, `[1]}`}, nil, false, mysql.ErrInvalidJSONText}, + {[2]any{`{"a":1}`, `[1]}`}, nil, false, errno.ErrInvalidJSONText}, } tk.MustExec(`use test;`) @@ -2069,9 +2069,9 @@ func TestBuiltinFuncJSONMergePatch_InExpression(t *testing.T) { {[]any{`{"a":"foo"}`, `{"d":1}`, `{"a":{"bb":{"ccc":null}}}`}, `{"a":{"bb":{}},"d":1}`, true, 0}, // Invalid json text - {[]any{`{"a":1}`, `[1]}`}, nil, false, mysql.ErrInvalidJSONText}, - {[]any{`{{"a":1}`, `[1]`, `null`}, nil, false, mysql.ErrInvalidJSONText}, - {[]any{`{"a":1}`, `jjj`, `null`}, nil, false, mysql.ErrInvalidJSONText}, + {[]any{`{"a":1}`, `[1]}`}, nil, false, errno.ErrInvalidJSONText}, + {[]any{`{{"a":1}`, `[1]`, `null`}, nil, false, errno.ErrInvalidJSONText}, + {[]any{`{"a":1}`, `jjj`, `null`}, nil, false, errno.ErrInvalidJSONText}, } for _, tt := range tests { diff --git a/pkg/infoschema/error.go b/pkg/infoschema/error.go index 0dacfca35da00..854f3fc0077c5 100644 --- a/pkg/infoschema/error.go +++ b/pkg/infoschema/error.go @@ -15,97 +15,97 @@ package infoschema import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) var ( // ErrDatabaseExists returns for database already exists. - ErrDatabaseExists = dbterror.ClassSchema.NewStd(mysql.ErrDBCreateExists) + ErrDatabaseExists = dbterror.ClassSchema.NewStd(errno.ErrDBCreateExists) // ErrDatabaseDropExists returns for dropping a non-existent database. - ErrDatabaseDropExists = dbterror.ClassSchema.NewStd(mysql.ErrDBDropExists) + ErrDatabaseDropExists = dbterror.ClassSchema.NewStd(errno.ErrDBDropExists) // ErrAccessDenied return when the user doesn't have the permission to access the table. - ErrAccessDenied = dbterror.ClassSchema.NewStd(mysql.ErrAccessDenied) + ErrAccessDenied = dbterror.ClassSchema.NewStd(errno.ErrAccessDenied) // ErrDatabaseNotExists returns for database not exists. - ErrDatabaseNotExists = dbterror.ClassSchema.NewStd(mysql.ErrBadDB) + ErrDatabaseNotExists = dbterror.ClassSchema.NewStd(errno.ErrBadDB) // ErrPlacementPolicyExists returns for placement_policy policy already exists. - ErrPlacementPolicyExists = dbterror.ClassSchema.NewStd(mysql.ErrPlacementPolicyExists) + ErrPlacementPolicyExists = dbterror.ClassSchema.NewStd(errno.ErrPlacementPolicyExists) // ErrPlacementPolicyNotExists return for placement_policy policy not exists. - ErrPlacementPolicyNotExists = dbterror.ClassSchema.NewStd(mysql.ErrPlacementPolicyNotExists) + ErrPlacementPolicyNotExists = dbterror.ClassSchema.NewStd(errno.ErrPlacementPolicyNotExists) // ErrResourceGroupExists return for resource group already exists. - ErrResourceGroupExists = dbterror.ClassSchema.NewStd(mysql.ErrResourceGroupExists) + ErrResourceGroupExists = dbterror.ClassSchema.NewStd(errno.ErrResourceGroupExists) // ErrResourceGroupNotExists return for resource group not exists. - ErrResourceGroupNotExists = dbterror.ClassSchema.NewStd(mysql.ErrResourceGroupNotExists) + ErrResourceGroupNotExists = dbterror.ClassSchema.NewStd(errno.ErrResourceGroupNotExists) // ErrResourceGroupInvalidBackgroundTaskName return for unknown resource group background task name. - ErrResourceGroupInvalidBackgroundTaskName = dbterror.ClassExecutor.NewStd(mysql.ErrResourceGroupInvalidBackgroundTaskName) + ErrResourceGroupInvalidBackgroundTaskName = dbterror.ClassExecutor.NewStd(errno.ErrResourceGroupInvalidBackgroundTaskName) // ErrResourceGroupInvalidForRole return for invalid resource group for role. - ErrResourceGroupInvalidForRole = dbterror.ClassSchema.NewStd(mysql.ErrResourceGroupInvalidForRole) + ErrResourceGroupInvalidForRole = dbterror.ClassSchema.NewStd(errno.ErrResourceGroupInvalidForRole) // ErrReservedSyntax for internal syntax. - ErrReservedSyntax = dbterror.ClassSchema.NewStd(mysql.ErrReservedSyntax) + ErrReservedSyntax = dbterror.ClassSchema.NewStd(errno.ErrReservedSyntax) // ErrTableExists returns for table already exists. - ErrTableExists = dbterror.ClassSchema.NewStd(mysql.ErrTableExists) + ErrTableExists = dbterror.ClassSchema.NewStd(errno.ErrTableExists) // ErrTableDropExists returns for dropping a non-existent table. - ErrTableDropExists = dbterror.ClassSchema.NewStd(mysql.ErrBadTable) + ErrTableDropExists = dbterror.ClassSchema.NewStd(errno.ErrBadTable) // ErrSequenceDropExists returns for dropping a non-exist sequence. - ErrSequenceDropExists = dbterror.ClassSchema.NewStd(mysql.ErrUnknownSequence) + ErrSequenceDropExists = dbterror.ClassSchema.NewStd(errno.ErrUnknownSequence) // ErrColumnNotExists returns for column not exists. - ErrColumnNotExists = dbterror.ClassSchema.NewStd(mysql.ErrBadField) + ErrColumnNotExists = dbterror.ClassSchema.NewStd(errno.ErrBadField) // ErrColumnExists returns for column already exists. - ErrColumnExists = dbterror.ClassSchema.NewStd(mysql.ErrDupFieldName) + ErrColumnExists = dbterror.ClassSchema.NewStd(errno.ErrDupFieldName) // ErrKeyNameDuplicate returns for index duplicate when rename index. - ErrKeyNameDuplicate = dbterror.ClassSchema.NewStd(mysql.ErrDupKeyName) + ErrKeyNameDuplicate = dbterror.ClassSchema.NewStd(errno.ErrDupKeyName) // ErrNonuniqTable returns when none unique tables errors. - ErrNonuniqTable = dbterror.ClassSchema.NewStd(mysql.ErrNonuniqTable) + ErrNonuniqTable = dbterror.ClassSchema.NewStd(errno.ErrNonuniqTable) // ErrMultiplePriKey returns for multiple primary keys. - ErrMultiplePriKey = dbterror.ClassSchema.NewStd(mysql.ErrMultiplePriKey) + ErrMultiplePriKey = dbterror.ClassSchema.NewStd(errno.ErrMultiplePriKey) // ErrTooManyKeyParts returns for too many key parts. - ErrTooManyKeyParts = dbterror.ClassSchema.NewStd(mysql.ErrTooManyKeyParts) + ErrTooManyKeyParts = dbterror.ClassSchema.NewStd(errno.ErrTooManyKeyParts) // ErrForeignKeyNotExists returns for foreign key not exists. - ErrForeignKeyNotExists = dbterror.ClassSchema.NewStd(mysql.ErrCantDropFieldOrKey) + ErrForeignKeyNotExists = dbterror.ClassSchema.NewStd(errno.ErrCantDropFieldOrKey) // ErrTableNotLockedForWrite returns for write tables when only hold the table read lock. - ErrTableNotLockedForWrite = dbterror.ClassSchema.NewStd(mysql.ErrTableNotLockedForWrite) + ErrTableNotLockedForWrite = dbterror.ClassSchema.NewStd(errno.ErrTableNotLockedForWrite) // ErrTableNotLocked returns when session has explicitly lock tables, then visit unlocked table will return this error. - ErrTableNotLocked = dbterror.ClassSchema.NewStd(mysql.ErrTableNotLocked) + ErrTableNotLocked = dbterror.ClassSchema.NewStd(errno.ErrTableNotLocked) // ErrTableNotExists returns for table not exists. - ErrTableNotExists = dbterror.ClassSchema.NewStd(mysql.ErrNoSuchTable) + ErrTableNotExists = dbterror.ClassSchema.NewStd(errno.ErrNoSuchTable) // ErrKeyNotExists returns for index not exists. - ErrKeyNotExists = dbterror.ClassSchema.NewStd(mysql.ErrKeyDoesNotExist) + ErrKeyNotExists = dbterror.ClassSchema.NewStd(errno.ErrKeyDoesNotExist) // ErrCannotAddForeign returns for foreign key exists. - ErrCannotAddForeign = dbterror.ClassSchema.NewStd(mysql.ErrCannotAddForeign) + ErrCannotAddForeign = dbterror.ClassSchema.NewStd(errno.ErrCannotAddForeign) // ErrForeignKeyOnPartitioned returns for foreign key on partition table. - ErrForeignKeyOnPartitioned = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyOnPartitioned) + ErrForeignKeyOnPartitioned = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyOnPartitioned) // ErrForeignKeyNotMatch returns for foreign key not match. - ErrForeignKeyNotMatch = dbterror.ClassSchema.NewStd(mysql.ErrWrongFkDef) + ErrForeignKeyNotMatch = dbterror.ClassSchema.NewStd(errno.ErrWrongFkDef) // ErrIndexExists returns for index already exists. - ErrIndexExists = dbterror.ClassSchema.NewStd(mysql.ErrDupIndex) + ErrIndexExists = dbterror.ClassSchema.NewStd(errno.ErrDupIndex) // ErrUserDropExists returns for dropping a non-existent user. - ErrUserDropExists = dbterror.ClassSchema.NewStd(mysql.ErrBadUser) + ErrUserDropExists = dbterror.ClassSchema.NewStd(errno.ErrBadUser) // ErrUserAlreadyExists return for creating a existent user. - ErrUserAlreadyExists = dbterror.ClassSchema.NewStd(mysql.ErrUserAlreadyExists) + ErrUserAlreadyExists = dbterror.ClassSchema.NewStd(errno.ErrUserAlreadyExists) // ErrTableLocked returns when the table was locked by other session. - ErrTableLocked = dbterror.ClassSchema.NewStd(mysql.ErrTableLocked) + ErrTableLocked = dbterror.ClassSchema.NewStd(errno.ErrTableLocked) // ErrWrongObject returns when the table/view/sequence is not the expected object. - ErrWrongObject = dbterror.ClassSchema.NewStd(mysql.ErrWrongObject) + ErrWrongObject = dbterror.ClassSchema.NewStd(errno.ErrWrongObject) // ErrAdminCheckTable returns when the check table in temporary mode. - ErrAdminCheckTable = dbterror.ClassSchema.NewStd(mysql.ErrAdminCheckTable) + ErrAdminCheckTable = dbterror.ClassSchema.NewStd(errno.ErrAdminCheckTable) // ErrEmptyDatabase returns when the database is unexpectedly empty. - ErrEmptyDatabase = dbterror.ClassSchema.NewStd(mysql.ErrBadDB) + ErrEmptyDatabase = dbterror.ClassSchema.NewStd(errno.ErrBadDB) // ErrForbidSchemaChange returns when the schema change is illegal - ErrForbidSchemaChange = dbterror.ClassSchema.NewStd(mysql.ErrForbidSchemaChange) + ErrForbidSchemaChange = dbterror.ClassSchema.NewStd(errno.ErrForbidSchemaChange) // ErrTableWithoutPrimaryKey returns when there is no primary key on a table and sql_require_primary_key is set - ErrTableWithoutPrimaryKey = dbterror.ClassSchema.NewStd(mysql.ErrTableWithoutPrimaryKey) + ErrTableWithoutPrimaryKey = dbterror.ClassSchema.NewStd(errno.ErrTableWithoutPrimaryKey) // ErrForeignKeyCannotUseVirtualColumn returns when foreign key refer virtual generated column. - ErrForeignKeyCannotUseVirtualColumn = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyCannotUseVirtualColumn) + ErrForeignKeyCannotUseVirtualColumn = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyCannotUseVirtualColumn) // ErrForeignKeyCannotOpenParent returns when foreign key refer table not exists. - ErrForeignKeyCannotOpenParent = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyCannotOpenParent) + ErrForeignKeyCannotOpenParent = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyCannotOpenParent) // ErrForeignKeyNoColumnInParent returns when foreign key refer columns don't exist in parent table. - ErrForeignKeyNoColumnInParent = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyNoColumnInParent) + ErrForeignKeyNoColumnInParent = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyNoColumnInParent) // ErrForeignKeyNoIndexInParent returns when foreign key refer columns don't have related index in parent table. - ErrForeignKeyNoIndexInParent = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyNoIndexInParent) + ErrForeignKeyNoIndexInParent = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyNoIndexInParent) // ErrForeignKeyColumnNotNull returns when foreign key with SET NULL constrain and the related column has not null. - ErrForeignKeyColumnNotNull = dbterror.ClassSchema.NewStd(mysql.ErrForeignKeyColumnNotNull) + ErrForeignKeyColumnNotNull = dbterror.ClassSchema.NewStd(errno.ErrForeignKeyColumnNotNull) // ErrResourceGroupSupportDisabled returns for resource group feature is disabled - ErrResourceGroupSupportDisabled = dbterror.ClassSchema.NewStd(mysql.ErrResourceGroupSupportDisabled) + ErrResourceGroupSupportDisabled = dbterror.ClassSchema.NewStd(errno.ErrResourceGroupSupportDisabled) // ErrCheckConstraintDupName returns for duplicate constraint names. - ErrCheckConstraintDupName = dbterror.ClassSchema.NewStd(mysql.ErrCheckConstraintDupName) + ErrCheckConstraintDupName = dbterror.ClassSchema.NewStd(errno.ErrCheckConstraintDupName) ) diff --git a/pkg/kv/BUILD.bazel b/pkg/kv/BUILD.bazel index 196b70fc3203b..83ff3817fbb6a 100644 --- a/pkg/kv/BUILD.bazel +++ b/pkg/kv/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//pkg/errno", "//pkg/meta/model", "//pkg/parser", - "//pkg/parser/mysql", "//pkg/parser/terror", "//pkg/resourcegroup", "//pkg/types", diff --git a/pkg/kv/error.go b/pkg/kv/error.go index b09326477bee3..7e6d933d1f785 100644 --- a/pkg/kv/error.go +++ b/pkg/kv/error.go @@ -17,8 +17,7 @@ package kv import ( "strings" - mysql "github.com/pingcap/tidb/pkg/errno" - pmysql "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) @@ -28,52 +27,52 @@ const TxnRetryableMark = "[try again later]" var ( // ErrNotExist is used when try to get an entry with an unexist key from KV store. - ErrNotExist = dbterror.ClassKV.NewStd(mysql.ErrNotExist) + ErrNotExist = dbterror.ClassKV.NewStd(errno.ErrNotExist) // ErrTxnRetryable is used when KV store occurs retryable error which SQL layer can safely retry the transaction. // When using TiKV as the storage node, the error is returned ONLY when lock not found (txnLockNotFound) in Commit, // subject to change it in the future. ErrTxnRetryable = dbterror.ClassKV.NewStdErr( - mysql.ErrTxnRetryable, - pmysql.Message( - mysql.MySQLErrName[mysql.ErrTxnRetryable].Raw+TxnRetryableMark, - mysql.MySQLErrName[mysql.ErrTxnRetryable].RedactArgPos, + errno.ErrTxnRetryable, + errno.Message( + errno.MySQLErrName[errno.ErrTxnRetryable].Raw+TxnRetryableMark, + errno.MySQLErrName[errno.ErrTxnRetryable].RedactArgPos, ), ) // ErrCannotSetNilValue is the error when sets an empty value. - ErrCannotSetNilValue = dbterror.ClassKV.NewStd(mysql.ErrCannotSetNilValue) + ErrCannotSetNilValue = dbterror.ClassKV.NewStd(errno.ErrCannotSetNilValue) // ErrInvalidTxn is the error when commits or rollbacks in an invalid transaction. - ErrInvalidTxn = dbterror.ClassKV.NewStd(mysql.ErrInvalidTxn) + ErrInvalidTxn = dbterror.ClassKV.NewStd(errno.ErrInvalidTxn) // ErrTxnTooLarge is the error when transaction is too large, lock time reached the maximum value. - ErrTxnTooLarge = dbterror.ClassKV.NewStd(mysql.ErrTxnTooLarge) + ErrTxnTooLarge = dbterror.ClassKV.NewStd(errno.ErrTxnTooLarge) // ErrEntryTooLarge is the error when a key value entry is too large. - ErrEntryTooLarge = dbterror.ClassKV.NewStd(mysql.ErrEntryTooLarge) + ErrEntryTooLarge = dbterror.ClassKV.NewStd(errno.ErrEntryTooLarge) // ErrKeyTooLarge is the error when a key is too large to be handled by MemBuffer. - ErrKeyTooLarge = dbterror.ClassKV.NewStd(mysql.ErrKeyTooLarge) + ErrKeyTooLarge = dbterror.ClassKV.NewStd(errno.ErrKeyTooLarge) // ErrKeyExists returns when key is already exist. Caller should try to use // GenKeyExistsErr to generate this error for correct format. - ErrKeyExists = dbterror.ClassKV.NewStd(mysql.ErrDupEntry) + ErrKeyExists = dbterror.ClassKV.NewStd(errno.ErrDupEntry) // ErrNotImplemented returns when a function is not implemented yet. - ErrNotImplemented = dbterror.ClassKV.NewStd(mysql.ErrNotImplemented) + ErrNotImplemented = dbterror.ClassKV.NewStd(errno.ErrNotImplemented) // ErrWriteConflict is the error when the commit meets an write conflict error. ErrWriteConflict = dbterror.ClassKV.NewStdErr( - mysql.ErrWriteConflict, - pmysql.Message( - mysql.MySQLErrName[mysql.ErrWriteConflict].Raw+" "+TxnRetryableMark, - mysql.MySQLErrName[mysql.ErrWriteConflict].RedactArgPos, + errno.ErrWriteConflict, + errno.Message( + errno.MySQLErrName[errno.ErrWriteConflict].Raw+" "+TxnRetryableMark, + errno.MySQLErrName[errno.ErrWriteConflict].RedactArgPos, ), ) // ErrWriteConflictInTiDB is the error when the commit meets an write conflict error when local latch is enabled. ErrWriteConflictInTiDB = dbterror.ClassKV.NewStdErr( - mysql.ErrWriteConflictInTiDB, - pmysql.Message( - mysql.MySQLErrName[mysql.ErrWriteConflictInTiDB].Raw+" "+TxnRetryableMark, - mysql.MySQLErrName[mysql.ErrWriteConflictInTiDB].RedactArgPos, + errno.ErrWriteConflictInTiDB, + errno.Message( + errno.MySQLErrName[errno.ErrWriteConflictInTiDB].Raw+" "+TxnRetryableMark, + errno.MySQLErrName[errno.ErrWriteConflictInTiDB].RedactArgPos, ), ) // ErrLockExpire is the error when the lock is expired. - ErrLockExpire = dbterror.ClassTiKV.NewStd(mysql.ErrLockExpire) + ErrLockExpire = dbterror.ClassTiKV.NewStd(errno.ErrLockExpire) // ErrAssertionFailed is the error when an assertion fails. - ErrAssertionFailed = dbterror.ClassTiKV.NewStd(mysql.ErrAssertionFailed) + ErrAssertionFailed = dbterror.ClassTiKV.NewStd(errno.ErrAssertionFailed) ) // IsTxnRetryableError checks if the error could safely retry the transaction. diff --git a/pkg/kv/error_test.go b/pkg/kv/error_test.go index 08c2bde9e9c62..1c65eb704af95 100644 --- a/pkg/kv/error_test.go +++ b/pkg/kv/error_test.go @@ -17,7 +17,7 @@ package kv import ( "testing" - "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/stretchr/testify/assert" ) @@ -37,7 +37,7 @@ func TestError(t *testing.T) { for _, err := range kvErrs { code := terror.ToSQLError(err).Code - assert.NotEqual(t, mysql.ErrUnknown, code) + assert.NotEqual(t, errno.ErrUnknown, code) assert.Equal(t, uint16(err.Code()), code) } } diff --git a/pkg/lightning/backend/kv/sql2kv.go b/pkg/lightning/backend/kv/sql2kv.go index 2457db832ad81..bb5c1dd8c7a29 100644 --- a/pkg/lightning/backend/kv/sql2kv.go +++ b/pkg/lightning/backend/kv/sql2kv.go @@ -217,7 +217,7 @@ func (kvcodec *tableKVEncoder) Encode(row []types.Datum, rowID int64, columnPermutation []int, _ int64) (encode.Row, error) { // we ignore warnings when encoding rows now, but warnings uses the same memory as parser, since the input // row []types.Datum share the same underlying buf, and when doing CastValue, we're using hack.String/hack.Slice. - // when generating error such as mysql.ErrDataOutOfRange, the data will be part of the error, causing the buf + // when generating error such as errno.ErrDataOutOfRange, the data will be part of the error, causing the buf // unable to release. So we truncate the warnings here. defer kvcodec.TruncateWarns() var value types.Datum diff --git a/pkg/lightning/backend/local/checksum_test.go b/pkg/lightning/backend/local/checksum_test.go index 399866bf0fa2f..7487702dfa54f 100644 --- a/pkg/lightning/backend/local/checksum_test.go +++ b/pkg/lightning/backend/local/checksum_test.go @@ -26,7 +26,7 @@ import ( "github.com/DATA-DOG/go-sqlmock" "github.com/go-sql-driver/mysql" "github.com/pingcap/errors" - tmysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" . "github.com/pingcap/tidb/pkg/lightning/checkpoints" "github.com/pingcap/tidb/pkg/meta/model" @@ -470,7 +470,7 @@ func (r *mockResultSubset) RespTime() time.Duration { return time.Millisecond } -var mockChecksumKVClientErr = &mysql.MySQLError{Number: tmysql.ErrPDServerTimeout} +var mockChecksumKVClientErr = &mysql.MySQLError{Number: errno.ErrPDServerTimeout} type mockChecksumKVClient struct { kv.Client diff --git a/pkg/lightning/backend/tidb/tidb_test.go b/pkg/lightning/backend/tidb/tidb_test.go index 0340313906ffd..8914029356d56 100644 --- a/pkg/lightning/backend/tidb/tidb_test.go +++ b/pkg/lightning/backend/tidb/tidb_test.go @@ -457,7 +457,7 @@ func TestFetchRemoteTableModelsDropTableHalfway(t *testing.T) { AddRow("test", "tbl01", "id", int64(1), "_TIDB_ROWID"). AddRow("test", "tbl01", "id", int64(1), "AUTO_INCREMENT")) s.mockDB.ExpectQuery("SHOW TABLE `test`.`tbl02` NEXT_ROW_ID"). - WillReturnError(mysql.NewErr(mysql.ErrNoSuchTable, "test", "tbl02")) + WillReturnError(mysql.NewErr(errno.ErrNoSuchTable, "test", "tbl02")) s.mockDB.ExpectCommit() infoGetter := tidb.NewTargetInfoGetter(s.dbHandle) diff --git a/pkg/lightning/common/retry.go b/pkg/lightning/common/retry.go index ed1f7d4510ffb..8f8014cef5ca2 100644 --- a/pkg/lightning/common/retry.go +++ b/pkg/lightning/common/retry.go @@ -27,7 +27,7 @@ import ( "github.com/go-sql-driver/mysql" "github.com/pingcap/errors" - tmysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" drivererr "github.com/pingcap/tidb/pkg/store/driver/error" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -123,9 +123,9 @@ func isSingleRetryableError(err error) bool { case *mysql.MySQLError: switch nerr.Number { // ErrLockDeadlock can retry to commit while meet deadlock - case tmysql.ErrUnknown, tmysql.ErrLockDeadlock, tmysql.ErrLockWaitTimeout, tmysql.ErrWriteConflict, tmysql.ErrWriteConflictInTiDB, - tmysql.ErrPDServerTimeout, tmysql.ErrTiKVServerTimeout, tmysql.ErrTiKVServerBusy, tmysql.ErrResolveLockTimeout, - tmysql.ErrRegionUnavailable, tmysql.ErrInfoSchemaExpired, tmysql.ErrInfoSchemaChanged, tmysql.ErrTxnRetryable: + case errno.ErrUnknown, errno.ErrLockDeadlock, errno.ErrLockWaitTimeout, errno.ErrWriteConflict, errno.ErrWriteConflictInTiDB, + errno.ErrPDServerTimeout, errno.ErrTiKVServerTimeout, errno.ErrTiKVServerBusy, errno.ErrResolveLockTimeout, + errno.ErrRegionUnavailable, errno.ErrInfoSchemaExpired, errno.ErrInfoSchemaChanged, errno.ErrTxnRetryable: return true default: return false diff --git a/pkg/lightning/common/retry_test.go b/pkg/lightning/common/retry_test.go index ad49e1854ffe3..1dd31048a1a06 100644 --- a/pkg/lightning/common/retry_test.go +++ b/pkg/lightning/common/retry_test.go @@ -26,7 +26,7 @@ import ( "github.com/go-sql-driver/mysql" "github.com/pingcap/errors" - tmysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" drivererr "github.com/pingcap/tidb/pkg/store/driver/error" "github.com/stretchr/testify/require" "go.uber.org/multierr" @@ -77,18 +77,18 @@ func TestIsRetryableError(t *testing.T) { // MySQL Errors require.False(t, IsRetryableError(&mysql.MySQLError{})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrUnknown})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrLockDeadlock})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrPDServerTimeout})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrTiKVServerTimeout})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrTiKVServerBusy})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrResolveLockTimeout})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrRegionUnavailable})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrWriteConflictInTiDB})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrWriteConflict})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrInfoSchemaExpired})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrInfoSchemaChanged})) - require.True(t, IsRetryableError(&mysql.MySQLError{Number: tmysql.ErrTxnRetryable})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrUnknown})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrLockDeadlock})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrPDServerTimeout})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrTiKVServerTimeout})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrTiKVServerBusy})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrResolveLockTimeout})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrRegionUnavailable})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrWriteConflictInTiDB})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrWriteConflict})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrInfoSchemaExpired})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrInfoSchemaChanged})) + require.True(t, IsRetryableError(&mysql.MySQLError{Number: errno.ErrTxnRetryable})) // gRPC Errors require.False(t, IsRetryableError(status.Error(codes.Canceled, ""))) diff --git a/pkg/lightning/common/util.go b/pkg/lightning/common/util.go index 7017e79a646c2..fe977a05bf111 100644 --- a/pkg/lightning/common/util.go +++ b/pkg/lightning/common/util.go @@ -97,7 +97,7 @@ func tryConnectMySQL(cfg *mysql.Config) (*sql.DB, error) { failpoint.Inject("MustMySQLPassword", func(val failpoint.Value) { pwd := val.(string) if cfg.Passwd != pwd { - failpoint.Return(nil, &mysql.MySQLError{Number: tmysql.ErrAccessDenied, Message: "access denied"}) + failpoint.Return(nil, &mysql.MySQLError{Number: errno.ErrAccessDenied, Message: "access denied"}) } failpoint.Return(nil, nil) }) @@ -122,7 +122,7 @@ func ConnectMySQL(cfg *mysql.Config) (*sql.DB, error) { return db, nil } // If access is denied and password is encoded by base64, try the decoded string as well. - if mysqlErr, ok := errors.Cause(firstErr).(*mysql.MySQLError); ok && mysqlErr.Number == tmysql.ErrAccessDenied { + if mysqlErr, ok := errors.Cause(firstErr).(*mysql.MySQLError); ok && mysqlErr.Number == errno.ErrAccessDenied { // If password is encoded by base64, try the decoded string as well. password, decodeErr := base64.StdEncoding.DecodeString(cfg.Passwd) if decodeErr == nil && string(password) != cfg.Passwd { diff --git a/pkg/lightning/mydump/schema_import_test.go b/pkg/lightning/mydump/schema_import_test.go index 11f3d5ea360c9..b657da3edc1e3 100644 --- a/pkg/lightning/mydump/schema_import_test.go +++ b/pkg/lightning/mydump/schema_import_test.go @@ -25,7 +25,7 @@ import ( dmysql "github.com/go-sql-driver/mysql" "github.com/pingcap/errors" "github.com/pingcap/tidb/br/pkg/storage" - tmysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/lightning/common" "github.com/pingcap/tidb/pkg/lightning/log" "github.com/pingcap/tidb/pkg/parser" @@ -109,7 +109,7 @@ func TestSchemaImporter(t *testing.T) { AddRow("test01").AddRow("test02").AddRow("test03"). AddRow("test04").AddRow("test05")) mock.ExpectQuery("SHOW CREATE TABLE `test02`.`t`"). - WillReturnError(&dmysql.MySQLError{Number: tmysql.ErrNoSuchTable}) + WillReturnError(&dmysql.MySQLError{Number: errno.ErrNoSuchTable}) dbMetas := []*MDDatabaseMeta{ {Name: "test01"}, {Name: "test02", Tables: []*MDTableMeta{{DB: "test02", Name: "t"}}}, @@ -135,7 +135,7 @@ func TestSchemaImporter(t *testing.T) { mock.ExpectQuery("SHOW CREATE TABLE `test01`.`t1`"). WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow("t1", "CREATE TABLE `t1` (a int);")) mock.ExpectQuery("SHOW CREATE TABLE `test01`.`T2`"). - WillReturnError(&dmysql.MySQLError{Number: tmysql.ErrNoSuchTable}) + WillReturnError(&dmysql.MySQLError{Number: errno.ErrNoSuchTable}) fileName := "t2-invalid-schema.sql" require.NoError(t, os.WriteFile(path.Join(tempDir, fileName), []byte("CREATE table t2 whatever;"), 0o644)) dbMetas := []*MDDatabaseMeta{ diff --git a/pkg/meta/autoid/errors.go b/pkg/meta/autoid/errors.go index 5fe241ef9eb5b..6c66b6025b238 100644 --- a/pkg/meta/autoid/errors.go +++ b/pkg/meta/autoid/errors.go @@ -15,19 +15,19 @@ package autoid import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // Error instances. var ( - errInvalidTableID = dbterror.ClassAutoid.NewStd(mysql.ErrInvalidTableID) - errInvalidIncrementAndOffset = dbterror.ClassAutoid.NewStd(mysql.ErrInvalidIncrementAndOffset) - errNotImplemented = dbterror.ClassAutoid.NewStd(mysql.ErrNotImplemented) - ErrAutoincReadFailed = dbterror.ClassAutoid.NewStd(mysql.ErrAutoincReadFailed) - ErrWrongAutoKey = dbterror.ClassAutoid.NewStd(mysql.ErrWrongAutoKey) - ErrInvalidAllocatorType = dbterror.ClassAutoid.NewStd(mysql.ErrUnknownAllocatorType) - ErrAutoRandReadFailed = dbterror.ClassAutoid.NewStd(mysql.ErrAutoRandReadFailed) + errInvalidTableID = dbterror.ClassAutoid.NewStd(errno.ErrInvalidTableID) + errInvalidIncrementAndOffset = dbterror.ClassAutoid.NewStd(errno.ErrInvalidIncrementAndOffset) + errNotImplemented = dbterror.ClassAutoid.NewStd(errno.ErrNotImplemented) + ErrAutoincReadFailed = dbterror.ClassAutoid.NewStd(errno.ErrAutoincReadFailed) + ErrWrongAutoKey = dbterror.ClassAutoid.NewStd(errno.ErrWrongAutoKey) + ErrInvalidAllocatorType = dbterror.ClassAutoid.NewStd(errno.ErrUnknownAllocatorType) + ErrAutoRandReadFailed = dbterror.ClassAutoid.NewStd(errno.ErrAutoRandReadFailed) ) const ( diff --git a/pkg/meta/meta.go b/pkg/meta/meta.go index d7ea87b7ca817..0d97ebeaa3be4 100644 --- a/pkg/meta/meta.go +++ b/pkg/meta/meta.go @@ -134,9 +134,9 @@ const ( var ( // ErrDBExists is the error for db exists. - ErrDBExists = dbterror.ClassMeta.NewStd(mysql.ErrDBCreateExists) + ErrDBExists = dbterror.ClassMeta.NewStd(errno.ErrDBCreateExists) // ErrDBNotExists is the error for db not exists. - ErrDBNotExists = dbterror.ClassMeta.NewStd(mysql.ErrBadDB) + ErrDBNotExists = dbterror.ClassMeta.NewStd(errno.ErrBadDB) // ErrPolicyExists is the error for policy exists. ErrPolicyExists = dbterror.ClassMeta.NewStd(errno.ErrPlacementPolicyExists) // ErrPolicyNotExists is the error for policy not exists. @@ -146,9 +146,9 @@ var ( // ErrResourceGroupNotExists is the error for resource group not exists. ErrResourceGroupNotExists = dbterror.ClassMeta.NewStd(errno.ErrResourceGroupNotExists) // ErrTableExists is the error for table exists. - ErrTableExists = dbterror.ClassMeta.NewStd(mysql.ErrTableExists) + ErrTableExists = dbterror.ClassMeta.NewStd(errno.ErrTableExists) // ErrTableNotExists is the error for table not exists. - ErrTableNotExists = dbterror.ClassMeta.NewStd(mysql.ErrNoSuchTable) + ErrTableNotExists = dbterror.ClassMeta.NewStd(errno.ErrNoSuchTable) // ErrDDLReorgElementNotExist is the error for reorg element not exists. ErrDDLReorgElementNotExist = dbterror.ClassMeta.NewStd(errno.ErrDDLReorgElementNotExist) // ErrInvalidString is the error for invalid string to parse diff --git a/pkg/parser/BUILD.bazel b/pkg/parser/BUILD.bazel index b81fab9b917c6..990021a5b2013 100644 --- a/pkg/parser/BUILD.bazel +++ b/pkg/parser/BUILD.bazel @@ -21,6 +21,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/ast", "//pkg/parser/auth", "//pkg/parser/charset", diff --git a/pkg/parser/ast/BUILD.bazel b/pkg/parser/ast/BUILD.bazel index e0291f44d6ce7..09e61d9b884e3 100644 --- a/pkg/parser/ast/BUILD.bazel +++ b/pkg/parser/ast/BUILD.bazel @@ -19,6 +19,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser/ast", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/auth", "//pkg/parser/charset", "//pkg/parser/format", diff --git a/pkg/parser/ast/ddl.go b/pkg/parser/ast/ddl.go index 1feaec655bdca..2fd3a00f788d0 100644 --- a/pkg/parser/ast/ddl.go +++ b/pkg/parser/ast/ddl.go @@ -18,9 +18,9 @@ import ( "strings" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/auth" "github.com/pingcap/tidb/pkg/parser/format" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/parser/tidb" "github.com/pingcap/tidb/pkg/parser/types" @@ -4004,21 +4004,21 @@ func (n *TruncateTableStmt) Accept(v Visitor) (Node, bool) { } var ( - ErrNoParts = terror.ClassDDL.NewStd(mysql.ErrNoParts) - ErrPartitionColumnList = terror.ClassDDL.NewStd(mysql.ErrPartitionColumnList) - ErrPartitionRequiresValues = terror.ClassDDL.NewStd(mysql.ErrPartitionRequiresValues) - ErrPartitionsMustBeDefined = terror.ClassDDL.NewStd(mysql.ErrPartitionsMustBeDefined) - ErrPartitionWrongNoPart = terror.ClassDDL.NewStd(mysql.ErrPartitionWrongNoPart) - ErrPartitionWrongNoSubpart = terror.ClassDDL.NewStd(mysql.ErrPartitionWrongNoSubpart) - ErrPartitionWrongValues = terror.ClassDDL.NewStd(mysql.ErrPartitionWrongValues) - ErrRowSinglePartitionField = terror.ClassDDL.NewStd(mysql.ErrRowSinglePartitionField) - ErrSubpartition = terror.ClassDDL.NewStd(mysql.ErrSubpartition) - ErrSystemVersioningWrongPartitions = terror.ClassDDL.NewStd(mysql.ErrSystemVersioningWrongPartitions) - ErrTooManyValues = terror.ClassDDL.NewStd(mysql.ErrTooManyValues) - ErrWrongPartitionTypeExpectedSystemTime = terror.ClassDDL.NewStd(mysql.ErrWrongPartitionTypeExpectedSystemTime) - ErrUnknownCharacterSet = terror.ClassDDL.NewStd(mysql.ErrUnknownCharacterSet) - ErrCoalescePartitionNoPartition = terror.ClassDDL.NewStd(mysql.ErrCoalescePartitionNoPartition) - ErrWrongUsage = terror.ClassDDL.NewStd(mysql.ErrWrongUsage) + ErrNoParts = terror.ClassDDL.NewStd(errno.ErrNoParts) + ErrPartitionColumnList = terror.ClassDDL.NewStd(errno.ErrPartitionColumnList) + ErrPartitionRequiresValues = terror.ClassDDL.NewStd(errno.ErrPartitionRequiresValues) + ErrPartitionsMustBeDefined = terror.ClassDDL.NewStd(errno.ErrPartitionsMustBeDefined) + ErrPartitionWrongNoPart = terror.ClassDDL.NewStd(errno.ErrPartitionWrongNoPart) + ErrPartitionWrongNoSubpart = terror.ClassDDL.NewStd(errno.ErrPartitionWrongNoSubpart) + ErrPartitionWrongValues = terror.ClassDDL.NewStd(errno.ErrPartitionWrongValues) + ErrRowSinglePartitionField = terror.ClassDDL.NewStd(errno.ErrRowSinglePartitionField) + ErrSubpartition = terror.ClassDDL.NewStd(errno.ErrSubpartition) + ErrSystemVersioningWrongPartitions = terror.ClassDDL.NewStd(errno.ErrSystemVersioningWrongPartitions) + ErrTooManyValues = terror.ClassDDL.NewStd(errno.ErrTooManyValues) + ErrWrongPartitionTypeExpectedSystemTime = terror.ClassDDL.NewStd(errno.ErrWrongPartitionTypeExpectedSystemTime) + ErrUnknownCharacterSet = terror.ClassDDL.NewStd(errno.ErrUnknownCharacterSet) + ErrCoalescePartitionNoPartition = terror.ClassDDL.NewStd(errno.ErrCoalescePartitionNoPartition) + ErrWrongUsage = terror.ClassDDL.NewStd(errno.ErrWrongUsage) ) type SubPartitionDefinition struct { diff --git a/pkg/parser/charset/BUILD.bazel b/pkg/parser/charset/BUILD.bazel index 56718a7644d60..dcefd750a2e7c 100644 --- a/pkg/parser/charset/BUILD.bazel +++ b/pkg/parser/charset/BUILD.bazel @@ -16,6 +16,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser/charset", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/mysql", "//pkg/parser/terror", "@com_github_pingcap_errors//:errors", diff --git a/pkg/parser/charset/charset.go b/pkg/parser/charset/charset.go index 69adcae00e297..7d6388c3e374f 100644 --- a/pkg/parser/charset/charset.go +++ b/pkg/parser/charset/charset.go @@ -19,6 +19,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "go.uber.org/zap" @@ -26,9 +27,9 @@ import ( var ( // ErrUnknownCollation is unknown collation. - ErrUnknownCollation = terror.ClassDDL.NewStd(mysql.ErrUnknownCollation) + ErrUnknownCollation = terror.ClassDDL.NewStd(errno.ErrUnknownCollation) // ErrCollationCharsetMismatch is collation charset mismatch. - ErrCollationCharsetMismatch = terror.ClassDDL.NewStd(mysql.ErrCollationCharsetMismatch) + ErrCollationCharsetMismatch = terror.ClassDDL.NewStd(errno.ErrCollationCharsetMismatch) ) var ( diff --git a/pkg/parser/charset/encoding_base.go b/pkg/parser/charset/encoding_base.go index ec4f1b26037cf..38f043e7f3fd5 100644 --- a/pkg/parser/charset/encoding_base.go +++ b/pkg/parser/charset/encoding_base.go @@ -20,14 +20,14 @@ import ( "strings" "unsafe" - "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" "golang.org/x/text/encoding" "golang.org/x/text/transform" ) // ErrInvalidCharacterString returns when the string is invalid in the specific charset. -var ErrInvalidCharacterString = terror.ClassParser.NewStd(mysql.ErrInvalidCharacterString) +var ErrInvalidCharacterString = terror.ClassParser.NewStd(errno.ErrInvalidCharacterString) // encodingBase defines some generic functions. type encodingBase struct { diff --git a/pkg/parser/hintparserimpl.go b/pkg/parser/hintparserimpl.go index a3dcc18deae88..57e4d50d16aed 100644 --- a/pkg/parser/hintparserimpl.go +++ b/pkg/parser/hintparserimpl.go @@ -17,6 +17,7 @@ import ( "strconv" "strings" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" @@ -24,12 +25,12 @@ import ( //revive:disable:exported var ( - ErrWarnOptimizerHintUnsupportedHint = terror.ClassParser.NewStd(mysql.ErrWarnOptimizerHintUnsupportedHint) - ErrWarnOptimizerHintInvalidToken = terror.ClassParser.NewStd(mysql.ErrWarnOptimizerHintInvalidToken) - ErrWarnMemoryQuotaOverflow = terror.ClassParser.NewStd(mysql.ErrWarnMemoryQuotaOverflow) - ErrWarnOptimizerHintParseError = terror.ClassParser.NewStd(mysql.ErrWarnOptimizerHintParseError) - ErrWarnOptimizerHintInvalidInteger = terror.ClassParser.NewStd(mysql.ErrWarnOptimizerHintInvalidInteger) - ErrWarnOptimizerHintWrongPos = terror.ClassParser.NewStd(mysql.ErrWarnOptimizerHintWrongPos) + ErrWarnOptimizerHintUnsupportedHint = terror.ClassParser.NewStd(errno.ErrWarnOptimizerHintUnsupportedHint) + ErrWarnOptimizerHintInvalidToken = terror.ClassParser.NewStd(errno.ErrWarnOptimizerHintInvalidToken) + ErrWarnMemoryQuotaOverflow = terror.ClassParser.NewStd(errno.ErrWarnMemoryQuotaOverflow) + ErrWarnOptimizerHintParseError = terror.ClassParser.NewStd(errno.ErrWarnOptimizerHintParseError) + ErrWarnOptimizerHintInvalidInteger = terror.ClassParser.NewStd(errno.ErrWarnOptimizerHintInvalidInteger) + ErrWarnOptimizerHintWrongPos = terror.ClassParser.NewStd(errno.ErrWarnOptimizerHintWrongPos) ) //revive:enable:exported diff --git a/pkg/parser/mysql/BUILD.bazel b/pkg/parser/mysql/BUILD.bazel index 7a1a3b80ce437..5df83846a41c7 100644 --- a/pkg/parser/mysql/BUILD.bazel +++ b/pkg/parser/mysql/BUILD.bazel @@ -5,8 +5,6 @@ go_library( srcs = [ "charset.go", "const.go", - "errcode.go", - "errname.go", "error.go", "locale_format.go", "privs.go", @@ -17,6 +15,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser/mysql", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/format", "@com_github_pingcap_errors//:errors", ], diff --git a/pkg/parser/mysql/const.go b/pkg/parser/mysql/const.go index 591c089069435..4dc77a5976a14 100644 --- a/pkg/parser/mysql/const.go +++ b/pkg/parser/mysql/const.go @@ -18,11 +18,12 @@ import ( "strings" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/format" ) func newInvalidModeErr(s string) error { - return NewErr(ErrWrongValueForVar, "sql_mode", s) + return NewErr(errno.ErrWrongValueForVar, "sql_mode", s) } const ( diff --git a/pkg/parser/mysql/errcode.go b/pkg/parser/mysql/errcode.go deleted file mode 100644 index bfbd196138de9..0000000000000 --- a/pkg/parser/mysql/errcode.go +++ /dev/null @@ -1,980 +0,0 @@ -// Copyright 2015 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package mysql - -// MySQL error code. -// This value is numeric. It is not portable to other database systems. -const ( - ErrErrorFirst = 1000 - ErrHashchk = 1000 - ErrNisamchk = 1001 - ErrNo = 1002 - ErrYes = 1003 - ErrCantCreateFile = 1004 - ErrCantCreateTable = 1005 - ErrCantCreateDB = 1006 - ErrDBCreateExists = 1007 - ErrDBDropExists = 1008 - ErrDBDropDelete = 1009 - ErrDBDropRmdir = 1010 - ErrCantDeleteFile = 1011 - ErrCantFindSystemRec = 1012 - ErrCantGetStat = 1013 - ErrCantGetWd = 1014 - ErrCantLock = 1015 - ErrCantOpenFile = 1016 - ErrFileNotFound = 1017 - ErrCantReadDir = 1018 - ErrCantSetWd = 1019 - ErrCheckread = 1020 - ErrDiskFull = 1021 - ErrDupKey = 1022 - ErrErrorOnClose = 1023 - ErrErrorOnRead = 1024 - ErrErrorOnRename = 1025 - ErrErrorOnWrite = 1026 - ErrFileUsed = 1027 - ErrFilsortAbort = 1028 - ErrFormNotFound = 1029 - ErrGetErrno = 1030 - ErrIllegalHa = 1031 - ErrKeyNotFound = 1032 - ErrNotFormFile = 1033 - ErrNotKeyFile = 1034 - ErrOldKeyFile = 1035 - ErrOpenAsReadonly = 1036 - ErrOutofMemory = 1037 - ErrOutOfSortMemory = 1038 - ErrUnexpectedEOF = 1039 - ErrConCount = 1040 - ErrOutOfResources = 1041 - ErrBadHost = 1042 - ErrHandshake = 1043 - ErrDBaccessDenied = 1044 - ErrAccessDenied = 1045 - ErrNoDB = 1046 - ErrUnknownCom = 1047 - ErrBadNull = 1048 - ErrBadDB = 1049 - ErrTableExists = 1050 - ErrBadTable = 1051 - ErrNonUniq = 1052 - ErrServerShutdown = 1053 - ErrBadField = 1054 - ErrFieldNotInGroupBy = 1055 - ErrWrongGroupField = 1056 - ErrWrongSumSelect = 1057 - ErrWrongValueCount = 1058 - ErrTooLongIdent = 1059 - ErrDupFieldName = 1060 - ErrDupKeyName = 1061 - ErrDupEntry = 1062 - ErrWrongFieldSpec = 1063 - ErrParse = 1064 - ErrEmptyQuery = 1065 - ErrNonuniqTable = 1066 - ErrInvalidDefault = 1067 - ErrMultiplePriKey = 1068 - ErrTooManyKeys = 1069 - ErrTooManyKeyParts = 1070 - ErrTooLongKey = 1071 - ErrKeyColumnDoesNotExits = 1072 - ErrBlobUsedAsKey = 1073 - ErrTooBigFieldlength = 1074 - ErrWrongAutoKey = 1075 - ErrReady = 1076 - ErrNormalShutdown = 1077 - ErrGotSignal = 1078 - ErrShutdownComplete = 1079 - ErrForcingClose = 1080 - ErrIpsock = 1081 - ErrNoSuchIndex = 1082 - ErrWrongFieldTerminators = 1083 - ErrBlobsAndNoTerminated = 1084 - ErrTextFileNotReadable = 1085 - ErrFileExists = 1086 - ErrLoadInfo = 1087 - ErrAlterInfo = 1088 - ErrWrongSubKey = 1089 - ErrCantRemoveAllFields = 1090 - ErrCantDropFieldOrKey = 1091 - ErrInsertInfo = 1092 - ErrUpdateTableUsed = 1093 - ErrNoSuchThread = 1094 - ErrKillDenied = 1095 - ErrNoTablesUsed = 1096 - ErrTooBigSet = 1097 - ErrNoUniqueLogFile = 1098 - ErrTableNotLockedForWrite = 1099 - ErrTableNotLocked = 1100 - ErrBlobCantHaveDefault = 1101 - ErrWrongDBName = 1102 - ErrWrongTableName = 1103 - ErrTooBigSelect = 1104 - ErrUnknown = 1105 - ErrUnknownProcedure = 1106 - ErrWrongParamcountToProcedure = 1107 - ErrWrongParametersToProcedure = 1108 - ErrUnknownTable = 1109 - ErrFieldSpecifiedTwice = 1110 - ErrInvalidGroupFuncUse = 1111 - ErrUnsupportedExtension = 1112 - ErrTableMustHaveColumns = 1113 - ErrRecordFileFull = 1114 - ErrUnknownCharacterSet = 1115 - ErrTooManyTables = 1116 - ErrTooManyFields = 1117 - ErrTooBigRowsize = 1118 - ErrStackOverrun = 1119 - ErrWrongOuterJoin = 1120 - ErrNullColumnInIndex = 1121 - ErrCantFindUdf = 1122 - ErrCantInitializeUdf = 1123 - ErrUdfNoPaths = 1124 - ErrUdfExists = 1125 - ErrCantOpenLibrary = 1126 - ErrCantFindDlEntry = 1127 - ErrFunctionNotDefined = 1128 - ErrHostIsBlocked = 1129 - ErrHostNotPrivileged = 1130 - ErrPasswordAnonymousUser = 1131 - ErrPasswordNotAllowed = 1132 - ErrPasswordNoMatch = 1133 - ErrUpdateInfo = 1134 - ErrCantCreateThread = 1135 - ErrWrongValueCountOnRow = 1136 - ErrCantReopenTable = 1137 - ErrInvalidUseOfNull = 1138 - ErrRegexp = 1139 - ErrMixOfGroupFuncAndFields = 1140 - ErrNonexistingGrant = 1141 - ErrTableaccessDenied = 1142 - ErrColumnaccessDenied = 1143 - ErrIllegalGrantForTable = 1144 - ErrGrantWrongHostOrUser = 1145 - ErrNoSuchTable = 1146 - ErrNonexistingTableGrant = 1147 - ErrNotAllowedCommand = 1148 - ErrSyntax = 1149 - ErrDelayedCantChangeLock = 1150 - ErrTooManyDelayedThreads = 1151 - ErrAbortingConnection = 1152 - ErrNetPacketTooLarge = 1153 - ErrNetReadErrorFromPipe = 1154 - ErrNetFcntl = 1155 - ErrNetPacketsOutOfOrder = 1156 - ErrNetUncompress = 1157 - ErrNetRead = 1158 - ErrNetReadInterrupted = 1159 - ErrNetErrorOnWrite = 1160 - ErrNetWriteInterrupted = 1161 - ErrTooLongString = 1162 - ErrTableCantHandleBlob = 1163 - ErrTableCantHandleAutoIncrement = 1164 - ErrDelayedInsertTableLocked = 1165 - ErrWrongColumnName = 1166 - ErrWrongKeyColumn = 1167 - ErrWrongMrgTable = 1168 - ErrDupUnique = 1169 - ErrBlobKeyWithoutLength = 1170 - ErrPrimaryCantHaveNull = 1171 - ErrTooManyRows = 1172 - ErrRequiresPrimaryKey = 1173 - ErrNoRaidCompiled = 1174 - ErrUpdateWithoutKeyInSafeMode = 1175 - ErrKeyDoesNotExist = 1176 - ErrCheckNoSuchTable = 1177 - ErrCheckNotImplemented = 1178 - ErrCantDoThisDuringAnTransaction = 1179 - ErrErrorDuringCommit = 1180 - ErrErrorDuringRollback = 1181 - ErrErrorDuringFlushLogs = 1182 - ErrErrorDuringCheckpoint = 1183 - ErrNewAbortingConnection = 1184 - ErrDumpNotImplemented = 1185 - ErrFlushMasterBinlogClosed = 1186 - ErrIndexRebuild = 1187 - ErrMaster = 1188 - ErrMasterNetRead = 1189 - ErrMasterNetWrite = 1190 - ErrFtMatchingKeyNotFound = 1191 - ErrLockOrActiveTransaction = 1192 - ErrUnknownSystemVariable = 1193 - ErrCrashedOnUsage = 1194 - ErrCrashedOnRepair = 1195 - ErrWarningNotCompleteRollback = 1196 - ErrTransCacheFull = 1197 - ErrSlaveMustStop = 1198 - ErrSlaveNotRunning = 1199 - ErrBadSlave = 1200 - ErrMasterInfo = 1201 - ErrSlaveThread = 1202 - ErrTooManyUserConnections = 1203 - ErrSetConstantsOnly = 1204 - ErrLockWaitTimeout = 1205 - ErrLockTableFull = 1206 - ErrReadOnlyTransaction = 1207 - ErrDropDBWithReadLock = 1208 - ErrCreateDBWithReadLock = 1209 - ErrWrongArguments = 1210 - ErrNoPermissionToCreateUser = 1211 - ErrUnionTablesInDifferentDir = 1212 - ErrLockDeadlock = 1213 - ErrTableCantHandleFt = 1214 - ErrCannotAddForeign = 1215 - ErrNoReferencedRow = 1216 - ErrRowIsReferenced = 1217 - ErrConnectToMaster = 1218 - ErrQueryOnMaster = 1219 - ErrErrorWhenExecutingCommand = 1220 - ErrWrongUsage = 1221 - ErrWrongNumberOfColumnsInSelect = 1222 - ErrCantUpdateWithReadlock = 1223 - ErrMixingNotAllowed = 1224 - ErrDupArgument = 1225 - ErrUserLimitReached = 1226 - ErrSpecificAccessDenied = 1227 - ErrLocalVariable = 1228 - ErrGlobalVariable = 1229 - ErrNoDefault = 1230 - ErrWrongValueForVar = 1231 - ErrWrongTypeForVar = 1232 - ErrVarCantBeRead = 1233 - ErrCantUseOptionHere = 1234 - ErrNotSupportedYet = 1235 - ErrMasterFatalErrorReadingBinlog = 1236 - ErrSlaveIgnoredTable = 1237 - ErrIncorrectGlobalLocalVar = 1238 - ErrWrongFkDef = 1239 - ErrKeyRefDoNotMatchTableRef = 1240 - ErrOperandColumns = 1241 - ErrSubqueryNo1Row = 1242 - ErrUnknownStmtHandler = 1243 - ErrCorruptHelpDB = 1244 - ErrCyclicReference = 1245 - ErrAutoConvert = 1246 - ErrIllegalReference = 1247 - ErrDerivedMustHaveAlias = 1248 - ErrSelectReduced = 1249 - ErrTablenameNotAllowedHere = 1250 - ErrNotSupportedAuthMode = 1251 - ErrSpatialCantHaveNull = 1252 - ErrCollationCharsetMismatch = 1253 - ErrSlaveWasRunning = 1254 - ErrSlaveWasNotRunning = 1255 - ErrTooBigForUncompress = 1256 - ErrZlibZMem = 1257 - ErrZlibZBuf = 1258 - ErrZlibZData = 1259 - ErrCutValueGroupConcat = 1260 - ErrWarnTooFewRecords = 1261 - ErrWarnTooManyRecords = 1262 - ErrWarnNullToNotnull = 1263 - ErrWarnDataOutOfRange = 1264 - WarnDataTruncated = 1265 - ErrWarnUsingOtherHandler = 1266 - ErrCantAggregate2collations = 1267 - ErrDropUser = 1268 - ErrRevokeGrants = 1269 - ErrCantAggregate3collations = 1270 - ErrCantAggregateNcollations = 1271 - ErrVariableIsNotStruct = 1272 - ErrUnknownCollation = 1273 - ErrSlaveIgnoredSslParams = 1274 - ErrServerIsInSecureAuthMode = 1275 - ErrWarnFieldResolved = 1276 - ErrBadSlaveUntilCond = 1277 - ErrMissingSkipSlave = 1278 - ErrUntilCondIgnored = 1279 - ErrWrongNameForIndex = 1280 - ErrWrongNameForCatalog = 1281 - ErrWarnQcResize = 1282 - ErrBadFtColumn = 1283 - ErrUnknownKeyCache = 1284 - ErrWarnHostnameWontWork = 1285 - ErrUnknownStorageEngine = 1286 - ErrWarnDeprecatedSyntax = 1287 - ErrNonUpdatableTable = 1288 - ErrFeatureDisabled = 1289 - ErrOptionPreventsStatement = 1290 - ErrDuplicatedValueInType = 1291 - ErrTruncatedWrongValue = 1292 - ErrTooMuchAutoTimestampCols = 1293 - ErrInvalidOnUpdate = 1294 - ErrUnsupportedPs = 1295 - ErrGetErrmsg = 1296 - ErrGetTemporaryErrmsg = 1297 - ErrUnknownTimeZone = 1298 - ErrWarnInvalidTimestamp = 1299 - ErrInvalidCharacterString = 1300 - ErrWarnAllowedPacketOverflowed = 1301 - ErrConflictingDeclarations = 1302 - ErrSpNoRecursiveCreate = 1303 - ErrSpAlreadyExists = 1304 - ErrSpDoesNotExist = 1305 - ErrSpDropFailed = 1306 - ErrSpStoreFailed = 1307 - ErrSpLilabelMismatch = 1308 - ErrSpLabelRedefine = 1309 - ErrSpLabelMismatch = 1310 - ErrSpUninitVar = 1311 - ErrSpBadselect = 1312 - ErrSpBadreturn = 1313 - ErrSpBadstatement = 1314 - ErrUpdateLogDeprecatedIgnored = 1315 - ErrUpdateLogDeprecatedTranslated = 1316 - ErrQueryInterrupted = 1317 - ErrSpWrongNoOfArgs = 1318 - ErrSpCondMismatch = 1319 - ErrSpNoreturn = 1320 - ErrSpNoreturnend = 1321 - ErrSpBadCursorQuery = 1322 - ErrSpBadCursorSelect = 1323 - ErrSpCursorMismatch = 1324 - ErrSpCursorAlreadyOpen = 1325 - ErrSpCursorNotOpen = 1326 - ErrSpUndeclaredVar = 1327 - ErrSpWrongNoOfFetchArgs = 1328 - ErrSpFetchNoData = 1329 - ErrSpDupParam = 1330 - ErrSpDupVar = 1331 - ErrSpDupCond = 1332 - ErrSpDupCurs = 1333 - ErrSpCantAlter = 1334 - ErrSpSubselectNyi = 1335 - ErrStmtNotAllowedInSfOrTrg = 1336 - ErrSpVarcondAfterCurshndlr = 1337 - ErrSpCursorAfterHandler = 1338 - ErrSpCaseNotFound = 1339 - ErrFparserTooBigFile = 1340 - ErrFparserBadHeader = 1341 - ErrFparserEOFInComment = 1342 - ErrFparserErrorInParameter = 1343 - ErrFparserEOFInUnknownParameter = 1344 - ErrViewNoExplain = 1345 - ErrFrmUnknownType = 1346 - ErrWrongObject = 1347 - ErrNonupdateableColumn = 1348 - ErrViewSelectDerived = 1349 - ErrViewSelectClause = 1350 - ErrViewSelectVariable = 1351 - ErrViewSelectTmptable = 1352 - ErrViewWrongList = 1353 - ErrWarnViewMerge = 1354 - ErrWarnViewWithoutKey = 1355 - ErrViewInvalid = 1356 - ErrSpNoDropSp = 1357 - ErrSpGotoInHndlr = 1358 - ErrTrgAlreadyExists = 1359 - ErrTrgDoesNotExist = 1360 - ErrTrgOnViewOrTempTable = 1361 - ErrTrgCantChangeRow = 1362 - ErrTrgNoSuchRowInTrg = 1363 - ErrNoDefaultForField = 1364 - ErrDivisionByZero = 1365 - ErrTruncatedWrongValueForField = 1366 - ErrIllegalValueForType = 1367 - ErrViewNonupdCheck = 1368 - ErrViewCheckFailed = 1369 - ErrProcaccessDenied = 1370 - ErrRelayLogFail = 1371 - ErrPasswdLength = 1372 - ErrUnknownTargetBinlog = 1373 - ErrIoErrLogIndexRead = 1374 - ErrBinlogPurgeProhibited = 1375 - ErrFseekFail = 1376 - ErrBinlogPurgeFatalErr = 1377 - ErrLogInUse = 1378 - ErrLogPurgeUnknownErr = 1379 - ErrRelayLogInit = 1380 - ErrNoBinaryLogging = 1381 - ErrReservedSyntax = 1382 - ErrWsasFailed = 1383 - ErrDiffGroupsProc = 1384 - ErrNoGroupForProc = 1385 - ErrOrderWithProc = 1386 - ErrLoggingProhibitChangingOf = 1387 - ErrNoFileMapping = 1388 - ErrWrongMagic = 1389 - ErrPsManyParam = 1390 - ErrKeyPart0 = 1391 - ErrViewChecksum = 1392 - ErrViewMultiupdate = 1393 - ErrViewNoInsertFieldList = 1394 - ErrViewDeleteMergeView = 1395 - ErrCannotUser = 1396 - ErrXaerNota = 1397 - ErrXaerInval = 1398 - ErrXaerRmfail = 1399 - ErrXaerOutside = 1400 - ErrXaerRmerr = 1401 - ErrXaRbrollback = 1402 - ErrNonexistingProcGrant = 1403 - ErrProcAutoGrantFail = 1404 - ErrProcAutoRevokeFail = 1405 - ErrDataTooLong = 1406 - ErrSpBadSQLstate = 1407 - ErrStartup = 1408 - ErrLoadFromFixedSizeRowsToVar = 1409 - ErrCantCreateUserWithGrant = 1410 - ErrWrongValueForType = 1411 - ErrTableDefChanged = 1412 - ErrSpDupHandler = 1413 - ErrSpNotVarArg = 1414 - ErrSpNoRetset = 1415 - ErrCantCreateGeometryObject = 1416 - ErrFailedRoutineBreakBinlog = 1417 - ErrBinlogUnsafeRoutine = 1418 - ErrBinlogCreateRoutineNeedSuper = 1419 - ErrExecStmtWithOpenCursor = 1420 - ErrStmtHasNoOpenCursor = 1421 - ErrCommitNotAllowedInSfOrTrg = 1422 - ErrNoDefaultForViewField = 1423 - ErrSpNoRecursion = 1424 - ErrTooBigScale = 1425 - ErrTooBigPrecision = 1426 - ErrMBiggerThanD = 1427 - ErrWrongLockOfSystemTable = 1428 - ErrConnectToForeignDataSource = 1429 - ErrQueryOnForeignDataSource = 1430 - ErrForeignDataSourceDoesntExist = 1431 - ErrForeignDataStringInvalidCantCreate = 1432 - ErrForeignDataStringInvalid = 1433 - ErrCantCreateFederatedTable = 1434 - ErrTrgInWrongSchema = 1435 - ErrStackOverrunNeedMore = 1436 - ErrTooLongBody = 1437 - ErrWarnCantDropDefaultKeycache = 1438 - ErrTooBigDisplaywidth = 1439 - ErrXaerDupid = 1440 - ErrDatetimeFunctionOverflow = 1441 - ErrCantUpdateUsedTableInSfOrTrg = 1442 - ErrViewPreventUpdate = 1443 - ErrPsNoRecursion = 1444 - ErrSpCantSetAutocommit = 1445 - ErrMalformedDefiner = 1446 - ErrViewFrmNoUser = 1447 - ErrViewOtherUser = 1448 - ErrNoSuchUser = 1449 - ErrForbidSchemaChange = 1450 - ErrRowIsReferenced2 = 1451 - ErrNoReferencedRow2 = 1452 - ErrSpBadVarShadow = 1453 - ErrTrgNoDefiner = 1454 - ErrOldFileFormat = 1455 - ErrSpRecursionLimit = 1456 - ErrSpProcTableCorrupt = 1457 - ErrSpWrongName = 1458 - ErrTableNeedsUpgrade = 1459 - ErrSpNoAggregate = 1460 - ErrMaxPreparedStmtCountReached = 1461 - ErrViewRecursive = 1462 - ErrNonGroupingFieldUsed = 1463 - ErrTableCantHandleSpkeys = 1464 - ErrNoTriggersOnSystemSchema = 1465 - ErrRemovedSpaces = 1466 - ErrAutoincReadFailed = 1467 - ErrUsername = 1468 - ErrHostname = 1469 - ErrWrongStringLength = 1470 - ErrNonInsertableTable = 1471 - ErrAdminWrongMrgTable = 1472 - ErrTooHighLevelOfNestingForSelect = 1473 - ErrNameBecomesEmpty = 1474 - ErrAmbiguousFieldTerm = 1475 - ErrForeignServerExists = 1476 - ErrForeignServerDoesntExist = 1477 - ErrIllegalHaCreateOption = 1478 - ErrPartitionRequiresValues = 1479 - ErrPartitionWrongValues = 1480 - ErrPartitionMaxvalue = 1481 - ErrPartitionSubpartition = 1482 - ErrPartitionSubpartMix = 1483 - ErrPartitionWrongNoPart = 1484 - ErrPartitionWrongNoSubpart = 1485 - ErrWrongExprInPartitionFunc = 1486 - ErrNoConstExprInRangeOrList = 1487 - ErrFieldNotFoundPart = 1488 - ErrListOfFieldsOnlyInHash = 1489 - ErrInconsistentPartitionInfo = 1490 - ErrPartitionFuncNotAllowed = 1491 - ErrPartitionsMustBeDefined = 1492 - ErrRangeNotIncreasing = 1493 - ErrInconsistentTypeOfFunctions = 1494 - ErrMultipleDefConstInListPart = 1495 - ErrPartitionEntry = 1496 - ErrMixHandler = 1497 - ErrPartitionNotDefined = 1498 - ErrTooManyPartitions = 1499 - ErrSubpartition = 1500 - ErrCantCreateHandlerFile = 1501 - ErrBlobFieldInPartFunc = 1502 - ErrUniqueKeyNeedAllFieldsInPf = 1503 - ErrNoParts = 1504 - ErrPartitionMgmtOnNonpartitioned = 1505 - ErrForeignKeyOnPartitioned = 1506 - ErrDropPartitionNonExistent = 1507 - ErrDropLastPartition = 1508 - ErrCoalesceOnlyOnHashPartition = 1509 - ErrReorgHashOnlyOnSameNo = 1510 - ErrReorgNoParam = 1511 - ErrOnlyOnRangeListPartition = 1512 - ErrAddPartitionSubpart = 1513 - ErrAddPartitionNoNewPartition = 1514 - ErrCoalescePartitionNoPartition = 1515 - ErrReorgPartitionNotExist = 1516 - ErrSameNamePartition = 1517 - ErrNoBinlog = 1518 - ErrConsecutiveReorgPartitions = 1519 - ErrReorgOutsideRange = 1520 - ErrPartitionFunctionFailure = 1521 - ErrPartState = 1522 - ErrLimitedPartRange = 1523 - ErrPluginIsNotLoaded = 1524 - ErrWrongValue = 1525 - ErrNoPartitionForGivenValue = 1526 - ErrFilegroupOptionOnlyOnce = 1527 - ErrCreateFilegroupFailed = 1528 - ErrDropFilegroupFailed = 1529 - ErrTablespaceAutoExtend = 1530 - ErrWrongSizeNumber = 1531 - ErrSizeOverflow = 1532 - ErrAlterFilegroupFailed = 1533 - ErrBinlogRowLoggingFailed = 1534 - ErrBinlogRowWrongTableDef = 1535 - ErrBinlogRowRbrToSbr = 1536 - ErrEventAlreadyExists = 1537 - ErrEventStoreFailed = 1538 - ErrEventDoesNotExist = 1539 - ErrEventCantAlter = 1540 - ErrEventDropFailed = 1541 - ErrEventIntervalNotPositiveOrTooBig = 1542 - ErrEventEndsBeforeStarts = 1543 - ErrEventExecTimeInThePast = 1544 - ErrEventOpenTableFailed = 1545 - ErrEventNeitherMExprNorMAt = 1546 - ErrObsoleteColCountDoesntMatchCorrupted = 1547 - ErrObsoleteCannotLoadFromTable = 1548 - ErrEventCannotDelete = 1549 - ErrEventCompile = 1550 - ErrEventSameName = 1551 - ErrEventDataTooLong = 1552 - ErrDropIndexNeededInForeignKey = 1553 - ErrWarnDeprecatedSyntaxWithVer = 1554 - ErrCantWriteLockLogTable = 1555 - ErrCantLockLogTable = 1556 - ErrForeignDuplicateKeyOldUnused = 1557 - ErrColCountDoesntMatchPleaseUpdate = 1558 - ErrTempTablePreventsSwitchOutOfRbr = 1559 - ErrStoredFunctionPreventsSwitchBinlogFormat = 1560 - ErrNdbCantSwitchBinlogFormat = 1561 - ErrPartitionNoTemporary = 1562 - ErrPartitionConstDomain = 1563 - ErrPartitionFunctionIsNotAllowed = 1564 - ErrDdlLog = 1565 - ErrNullInValuesLessThan = 1566 - ErrWrongPartitionName = 1567 - ErrCantChangeTxCharacteristics = 1568 - ErrDupEntryAutoincrementCase = 1569 - ErrEventModifyQueue = 1570 - ErrEventSetVar = 1571 - ErrPartitionMerge = 1572 - ErrCantActivateLog = 1573 - ErrRbrNotAvailable = 1574 - ErrBase64Decode = 1575 - ErrEventRecursionForbidden = 1576 - ErrEventsDB = 1577 - ErrOnlyIntegersAllowed = 1578 - ErrUnsuportedLogEngine = 1579 - ErrBadLogStatement = 1580 - ErrCantRenameLogTable = 1581 - ErrWrongParamcountToNativeFct = 1582 - ErrWrongParametersToNativeFct = 1583 - ErrWrongParametersToStoredFct = 1584 - ErrNativeFctNameCollision = 1585 - ErrDupEntryWithKeyName = 1586 - ErrBinlogPurgeEmFile = 1587 - ErrEventCannotCreateInThePast = 1588 - ErrEventCannotAlterInThePast = 1589 - ErrSlaveIncident = 1590 - ErrNoPartitionForGivenValueSilent = 1591 - ErrBinlogUnsafeStatement = 1592 - ErrSlaveFatal = 1593 - ErrSlaveRelayLogReadFailure = 1594 - ErrSlaveRelayLogWriteFailure = 1595 - ErrSlaveCreateEventFailure = 1596 - ErrSlaveMasterComFailure = 1597 - ErrBinlogLoggingImpossible = 1598 - ErrViewNoCreationCtx = 1599 - ErrViewInvalidCreationCtx = 1600 - ErrSrInvalidCreationCtx = 1601 - ErrTrgCorruptedFile = 1602 - ErrTrgNoCreationCtx = 1603 - ErrTrgInvalidCreationCtx = 1604 - ErrEventInvalidCreationCtx = 1605 - ErrTrgCantOpenTable = 1606 - ErrCantCreateSroutine = 1607 - ErrNeverUsed = 1608 - ErrNoFormatDescriptionEventBeforeBinlogStatement = 1609 - ErrSlaveCorruptEvent = 1610 - ErrLoadDataInvalidColumn = 1611 - ErrLogPurgeNoFile = 1612 - ErrXaRbtimeout = 1613 - ErrXaRbdeadlock = 1614 - ErrNeedReprepare = 1615 - ErrDelayedNotSupported = 1616 - WarnNoMasterInfo = 1617 - WarnOptionIgnored = 1618 - WarnPluginDeleteBuiltin = 1619 - WarnPluginBusy = 1620 - ErrVariableIsReadonly = 1621 - ErrWarnEngineTransactionRollback = 1622 - ErrSlaveHeartbeatFailure = 1623 - ErrSlaveHeartbeatValueOutOfRange = 1624 - ErrNdbReplicationSchema = 1625 - ErrConflictFnParse = 1626 - ErrExceptionsWrite = 1627 - ErrTooLongTableComment = 1628 - ErrTooLongFieldComment = 1629 - ErrFuncInexistentNameCollision = 1630 - ErrDatabaseName = 1631 - ErrTableName = 1632 - ErrPartitionName = 1633 - ErrSubpartitionName = 1634 - ErrTemporaryName = 1635 - ErrRenamedName = 1636 - ErrTooManyConcurrentTrxs = 1637 - WarnNonASCIISeparatorNotImplemented = 1638 - ErrDebugSyncTimeout = 1639 - ErrDebugSyncHitLimit = 1640 - ErrDupSignalSet = 1641 - ErrSignalWarn = 1642 - ErrSignalNotFound = 1643 - ErrSignalException = 1644 - ErrResignalWithoutActiveHandler = 1645 - ErrSignalBadConditionType = 1646 - WarnCondItemTruncated = 1647 - ErrCondItemTooLong = 1648 - ErrUnknownLocale = 1649 - ErrSlaveIgnoreServerIDs = 1650 - ErrQueryCacheDisabled = 1651 - ErrSameNamePartitionField = 1652 - ErrPartitionColumnList = 1653 - ErrWrongTypeColumnValue = 1654 - ErrTooManyPartitionFuncFields = 1655 - ErrMaxvalueInValuesIn = 1656 - ErrTooManyValues = 1657 - ErrRowSinglePartitionField = 1658 - ErrFieldTypeNotAllowedAsPartitionField = 1659 - ErrPartitionFieldsTooLong = 1660 - ErrBinlogRowEngineAndStmtEngine = 1661 - ErrBinlogRowModeAndStmtEngine = 1662 - ErrBinlogUnsafeAndStmtEngine = 1663 - ErrBinlogRowInjectionAndStmtEngine = 1664 - ErrBinlogStmtModeAndRowEngine = 1665 - ErrBinlogRowInjectionAndStmtMode = 1666 - ErrBinlogMultipleEnginesAndSelfLoggingEngine = 1667 - ErrBinlogUnsafeLimit = 1668 - ErrBinlogUnsafeInsertDelayed = 1669 - ErrBinlogUnsafeSystemTable = 1670 - ErrBinlogUnsafeAutoincColumns = 1671 - ErrBinlogUnsafeUdf = 1672 - ErrBinlogUnsafeSystemVariable = 1673 - ErrBinlogUnsafeSystemFunction = 1674 - ErrBinlogUnsafeNontransAfterTrans = 1675 - ErrMessageAndStatement = 1676 - ErrSlaveConversionFailed = 1677 - ErrSlaveCantCreateConversion = 1678 - ErrInsideTransactionPreventsSwitchBinlogFormat = 1679 - ErrPathLength = 1680 - ErrWarnDeprecatedSyntaxNoReplacement = 1681 - ErrWrongNativeTableStructure = 1682 - ErrWrongPerfSchemaUsage = 1683 - ErrWarnISSkippedTable = 1684 - ErrInsideTransactionPreventsSwitchBinlogDirect = 1685 - ErrStoredFunctionPreventsSwitchBinlogDirect = 1686 - ErrSpatialMustHaveGeomCol = 1687 - ErrTooLongIndexComment = 1688 - ErrLockAborted = 1689 - ErrDataOutOfRange = 1690 - ErrWrongSpvarTypeInLimit = 1691 - ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine = 1692 - ErrBinlogUnsafeMixedStatement = 1693 - ErrInsideTransactionPreventsSwitchSQLLogBin = 1694 - ErrStoredFunctionPreventsSwitchSQLLogBin = 1695 - ErrFailedReadFromParFile = 1696 - ErrValuesIsNotIntType = 1697 - ErrAccessDeniedNoPassword = 1698 - ErrSetPasswordAuthPlugin = 1699 - ErrGrantPluginUserExists = 1700 - ErrTruncateIllegalForeignKey = 1701 - ErrPluginIsPermanent = 1702 - ErrSlaveHeartbeatValueOutOfRangeMin = 1703 - ErrSlaveHeartbeatValueOutOfRangeMax = 1704 - ErrStmtCacheFull = 1705 - ErrMultiUpdateKeyConflict = 1706 - ErrTableNeedsRebuild = 1707 - WarnOptionBelowLimit = 1708 - ErrIndexColumnTooLong = 1709 - ErrErrorInTriggerBody = 1710 - ErrErrorInUnknownTriggerBody = 1711 - ErrIndexCorrupt = 1712 - ErrUndoRecordTooBig = 1713 - ErrBinlogUnsafeInsertIgnoreSelect = 1714 - ErrBinlogUnsafeInsertSelectUpdate = 1715 - ErrBinlogUnsafeReplaceSelect = 1716 - ErrBinlogUnsafeCreateIgnoreSelect = 1717 - ErrBinlogUnsafeCreateReplaceSelect = 1718 - ErrBinlogUnsafeUpdateIgnore = 1719 - ErrPluginNoUninstall = 1720 - ErrPluginNoInstall = 1721 - ErrBinlogUnsafeWriteAutoincSelect = 1722 - ErrBinlogUnsafeCreateSelectAutoinc = 1723 - ErrBinlogUnsafeInsertTwoKeys = 1724 - ErrTableInFkCheck = 1725 - ErrUnsupportedEngine = 1726 - ErrBinlogUnsafeAutoincNotFirst = 1727 - ErrCannotLoadFromTableV2 = 1728 - ErrMasterDelayValueOutOfRange = 1729 - ErrOnlyFdAndRbrEventsAllowedInBinlogStatement = 1730 - ErrPartitionExchangeDifferentOption = 1731 - ErrPartitionExchangePartTable = 1732 - ErrPartitionExchangeTempTable = 1733 - ErrPartitionInsteadOfSubpartition = 1734 - ErrUnknownPartition = 1735 - ErrTablesDifferentMetadata = 1736 - ErrRowDoesNotMatchPartition = 1737 - ErrBinlogCacheSizeGreaterThanMax = 1738 - ErrWarnIndexNotApplicable = 1739 - ErrPartitionExchangeForeignKey = 1740 - ErrNoSuchKeyValue = 1741 - ErrRplInfoDataTooLong = 1742 - ErrNetworkReadEventChecksumFailure = 1743 - ErrBinlogReadEventChecksumFailure = 1744 - ErrBinlogStmtCacheSizeGreaterThanMax = 1745 - ErrCantUpdateTableInCreateTableSelect = 1746 - ErrPartitionClauseOnNonpartitioned = 1747 - ErrRowDoesNotMatchGivenPartitionSet = 1748 - ErrNoSuchPartitionunused = 1749 - ErrChangeRplInfoRepositoryFailure = 1750 - ErrWarningNotCompleteRollbackWithCreatedTempTable = 1751 - ErrWarningNotCompleteRollbackWithDroppedTempTable = 1752 - ErrMtsFeatureIsNotSupported = 1753 - ErrMtsUpdatedDBsGreaterMax = 1754 - ErrMtsCantParallel = 1755 - ErrMtsInconsistentData = 1756 - ErrFulltextNotSupportedWithPartitioning = 1757 - ErrDaInvalidConditionNumber = 1758 - ErrInsecurePlainText = 1759 - ErrInsecureChangeMaster = 1760 - ErrForeignDuplicateKeyWithChildInfo = 1761 - ErrForeignDuplicateKeyWithoutChildInfo = 1762 - ErrSQLthreadWithSecureSlave = 1763 - ErrTableHasNoFt = 1764 - ErrVariableNotSettableInSfOrTrigger = 1765 - ErrVariableNotSettableInTransaction = 1766 - ErrGtidNextIsNotInGtidNextList = 1767 - ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull = 1768 - ErrSetStatementCannotInvokeFunction = 1769 - ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull = 1770 - ErrSkippingLoggedTransaction = 1771 - ErrMalformedGtidSetSpecification = 1772 - ErrMalformedGtidSetEncoding = 1773 - ErrMalformedGtidSpecification = 1774 - ErrGnoExhausted = 1775 - ErrBadSlaveAutoPosition = 1776 - ErrAutoPositionRequiresGtidModeOn = 1777 - ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet = 1778 - ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn = 1779 - ErrGtidModeRequiresBinlog = 1780 - ErrCantSetGtidNextToGtidWhenGtidModeIsOff = 1781 - ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn = 1782 - ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff = 1783 - ErrFoundGtidEventWhenGtidModeIsOff = 1784 - ErrGtidUnsafeNonTransactionalTable = 1785 - ErrGtidUnsafeCreateSelect = 1786 - ErrGtidUnsafeCreateDropTemporaryTableInTransaction = 1787 - ErrGtidModeCanOnlyChangeOneStepAtATime = 1788 - ErrMasterHasPurgedRequiredGtids = 1789 - ErrCantSetGtidNextWhenOwningGtid = 1790 - ErrUnknownExplainFormat = 1791 - ErrCantExecuteInReadOnlyTransaction = 1792 - ErrTooLongTablePartitionComment = 1793 - ErrSlaveConfiguration = 1794 - ErrInnodbFtLimit = 1795 - ErrInnodbNoFtTempTable = 1796 - ErrInnodbFtWrongDocidColumn = 1797 - ErrInnodbFtWrongDocidIndex = 1798 - ErrInnodbOnlineLogTooBig = 1799 - ErrUnknownAlterAlgorithm = 1800 - ErrUnknownAlterLock = 1801 - ErrMtsChangeMasterCantRunWithGaps = 1802 - ErrMtsRecoveryFailure = 1803 - ErrMtsResetWorkers = 1804 - ErrColCountDoesntMatchCorruptedV2 = 1805 - ErrSlaveSilentRetryTransaction = 1806 - ErrDiscardFkChecksRunning = 1807 - ErrTableSchemaMismatch = 1808 - ErrTableInSystemTablespace = 1809 - ErrIoRead = 1810 - ErrIoWrite = 1811 - ErrTablespaceMissing = 1812 - ErrTablespaceExists = 1813 - ErrTablespaceDiscarded = 1814 - ErrInternal = 1815 - ErrInnodbImport = 1816 - ErrInnodbIndexCorrupt = 1817 - ErrInvalidYearColumnLength = 1818 - ErrNotValidPassword = 1819 - ErrMustChangePassword = 1820 - ErrFkNoIndexChild = 1821 - ErrForeignKeyNoIndexInParent = 1822 - ErrFkFailAddSystem = 1823 - ErrForeignKeyCannotOpenParent = 1824 - ErrFkIncorrectOption = 1825 - ErrFkDupName = 1826 - ErrPasswordFormat = 1827 - ErrFkColumnCannotDrop = 1828 - ErrFkColumnCannotDropChild = 1829 - ErrForeignKeyColumnNotNull = 1830 - ErrDupIndex = 1831 - ErrForeignKeyColumnCannotChange = 1832 - ErrForeignKeyColumnCannotChangeChild = 1833 - ErrFkCannotDeleteParent = 1834 - ErrMalformedPacket = 1835 - ErrReadOnlyMode = 1836 - ErrGtidNextTypeUndefinedGroup = 1837 - ErrVariableNotSettableInSp = 1838 - ErrCantSetGtidPurgedWhenGtidModeIsOff = 1839 - ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty = 1840 - ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty = 1841 - ErrGtidPurgedWasChanged = 1842 - ErrGtidExecutedWasChanged = 1843 - ErrBinlogStmtModeAndNoReplTables = 1844 - ErrAlterOperationNotSupported = 1845 - ErrAlterOperationNotSupportedReason = 1846 - ErrAlterOperationNotSupportedReasonCopy = 1847 - ErrAlterOperationNotSupportedReasonPartition = 1848 - ErrAlterOperationNotSupportedReasonFkRename = 1849 - ErrAlterOperationNotSupportedReasonColumnType = 1850 - ErrAlterOperationNotSupportedReasonFkCheck = 1851 - ErrAlterOperationNotSupportedReasonIgnore = 1852 - ErrAlterOperationNotSupportedReasonNopk = 1853 - ErrAlterOperationNotSupportedReasonAutoinc = 1854 - ErrAlterOperationNotSupportedReasonHiddenFts = 1855 - ErrAlterOperationNotSupportedReasonChangeFts = 1856 - ErrAlterOperationNotSupportedReasonFts = 1857 - ErrSQLSlaveSkipCounterNotSettableInGtidMode = 1858 - ErrDupUnknownInIndex = 1859 - ErrIdentCausesTooLongPath = 1860 - ErrAlterOperationNotSupportedReasonNotNull = 1861 - ErrMustChangePasswordLogin = 1862 - ErrRowInWrongPartition = 1863 - ErrErrorLast = 1863 - ErrInvalidFieldSize = 3013 - ErrPasswordExpireAnonymousUser = 3016 - ErrMaxExecTimeExceeded = 3024 - ErrIncorrectType = 3064 - ErrInvalidJSONData = 3069 - ErrGeneratedColumnFunctionIsNotAllowed = 3102 - ErrUnsupportedAlterInplaceOnVirtualColumn = 3103 - ErrWrongFKOptionForGeneratedColumn = 3104 - ErrBadGeneratedColumn = 3105 - ErrUnsupportedOnGeneratedColumn = 3106 - ErrGeneratedColumnNonPrior = 3107 - ErrDependentByGeneratedColumn = 3108 - ErrGeneratedColumnRefAutoInc = 3109 - ErrInvalidJSONText = 3140 - ErrInvalidJSONTextInParam = 3141 - ErrInvalidJSONPath = 3143 - ErrInvalidJSONCharset = 3144 - ErrInvalidTypeForJSON = 3146 - ErrInvalidJSONPathWildcard = 3149 - ErrInvalidJSONContainsPathType = 3150 - ErrJSONUsedAsKey = 3152 - ErrJSONVacuousPath = 3153 - ErrJSONBadOneOrAllArg = 3154 - ErrJSONDocumentTooDeep = 3157 - ErrJSONDocumentNULLKey = 3158 - ErrBadUser = 3162 - ErrUserAlreadyExists = 3163 - ErrInvalidJSONPathArrayCell = 3165 - ErrInvalidEncryptionOption = 3184 - ErrRoleNotGranted = 3530 - ErrLockAcquireFailAndNoWaitSet = 3572 - ErrWindowNoSuchWindow = 3579 - ErrWindowCircularityInWindowGraph = 3580 - ErrWindowNoChildPartitioning = 3581 - ErrWindowNoInherentFrame = 3582 - ErrWindowNoRedefineOrderBy = 3583 - ErrWindowFrameStartIllegal = 3584 - ErrWindowFrameEndIllegal = 3585 - ErrWindowFrameIllegal = 3586 - ErrWindowRangeFrameOrderType = 3587 - ErrWindowRangeFrameTemporalType = 3588 - ErrWindowRangeFrameNumericType = 3589 - ErrWindowRangeBoundNotConstant = 3590 - ErrWindowDuplicateName = 3591 - ErrWindowIllegalOrderBy = 3592 - ErrWindowInvalidWindowFuncUse = 3593 - ErrWindowInvalidWindowFuncAliasUse = 3594 - ErrWindowNestedWindowFuncUseInWindowSpec = 3595 - ErrWindowRowsIntervalUse = 3596 - ErrWindowNoGroupOrderUnused = 3597 - ErrWindowExplainJson = 3598 //nolint: revive - ErrWindowFunctionIgnoresFrame = 3599 - ErrDataTruncatedFunctionalIndex = 3751 - ErrDataOutOfRangeFunctionalIndex = 3752 - ErrFunctionalIndexOnJsonOrGeometryFunction = 3753 //nolint: revive - ErrFunctionalIndexRefAutoIncrement = 3754 - ErrCannotDropColumnFunctionalIndex = 3755 - ErrFunctionalIndexPrimaryKey = 3756 - ErrFunctionalIndexOnLob = 3757 - ErrFunctionalIndexFunctionIsNotAllowed = 3758 - ErrFulltextFunctionalIndex = 3759 - ErrSpatialFunctionalIndex = 3760 - ErrWrongKeyColumnFunctionalIndex = 3761 - ErrFunctionalIndexOnField = 3762 - ErrFKIncompatibleColumns = 3780 - ErrFunctionalIndexRowValueIsNotAllowed = 3800 - ErrDependentByFunctionalIndex = 3837 - ErrInvalidJSONType = 3853 - ErrInvalidJsonValueForFuncIndex = 3903 //nolint: revive - ErrJsonValueOutOfRangeForFuncIndex = 3904 //nolint: revive - ErrFunctionalIndexDataIsTooLong = 3907 - ErrFunctionalIndexNotApplicable = 3909 - - // MariaDB errors. - ErrOnlyOneDefaultPartionAllowed = 4030 - ErrWrongPartitionTypeExpectedSystemTime = 4113 - ErrSystemVersioningWrongPartitions = 4128 - ErrSequenceRunOut = 4135 - ErrSequenceInvalidData = 4136 - ErrSequenceAccessFail = 4137 - ErrNotSequence = 4138 - ErrUnknownSequence = 4139 - ErrWrongInsertIntoSequence = 4140 - ErrSequenceInvalidTableStructure = 4141 - - // TiDB self-defined errors. - ErrWarnOptimizerHintUnsupportedHint = 8061 - ErrWarnOptimizerHintInvalidToken = 8062 - ErrWarnMemoryQuotaOverflow = 8063 - ErrWarnOptimizerHintParseError = 8064 - ErrWarnOptimizerHintInvalidInteger = 8065 - ErrWarnOptimizerHintWrongPos = 8066 - - // Stop adding error code here! - // They are moved to github.com/pingcap/tidb/pkg/errno -) diff --git a/pkg/parser/mysql/errname.go b/pkg/parser/mysql/errname.go deleted file mode 100644 index 845c50a21bcec..0000000000000 --- a/pkg/parser/mysql/errname.go +++ /dev/null @@ -1,985 +0,0 @@ -// Copyright 2015 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package mysql - -// ErrMessage is a error message with the format specifier. -type ErrMessage struct { - Raw string - RedactArgPos []int -} - -// Message creates a error message with the format specifier. -func Message(message string, redactArgs []int) *ErrMessage { - return &ErrMessage{Raw: message, RedactArgPos: redactArgs} -} - -// MySQLErrName maps error code to MySQL error messages. -var MySQLErrName = map[uint16]*ErrMessage{ - ErrHashchk: Message("hashchk", nil), - ErrNisamchk: Message("isamchk", nil), - ErrNo: Message("NO", nil), - ErrYes: Message("YES", nil), - ErrCantCreateFile: Message("Can't create file '%-.200s' (errno: %d - %s)", nil), - ErrCantCreateTable: Message("Can't create table '%-.200s' (errno: %d)", nil), - ErrCantCreateDB: Message("Can't create database '%-.192s' (errno: %d)", nil), - ErrDBCreateExists: Message("Can't create database '%-.192s'; database exists", nil), - ErrDBDropExists: Message("Can't drop database '%-.192s'; database doesn't exist", nil), - ErrDBDropDelete: Message("Error dropping database (can't delete '%-.192s', errno: %d)", nil), - ErrDBDropRmdir: Message("Error dropping database (can't rmdir '%-.192s', errno: %d)", nil), - ErrCantDeleteFile: Message("Error on delete of '%-.192s' (errno: %d - %s)", nil), - ErrCantFindSystemRec: Message("Can't read record in system table", nil), - ErrCantGetStat: Message("Can't get status of '%-.200s' (errno: %d - %s)", nil), - ErrCantGetWd: Message("Can't get working directory (errno: %d - %s)", nil), - ErrCantLock: Message("Can't lock file (errno: %d - %s)", nil), - ErrCantOpenFile: Message("Can't open file: '%-.200s' (errno: %d - %s)", nil), - ErrFileNotFound: Message("Can't find file: '%-.200s' (errno: %d - %s)", nil), - ErrCantReadDir: Message("Can't read dir of '%-.192s' (errno: %d - %s)", nil), - ErrCantSetWd: Message("Can't change dir to '%-.192s' (errno: %d - %s)", nil), - ErrCheckread: Message("Record has changed since last read in table '%-.192s'", nil), - ErrDiskFull: Message("Disk full (%s); waiting for someone to free some space... (errno: %d - %s)", nil), - ErrDupKey: Message("Can't write; duplicate key in table '%-.192s'", nil), - ErrErrorOnClose: Message("Error on close of '%-.192s' (errno: %d - %s)", nil), - ErrErrorOnRead: Message("Error reading file '%-.200s' (errno: %d - %s)", nil), - ErrErrorOnRename: Message("Error on rename of '%-.210s' to '%-.210s' (errno: %d - %s)", nil), - ErrErrorOnWrite: Message("Error writing file '%-.200s' (errno: %d - %s)", nil), - ErrFileUsed: Message("'%-.192s' is locked against change", nil), - ErrFilsortAbort: Message("Sort aborted", nil), - ErrFormNotFound: Message("View '%-.192s' doesn't exist for '%-.192s'", nil), - ErrGetErrno: Message("Got error %d from storage engine", nil), - ErrIllegalHa: Message("Table storage engine for '%-.192s' doesn't have this option", nil), - ErrKeyNotFound: Message("Can't find record in '%-.192s'", nil), - ErrNotFormFile: Message("Incorrect information in file: '%-.200s'", nil), - ErrNotKeyFile: Message("Incorrect key file for table '%-.200s'; try to repair it", nil), - ErrOldKeyFile: Message("Old key file for table '%-.192s'; repair it!", nil), - ErrOpenAsReadonly: Message("Table '%-.192s' is read only", nil), - ErrOutofMemory: Message("Out of memory; restart server and try again (needed %d bytes)", nil), - ErrOutOfSortMemory: Message("Out of sort memory, consider increasing server sort buffer size", nil), - ErrUnexpectedEOF: Message("Unexpected EOF found when reading file '%-.192s' (errno: %d - %s)", nil), - ErrConCount: Message("Too many connections", nil), - ErrOutOfResources: Message("Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", nil), - ErrBadHost: Message("Can't get hostname for your address", nil), - ErrHandshake: Message("Bad handshake", nil), - ErrDBaccessDenied: Message("Access denied for user '%-.48s'@'%-.64s' to database '%-.192s'", nil), - ErrAccessDenied: Message("Access denied for user '%-.48s'@'%-.64s' (using password: %s)", nil), - ErrNoDB: Message("No database selected", nil), - ErrUnknownCom: Message("Unknown command", nil), - ErrBadNull: Message("Column '%-.192s' cannot be null", nil), - ErrBadDB: Message("Unknown database '%-.192s'", nil), - ErrTableExists: Message("Table '%-.192s' already exists", nil), - ErrBadTable: Message("Unknown table '%-.100s'", nil), - ErrNonUniq: Message("Column '%-.192s' in %-.192s is ambiguous", nil), - ErrServerShutdown: Message("Server shutdown in progress", nil), - ErrBadField: Message("Unknown column '%-.192s' in '%-.192s'", nil), - ErrFieldNotInGroupBy: Message("Expression #%d of %s is not in GROUP BY clause and contains nonaggregated column '%s' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by", nil), - ErrWrongGroupField: Message("Can't group on '%-.192s'", nil), - ErrWrongSumSelect: Message("Statement has sum functions and columns in same statement", nil), - ErrWrongValueCount: Message("Column count doesn't match value count", nil), - ErrTooLongIdent: Message("Identifier name '%-.100s' is too long", nil), - ErrDupFieldName: Message("Duplicate column name '%-.192s'", nil), - ErrDupKeyName: Message("Duplicate key name '%-.192s'", nil), - ErrDupEntry: Message("Duplicate entry '%-.64s' for key '%-.192s'", nil), - ErrWrongFieldSpec: Message("Incorrect column specifier for column '%-.192s'", nil), - ErrParse: Message("%s %s", nil), - ErrEmptyQuery: Message("Query was empty", nil), - ErrNonuniqTable: Message("Not unique table/alias: '%-.192s'", nil), - ErrInvalidDefault: Message("Invalid default value for '%-.192s'", nil), - ErrMultiplePriKey: Message("Multiple primary key defined", nil), - ErrTooManyKeys: Message("Too many keys specified; max %d keys allowed", nil), - ErrTooManyKeyParts: Message("Too many key parts specified; max %d parts allowed", nil), - ErrTooLongKey: Message("Specified key was too long (%d bytes); max key length is %d bytes", nil), - ErrKeyColumnDoesNotExits: Message("Key column '%-.192s' doesn't exist in table", nil), - ErrBlobUsedAsKey: Message("BLOB column '%-.192s' can't be used in key specification with the used table type", nil), - ErrJSONVacuousPath: Message("The path expression '$' is not allowed in this context.", nil), - ErrJSONBadOneOrAllArg: Message("The oneOrAll argument to %s may take these values: 'one' or 'all'.", nil), - ErrTooBigFieldlength: Message("Column length too big for column '%-.192s' (max = %d); use BLOB or TEXT instead", nil), - ErrWrongAutoKey: Message("Incorrect table definition; there can be only one auto column and it must be defined as a key", nil), - ErrReady: Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d", nil), - ErrNormalShutdown: Message("%s: Normal shutdown\n", nil), - ErrGotSignal: Message("%s: Got signal %d. Aborting!\n", nil), - ErrShutdownComplete: Message("%s: Shutdown complete\n", nil), - ErrForcingClose: Message("%s: Forcing close of thread %d user: '%-.48s'\n", nil), - ErrIpsock: Message("Can't create IP socket", nil), - ErrNoSuchIndex: Message("Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table", nil), - ErrWrongFieldTerminators: Message("Field separator argument is not what is expected; check the manual", nil), - ErrBlobsAndNoTerminated: Message("You can't use fixed rowlength with BLOBs; please use 'fields terminated by'", nil), - ErrTextFileNotReadable: Message("The file '%-.128s' must be in the database directory or be readable by all", nil), - ErrFileExists: Message("File '%-.200s' already exists", nil), - ErrLoadInfo: Message("Records: %d Deleted: %d Skipped: %d Warnings: %d", nil), - ErrAlterInfo: Message("Records: %d Duplicates: %d", nil), - ErrWrongSubKey: Message("Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys", nil), - ErrCantRemoveAllFields: Message("You can't delete all columns with ALTER TABLE; use DROP TABLE instead", nil), - ErrCantDropFieldOrKey: Message("Can't DROP '%-.192s'; check that column/key exists", nil), - ErrInsertInfo: Message("Records: %d Duplicates: %d Warnings: %d", nil), - ErrUpdateTableUsed: Message("You can't specify target table '%-.192s' for update in FROM clause", nil), - ErrNoSuchThread: Message("Unknown thread id: %d", nil), - ErrKillDenied: Message("You are not owner of thread %d", nil), - ErrNoTablesUsed: Message("No tables used", nil), - ErrTooBigSet: Message("Too many strings for column %-.192s and SET", nil), - ErrNoUniqueLogFile: Message("Can't generate a unique log-filename %-.200s.(1-999)\n", nil), - ErrTableNotLockedForWrite: Message("Table '%-.192s' was locked with a READ lock and can't be updated", nil), - ErrTableNotLocked: Message("Table '%-.192s' was not locked with LOCK TABLES", nil), - ErrBlobCantHaveDefault: Message("BLOB/TEXT/JSON column '%-.192s' can't have a default value", nil), - ErrWrongDBName: Message("Incorrect database name '%-.100s'", nil), - ErrWrongTableName: Message("Incorrect table name '%-.100s'", nil), - ErrTooBigSelect: Message("The SELECT would examine more than MAXJOINSIZE rows; check your WHERE and use SET SQLBIGSELECTS=1 or SET MAXJOINSIZE=# if the SELECT is okay", nil), - ErrUnknown: Message("Unknown error", nil), - ErrUnknownProcedure: Message("Unknown procedure '%-.192s'", nil), - ErrWrongParamcountToProcedure: Message("Incorrect parameter count to procedure '%-.192s'", nil), - ErrWrongParametersToProcedure: Message("Incorrect parameters to procedure '%-.192s'", nil), - ErrUnknownTable: Message("Unknown table '%-.192s' in %-.32s", nil), - ErrFieldSpecifiedTwice: Message("Column '%-.192s' specified twice", nil), - ErrInvalidGroupFuncUse: Message("Invalid use of group function", nil), - ErrUnsupportedExtension: Message("Table '%-.192s' uses an extension that doesn't exist in this MySQL version", nil), - ErrTableMustHaveColumns: Message("A table must have at least 1 column", nil), - ErrRecordFileFull: Message("The table '%-.192s' is full", nil), - ErrUnknownCharacterSet: Message("Unknown character set: '%-.64s'", nil), - ErrTooManyTables: Message("Too many tables; MySQL can only use %d tables in a join", nil), - ErrTooManyFields: Message("Too many columns", nil), - ErrTooBigRowsize: Message("Row size too large. The maximum row size for the used table type, not counting BLOBs, is %d. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs", nil), - ErrStackOverrun: Message("Thread stack overrun: Used: %d of a %d stack. Use 'mysqld --threadStack=#' to specify a bigger stack if needed", nil), - ErrWrongOuterJoin: Message("Cross dependency found in OUTER JOIN; examine your ON conditions", nil), - ErrNullColumnInIndex: Message("Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler", nil), - ErrCantFindUdf: Message("Can't load function '%-.192s'", nil), - ErrCantInitializeUdf: Message("Can't initialize function '%-.192s'; %-.80s", nil), - ErrUdfNoPaths: Message("No paths allowed for shared library", nil), - ErrUdfExists: Message("Function '%-.192s' already exists", nil), - ErrCantOpenLibrary: Message("Can't open shared library '%-.192s' (errno: %d %-.128s)", nil), - ErrCantFindDlEntry: Message("Can't find symbol '%-.128s' in library", nil), - ErrFunctionNotDefined: Message("Function '%-.192s' is not defined", nil), - ErrHostIsBlocked: Message("Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", nil), - ErrHostNotPrivileged: Message("Host '%-.64s' is not allowed to connect to this MySQL server", nil), - ErrPasswordAnonymousUser: Message("You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", nil), - ErrPasswordNotAllowed: Message("You must have privileges to update tables in the mysql database to be able to change passwords for others", nil), - ErrPasswordNoMatch: Message("Can't find any matching row in the user table", nil), - ErrUpdateInfo: Message("Rows matched: %d Changed: %d Warnings: %d", nil), - ErrCantCreateThread: Message("Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", nil), - ErrWrongValueCountOnRow: Message("Column count doesn't match value count at row %d", nil), - ErrCantReopenTable: Message("Can't reopen table: '%-.192s'", nil), - ErrInvalidUseOfNull: Message("Invalid use of NULL value", nil), - ErrRegexp: Message("Got error '%-.64s' from regexp", nil), - ErrMixOfGroupFuncAndFields: Message("Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", nil), - ErrNonexistingGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.64s'", nil), - ErrTableaccessDenied: Message("%-.128s command denied to user '%-.48s'@'%-.64s' for table '%-.64s'", nil), - ErrColumnaccessDenied: Message("%-.16s command denied to user '%-.48s'@'%-.64s' for column '%-.192s' in table '%-.192s'", nil), - ErrIllegalGrantForTable: Message("Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used", nil), - ErrGrantWrongHostOrUser: Message("The host or user argument to GRANT is too long", nil), - ErrNoSuchTable: Message("Table '%-.192s.%-.192s' doesn't exist", nil), - ErrNonexistingTableGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'", nil), - ErrNotAllowedCommand: Message("The used command is not allowed with this MySQL version", nil), - ErrSyntax: Message("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use", nil), - ErrDelayedCantChangeLock: Message("Delayed insert thread couldn't get requested lock for table %-.192s", nil), - ErrTooManyDelayedThreads: Message("Too many delayed threads in use", nil), - ErrAbortingConnection: Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' (%-.64s)", nil), - ErrNetPacketTooLarge: Message("Got a packet bigger than 'max_allowed_packet' bytes", nil), - ErrNetReadErrorFromPipe: Message("Got a read error from the connection pipe", nil), - ErrNetFcntl: Message("Got an error from fcntl()", nil), - ErrNetPacketsOutOfOrder: Message("Got packets out of order", nil), - ErrNetUncompress: Message("Couldn't uncompress communication packet", nil), - ErrNetRead: Message("Got an error reading communication packets", nil), - ErrNetReadInterrupted: Message("Got timeout reading communication packets", nil), - ErrNetErrorOnWrite: Message("Got an error writing communication packets", nil), - ErrNetWriteInterrupted: Message("Got timeout writing communication packets", nil), - ErrTooLongString: Message("Result string is longer than 'maxAllowedPacket' bytes", nil), - ErrTableCantHandleBlob: Message("The used table type doesn't support BLOB/TEXT columns", nil), - ErrTableCantHandleAutoIncrement: Message("The used table type doesn't support AUTOINCREMENT columns", nil), - ErrDelayedInsertTableLocked: Message("INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES", nil), - ErrWrongColumnName: Message("Incorrect column name '%-.100s'", nil), - ErrWrongKeyColumn: Message("The used storage engine can't index column '%-.192s'", nil), - ErrWrongMrgTable: Message("Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist", nil), - ErrDupUnique: Message("Can't write, because of unique constraint, to table '%-.192s'", nil), - ErrBlobKeyWithoutLength: Message("BLOB/TEXT column '%-.192s' used in key specification without a key length", nil), - ErrPrimaryCantHaveNull: Message("All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", nil), - ErrTooManyRows: Message("Result consisted of more than one row", nil), - ErrRequiresPrimaryKey: Message("This table type requires a primary key", nil), - ErrNoRaidCompiled: Message("This version of MySQL is not compiled with RAID support", nil), - ErrUpdateWithoutKeyInSafeMode: Message("You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", nil), - ErrKeyDoesNotExist: Message("Key '%-.192s' doesn't exist in table '%-.192s'", nil), - ErrCheckNoSuchTable: Message("Can't open table", nil), - ErrCheckNotImplemented: Message("The storage engine for the table doesn't support %s", nil), - ErrCantDoThisDuringAnTransaction: Message("You are not allowed to execute this command in a transaction", nil), - ErrErrorDuringCommit: Message("Got error %d during COMMIT", nil), - ErrErrorDuringRollback: Message("Got error %d during ROLLBACK", nil), - ErrErrorDuringFlushLogs: Message("Got error %d during FLUSHLOGS", nil), - ErrErrorDuringCheckpoint: Message("Got error %d during CHECKPOINT", nil), - ErrNewAbortingConnection: Message("Aborted connection %d to db: '%-.192s' user: '%-.48s' host: '%-.64s' (%-.64s)", nil), - ErrDumpNotImplemented: Message("The storage engine for the table does not support binary table dump", nil), - ErrFlushMasterBinlogClosed: Message("Binlog closed, cannot RESET MASTER", nil), - ErrIndexRebuild: Message("Failed rebuilding the index of dumped table '%-.192s'", nil), - ErrMaster: Message("Error from master: '%-.64s'", nil), - ErrMasterNetRead: Message("Net error reading from master", nil), - ErrMasterNetWrite: Message("Net error writing to master", nil), - ErrFtMatchingKeyNotFound: Message("Can't find FULLTEXT index matching the column list", nil), - ErrLockOrActiveTransaction: Message("Can't execute the given command because you have active locked tables or an active transaction", nil), - ErrUnknownSystemVariable: Message("Unknown system variable '%-.64s'", nil), - ErrCrashedOnUsage: Message("Table '%-.192s' is marked as crashed and should be repaired", nil), - ErrCrashedOnRepair: Message("Table '%-.192s' is marked as crashed and last (automatic?) repair failed", nil), - ErrWarningNotCompleteRollback: Message("Some non-transactional changed tables couldn't be rolled back", nil), - ErrTransCacheFull: Message("Multi-statement transaction required more than 'maxBinlogCacheSize' bytes of storage; increase this mysqld variable and try again", nil), - ErrSlaveMustStop: Message("This operation cannot be performed with a running slave; run STOP SLAVE first", nil), - ErrSlaveNotRunning: Message("This operation requires a running slave; configure slave and do START SLAVE", nil), - ErrBadSlave: Message("The server is not configured as slave; fix in config file or with CHANGE MASTER TO", nil), - ErrMasterInfo: Message("Could not initialize master info structure; more error messages can be found in the MySQL error log", nil), - ErrSlaveThread: Message("Could not create slave thread; check system resources", nil), - ErrTooManyUserConnections: Message("User %-.64s already has more than 'maxUserConnections' active connections", nil), - ErrSetConstantsOnly: Message("You may only use constant expressions with SET", nil), - ErrLockWaitTimeout: Message("Lock wait timeout exceeded; try restarting transaction", nil), - ErrLockTableFull: Message("The total number of locks exceeds the lock table size", nil), - ErrReadOnlyTransaction: Message("Update locks cannot be acquired during a READ UNCOMMITTED transaction", nil), - ErrDropDBWithReadLock: Message("DROP DATABASE not allowed while thread is holding global read lock", nil), - ErrCreateDBWithReadLock: Message("CREATE DATABASE not allowed while thread is holding global read lock", nil), - ErrWrongArguments: Message("Incorrect arguments to %s", nil), - ErrNoPermissionToCreateUser: Message("'%-.48s'@'%-.64s' is not allowed to create new users", nil), - ErrUnionTablesInDifferentDir: Message("Incorrect table definition; all MERGE tables must be in the same database", nil), - ErrLockDeadlock: Message("Deadlock found when trying to get lock; try restarting transaction", nil), - ErrTableCantHandleFt: Message("The used table type doesn't support FULLTEXT indexes", nil), - ErrCannotAddForeign: Message("Cannot add foreign key constraint", nil), - ErrNoReferencedRow: Message("Cannot add or update a child row: a foreign key constraint fails", nil), - ErrRowIsReferenced: Message("Cannot delete or update a parent row: a foreign key constraint fails", nil), - ErrConnectToMaster: Message("Error connecting to master: %-.128s", nil), - ErrQueryOnMaster: Message("Error running query on master: %-.128s", nil), - ErrErrorWhenExecutingCommand: Message("Error when executing command %s: %-.128s", nil), - ErrWrongUsage: Message("Incorrect usage of %s and %s", nil), - ErrWrongNumberOfColumnsInSelect: Message("The used SELECT statements have a different number of columns", nil), - ErrCantUpdateWithReadlock: Message("Can't execute the query because you have a conflicting read lock", nil), - ErrMixingNotAllowed: Message("Mixing of transactional and non-transactional tables is disabled", nil), - ErrDupArgument: Message("Option '%s' used twice in statement", nil), - ErrUserLimitReached: Message("User '%-.64s' has exceeded the '%s' resource (current value: %d)", nil), - ErrSpecificAccessDenied: Message("Access denied; you need (at least one of) the %-.128s privilege(s) for this operation", nil), - ErrLocalVariable: Message("Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", nil), - ErrGlobalVariable: Message("Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", nil), - ErrNoDefault: Message("Variable '%-.64s' doesn't have a default value", nil), - ErrWrongValueForVar: Message("Variable '%-.64s' can't be set to the value of '%-.200s'", nil), - ErrWrongTypeForVar: Message("Incorrect argument type to variable '%-.64s'", nil), - ErrVarCantBeRead: Message("Variable '%-.64s' can only be set, not read", nil), - ErrCantUseOptionHere: Message("Incorrect usage/placement of '%s'", nil), - ErrNotSupportedYet: Message("This version of TiDB doesn't yet support '%s'", nil), - ErrMasterFatalErrorReadingBinlog: Message("Got fatal error %d from master when reading data from binary log: '%-.320s'", nil), - ErrSlaveIgnoredTable: Message("Slave SQL thread ignored the query because of replicate-*-table rules", nil), - ErrIncorrectGlobalLocalVar: Message("Variable '%-.192s' is a %s variable", nil), - ErrWrongFkDef: Message("Incorrect foreign key definition for '%-.192s': %s", nil), - ErrKeyRefDoNotMatchTableRef: Message("Key reference and table reference don't match", nil), - ErrOperandColumns: Message("Operand should contain %d column(s)", nil), - ErrSubqueryNo1Row: Message("Subquery returns more than 1 row", nil), - ErrUnknownStmtHandler: Message("Unknown prepared statement handler %s given to %s", nil), - ErrCorruptHelpDB: Message("Help database is corrupt or does not exist", nil), - ErrCyclicReference: Message("Cyclic reference on subqueries", nil), - ErrAutoConvert: Message("Converting column '%s' from %s to %s", nil), - ErrIllegalReference: Message("Reference '%-.64s' not supported (%s)", nil), - ErrDerivedMustHaveAlias: Message("Every derived table must have its own alias", nil), - ErrSelectReduced: Message("Select %d was reduced during optimization", nil), - ErrTablenameNotAllowedHere: Message("Table '%s' from one of the %ss cannot be used in %s", nil), - ErrNotSupportedAuthMode: Message("Client does not support authentication protocol requested by server; consider upgrading MySQL client", nil), - ErrSpatialCantHaveNull: Message("All parts of a SPATIAL index must be NOT NULL", nil), - ErrCollationCharsetMismatch: Message("COLLATION '%s' is not valid for CHARACTER SET '%s'", nil), - ErrSlaveWasRunning: Message("Slave is already running", nil), - ErrSlaveWasNotRunning: Message("Slave already has been stopped", nil), - ErrTooBigForUncompress: Message("Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", nil), - ErrZlibZMem: Message("ZLIB: Not enough memory", nil), - ErrZlibZBuf: Message("ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", nil), - ErrZlibZData: Message("ZLIB: Input data corrupted", nil), - ErrCutValueGroupConcat: Message("Some rows were cut by GROUPCONCAT(%s)", nil), - ErrWarnTooFewRecords: Message("Row %d doesn't contain data for all columns", nil), - ErrWarnTooManyRecords: Message("Row %d was truncated; it contained more data than there were input columns", nil), - ErrWarnNullToNotnull: Message("Column set to default value; NULL supplied to NOT NULL column '%s' at row %d", nil), - ErrWarnDataOutOfRange: Message("Out of range value for column '%s' at row %d", nil), - WarnDataTruncated: Message("Data truncated for column '%s' at row %d", nil), - ErrWarnUsingOtherHandler: Message("Using storage engine %s for table '%s'", nil), - ErrCantAggregate2collations: Message("Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", nil), - ErrDropUser: Message("Cannot drop one or more of the requested users", nil), - ErrRevokeGrants: Message("Can't revoke all privileges for one or more of the requested users", nil), - ErrCantAggregate3collations: Message("Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", nil), - ErrCantAggregateNcollations: Message("Illegal mix of collations for operation '%s'", nil), - ErrVariableIsNotStruct: Message("Variable '%-.64s' is not a variable component (can't be used as XXXX.variableName)", nil), - ErrUnknownCollation: Message("Unknown collation: '%-.64s'", nil), - ErrSlaveIgnoredSslParams: Message("SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", nil), - ErrServerIsInSecureAuthMode: Message("Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", nil), - ErrWarnFieldResolved: Message("Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d", nil), - ErrBadSlaveUntilCond: Message("Incorrect parameter or combination of parameters for START SLAVE UNTIL", nil), - ErrMissingSkipSlave: Message("It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart", nil), - ErrUntilCondIgnored: Message("SQL thread is not to be started so UNTIL options are ignored", nil), - ErrWrongNameForIndex: Message("Incorrect index name '%-.100s'", nil), - ErrWrongNameForCatalog: Message("Incorrect catalog name '%-.100s'", nil), - ErrWarnQcResize: Message("Query cache failed to set size %d; new query cache size is %d", nil), - ErrBadFtColumn: Message("Column '%-.192s' cannot be part of FULLTEXT index", nil), - ErrUnknownKeyCache: Message("Unknown key cache '%-.100s'", nil), - ErrWarnHostnameWontWork: Message("MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work", nil), - ErrUnknownStorageEngine: Message("Unknown storage engine '%s'", nil), - ErrWarnDeprecatedSyntax: Message("'%s' is deprecated and will be removed in a future release. Please use %s instead", nil), - ErrNonUpdatableTable: Message("The target table %-.100s of the %s is not updatable", nil), - ErrFeatureDisabled: Message("The '%s' feature is disabled; you need MySQL built with '%s' to have it working", nil), - ErrOptionPreventsStatement: Message("The MySQL server is running with the %s option so it cannot execute this statement", nil), - ErrDuplicatedValueInType: Message("Column '%-.100s' has duplicated value '%-.64s' in %s", nil), - ErrTruncatedWrongValue: Message("Truncated incorrect %-.64s value: '%-.128s'", nil), - ErrTooMuchAutoTimestampCols: Message("Incorrect table definition; there can be only one TIMESTAMP column with CURRENTTIMESTAMP in DEFAULT or ON UPDATE clause", nil), - ErrInvalidOnUpdate: Message("Invalid ON UPDATE clause for '%-.192s' column", nil), - ErrUnsupportedPs: Message("This command is not supported in the prepared statement protocol yet", nil), - ErrGetErrmsg: Message("Got error %d '%-.100s' from %s", nil), - ErrGetTemporaryErrmsg: Message("Got temporary error %d '%-.100s' from %s", nil), - ErrUnknownTimeZone: Message("Unknown or incorrect time zone: '%-.64s'", nil), - ErrWarnInvalidTimestamp: Message("Invalid TIMESTAMP value in column '%s' at row %d", nil), - ErrInvalidCharacterString: Message("Invalid %s character string: '%.64s'", nil), - ErrWarnAllowedPacketOverflowed: Message("Result of %s() was larger than max_allowed_packet (%d) - truncated", nil), - ErrConflictingDeclarations: Message("Conflicting declarations: '%s%s' and '%s%s'", nil), - ErrSpNoRecursiveCreate: Message("Can't create a %s from within another stored routine", nil), - ErrSpAlreadyExists: Message("%s %s already exists", nil), - ErrSpDoesNotExist: Message("%s %s does not exist", nil), - ErrSpDropFailed: Message("Failed to DROP %s %s", nil), - ErrSpStoreFailed: Message("Failed to CREATE %s %s", nil), - ErrSpLilabelMismatch: Message("%s with no matching label: %s", nil), - ErrSpLabelRedefine: Message("Redefining label %s", nil), - ErrSpLabelMismatch: Message("End-label %s without match", nil), - ErrSpUninitVar: Message("Referring to uninitialized variable %s", nil), - ErrSpBadselect: Message("PROCEDURE %s can't return a result set in the given context", nil), - ErrSpBadreturn: Message("RETURN is only allowed in a FUNCTION", nil), - ErrSpBadstatement: Message("%s is not allowed in stored procedures", nil), - ErrUpdateLogDeprecatedIgnored: Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been ignored.", nil), - ErrUpdateLogDeprecatedTranslated: Message("The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been translated to SET SQLLOGBIN.", nil), - ErrQueryInterrupted: Message("Query execution was interrupted", nil), - ErrSpWrongNoOfArgs: Message("Incorrect number of arguments for %s %s; expected %d, got %d", nil), - ErrSpCondMismatch: Message("Undefined CONDITION: %s", nil), - ErrSpNoreturn: Message("No RETURN found in FUNCTION %s", nil), - ErrSpNoreturnend: Message("FUNCTION %s ended without RETURN", nil), - ErrSpBadCursorQuery: Message("Cursor statement must be a SELECT", nil), - ErrSpBadCursorSelect: Message("Cursor SELECT must not have INTO", nil), - ErrSpCursorMismatch: Message("Undefined CURSOR: %s", nil), - ErrSpCursorAlreadyOpen: Message("Cursor is already open", nil), - ErrSpCursorNotOpen: Message("Cursor is not open", nil), - ErrSpUndeclaredVar: Message("Undeclared variable: %s", nil), - ErrSpWrongNoOfFetchArgs: Message("Incorrect number of FETCH variables", nil), - ErrSpFetchNoData: Message("No data - zero rows fetched, selected, or processed", nil), - ErrSpDupParam: Message("Duplicate parameter: %s", nil), - ErrSpDupVar: Message("Duplicate variable: %s", nil), - ErrSpDupCond: Message("Duplicate condition: %s", nil), - ErrSpDupCurs: Message("Duplicate cursor: %s", nil), - ErrSpCantAlter: Message("Failed to ALTER %s %s", nil), - ErrSpSubselectNyi: Message("Subquery value not supported", nil), - ErrStmtNotAllowedInSfOrTrg: Message("%s is not allowed in stored function or trigger", nil), - ErrSpVarcondAfterCurshndlr: Message("Variable or condition declaration after cursor or handler declaration", nil), - ErrSpCursorAfterHandler: Message("Cursor declaration after handler declaration", nil), - ErrSpCaseNotFound: Message("Case not found for CASE statement", nil), - ErrFparserTooBigFile: Message("Configuration file '%-.192s' is too big", nil), - ErrFparserBadHeader: Message("Malformed file type header in file '%-.192s'", nil), - ErrFparserEOFInComment: Message("Unexpected end of file while parsing comment '%-.200s'", nil), - ErrFparserErrorInParameter: Message("Error while parsing parameter '%-.192s' (line: '%-.192s')", nil), - ErrFparserEOFInUnknownParameter: Message("Unexpected end of file while skipping unknown parameter '%-.192s'", nil), - ErrViewNoExplain: Message("EXPLAIN/SHOW can not be issued; lacking privileges for underlying table", nil), - ErrFrmUnknownType: Message("File '%-.192s' has unknown type '%-.64s' in its header", nil), - ErrWrongObject: Message("'%-.192s.%-.192s' is not %s", nil), - ErrNonupdateableColumn: Message("Column '%-.192s' is not updatable", nil), - ErrViewSelectDerived: Message("View's SELECT contains a subquery in the FROM clause", nil), - ErrViewSelectClause: Message("View's SELECT contains a '%s' clause", nil), - ErrViewSelectVariable: Message("View's SELECT contains a variable or parameter", nil), - ErrViewSelectTmptable: Message("View's SELECT refers to a temporary table '%-.192s'", nil), - ErrViewWrongList: Message("View's SELECT and view's field list have different column counts", nil), - ErrWarnViewMerge: Message("View merge algorithm can't be used here for now (assumed undefined algorithm)", nil), - ErrWarnViewWithoutKey: Message("View being updated does not have complete key of underlying table in it", nil), - ErrViewInvalid: Message("View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them", nil), - ErrSpNoDropSp: Message("Can't drop or alter a %s from within another stored routine", nil), - ErrSpGotoInHndlr: Message("GOTO is not allowed in a stored procedure handler", nil), - ErrTrgAlreadyExists: Message("Trigger already exists", nil), - ErrTrgDoesNotExist: Message("Trigger does not exist", nil), - ErrTrgOnViewOrTempTable: Message("Trigger's '%-.192s' is view or temporary table", nil), - ErrTrgCantChangeRow: Message("Updating of %s row is not allowed in %strigger", nil), - ErrTrgNoSuchRowInTrg: Message("There is no %s row in %s trigger", nil), - ErrNoDefaultForField: Message("Field '%-.192s' doesn't have a default value", nil), - ErrDivisionByZero: Message("Division by 0", nil), - ErrTruncatedWrongValueForField: Message("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %d", nil), - ErrIllegalValueForType: Message("Illegal %s '%-.192s' value found during parsing", nil), - ErrViewNonupdCheck: Message("CHECK OPTION on non-updatable view '%-.192s.%-.192s'", nil), - ErrViewCheckFailed: Message("CHECK OPTION failed '%-.192s.%-.192s'", nil), - ErrProcaccessDenied: Message("%-.16s command denied to user '%-.48s'@'%-.64s' for routine '%-.192s'", nil), - ErrRelayLogFail: Message("Failed purging old relay logs: %s", nil), - ErrPasswdLength: Message("Password hash should be a %d-digit hexadecimal number", nil), - ErrUnknownTargetBinlog: Message("Target log not found in binlog index", nil), - ErrIoErrLogIndexRead: Message("I/O error reading log index file", nil), - ErrBinlogPurgeProhibited: Message("Server configuration does not permit binlog purge", nil), - ErrFseekFail: Message("Failed on fseek()", nil), - ErrBinlogPurgeFatalErr: Message("Fatal error during log purge", nil), - ErrLogInUse: Message("A purgeable log is in use, will not purge", nil), - ErrLogPurgeUnknownErr: Message("Unknown error during log purge", nil), - ErrRelayLogInit: Message("Failed initializing relay log position: %s", nil), - ErrNoBinaryLogging: Message("You are not using binary logging", nil), - ErrReservedSyntax: Message("The '%-.64s' syntax is reserved for purposes internal to the MySQL server", nil), - ErrWsasFailed: Message("WSAStartup Failed", nil), - ErrDiffGroupsProc: Message("Can't handle procedures with different groups yet", nil), - ErrNoGroupForProc: Message("Select must have a group with this procedure", nil), - ErrOrderWithProc: Message("Can't use ORDER clause with this procedure", nil), - ErrLoggingProhibitChangingOf: Message("Binary logging and replication forbid changing the global server %s", nil), - ErrNoFileMapping: Message("Can't map file: %-.200s, errno: %d", nil), - ErrWrongMagic: Message("Wrong magic in %-.64s", nil), - ErrPsManyParam: Message("Prepared statement contains too many placeholders", nil), - ErrKeyPart0: Message("Key part '%-.192s' length cannot be 0", nil), - ErrViewChecksum: Message("View text checksum failed", nil), - ErrViewMultiupdate: Message("Can not modify more than one base table through a join view '%-.192s.%-.192s'", nil), - ErrViewNoInsertFieldList: Message("Can not insert into join view '%-.192s.%-.192s' without fields list", nil), - ErrViewDeleteMergeView: Message("Can not delete from join view '%-.192s.%-.192s'", nil), - ErrCannotUser: Message("Operation %s failed for %.256s", nil), - ErrXaerNota: Message("XAERNOTA: Unknown XID", nil), - ErrXaerInval: Message("XAERINVAL: Invalid arguments (or unsupported command)", nil), - ErrXaerRmfail: Message("XAERRMFAIL: The command cannot be executed when global transaction is in the %.64s state", nil), - ErrXaerOutside: Message("XAEROUTSIDE: Some work is done outside global transaction", nil), - ErrXaerRmerr: Message("XAERRMERR: Fatal error occurred in the transaction branch - check your data for consistency", nil), - ErrXaRbrollback: Message("XARBROLLBACK: Transaction branch was rolled back", nil), - ErrNonexistingProcGrant: Message("There is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'", nil), - ErrProcAutoGrantFail: Message("Failed to grant EXECUTE and ALTER ROUTINE privileges", nil), - ErrProcAutoRevokeFail: Message("Failed to revoke all privileges to dropped routine", nil), - ErrDataTooLong: Message("Data too long for column '%s' at row %d", nil), - ErrSpBadSQLstate: Message("Bad SQLSTATE: '%s'", nil), - ErrStartup: Message("%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d %s", nil), - ErrLoadFromFixedSizeRowsToVar: Message("Can't load value from file with fixed size rows to variable", nil), - ErrCantCreateUserWithGrant: Message("You are not allowed to create a user with GRANT", nil), - ErrWrongValueForType: Message("Incorrect %-.32s value: '%-.128s' for function %-.32s", nil), - ErrTableDefChanged: Message("Table definition has changed, please retry transaction", nil), - ErrSpDupHandler: Message("Duplicate handler declared in the same block", nil), - ErrSpNotVarArg: Message("OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger", nil), - ErrSpNoRetset: Message("Not allowed to return a result set from a %s", nil), - ErrCantCreateGeometryObject: Message("Cannot get geometry object from data you send to the GEOMETRY field", nil), - ErrFailedRoutineBreakBinlog: Message("A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes", nil), - ErrBinlogUnsafeRoutine: Message("This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), - ErrBinlogCreateRoutineNeedSuper: Message("You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)", nil), - ErrExecStmtWithOpenCursor: Message("You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it.", nil), - ErrStmtHasNoOpenCursor: Message("The statement (%d) has no open cursor.", nil), - ErrCommitNotAllowedInSfOrTrg: Message("Explicit or implicit commit is not allowed in stored function or trigger.", nil), - ErrNoDefaultForViewField: Message("Field of view '%-.192s.%-.192s' underlying table doesn't have a default value", nil), - ErrSpNoRecursion: Message("Recursive stored functions and triggers are not allowed.", nil), - ErrTooBigScale: Message("Too big scale %d specified for column '%-.192s'. Maximum is %d.", nil), - ErrTooBigPrecision: Message("Too-big precision %d specified for '%-.192s'. Maximum is %d.", nil), - ErrMBiggerThanD: Message("For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s').", nil), - ErrWrongLockOfSystemTable: Message("You can't combine write-locking of system tables with other tables or lock types", nil), - ErrConnectToForeignDataSource: Message("Unable to connect to foreign data source: %.64s", nil), - ErrQueryOnForeignDataSource: Message("There was a problem processing the query on the foreign data source. Data source : %-.64s", nil), - ErrForeignDataSourceDoesntExist: Message("The foreign data source you are trying to reference does not exist. Data source : %-.64s", nil), - ErrForeignDataStringInvalidCantCreate: Message("Can't create federated table. The data source connection string '%-.64s' is not in the correct format", nil), - ErrForeignDataStringInvalid: Message("The data source connection string '%-.64s' is not in the correct format", nil), - ErrCantCreateFederatedTable: Message("Can't create federated table. Foreign data src : %-.64s", nil), - ErrTrgInWrongSchema: Message("Trigger in wrong schema", nil), - ErrStackOverrunNeedMore: Message("Thread stack overrun: %d bytes used of a %d byte stack, and %d bytes needed. Use 'mysqld --threadStack=#' to specify a bigger stack.", nil), - ErrTooLongBody: Message("Routine body for '%-.100s' is too long", nil), - ErrWarnCantDropDefaultKeycache: Message("Cannot drop default keycache", nil), - ErrTooBigDisplaywidth: Message("Display width out of range for column '%-.192s' (max = %d)", nil), - ErrXaerDupid: Message("XAERDUPID: The XID already exists", nil), - ErrDatetimeFunctionOverflow: Message("Datetime function: %-.32s field overflow", nil), - ErrCantUpdateUsedTableInSfOrTrg: Message("Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.", nil), - ErrViewPreventUpdate: Message("The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'.", nil), - ErrPsNoRecursion: Message("The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner", nil), - ErrSpCantSetAutocommit: Message("Not allowed to set autocommit from a stored function or trigger", nil), - ErrMalformedDefiner: Message("Definer is not fully qualified", nil), - ErrViewFrmNoUser: Message("View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!", nil), - ErrViewOtherUser: Message("You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer", nil), - ErrNoSuchUser: Message("The user specified as a definer ('%-.64s'@'%-.64s') does not exist", nil), - ErrForbidSchemaChange: Message("Changing schema from '%-.192s' to '%-.192s' is not allowed.", nil), - ErrRowIsReferenced2: Message("Cannot delete or update a parent row: a foreign key constraint fails (%.192s)", nil), - ErrNoReferencedRow2: Message("Cannot add or update a child row: a foreign key constraint fails (%.192s)", nil), - ErrSpBadVarShadow: Message("Variable '%-.64s' must be quoted with `...`, or renamed", nil), - ErrTrgNoDefiner: Message("No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.", nil), - ErrOldFileFormat: Message("'%-.192s' has an old format, you should re-create the '%s' object(s)", nil), - ErrSpRecursionLimit: Message("Recursive limit %d (as set by the maxSpRecursionDepth variable) was exceeded for routine %.192s", nil), - ErrSpProcTableCorrupt: Message("Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)", nil), - ErrSpWrongName: Message("Incorrect routine name '%-.192s'", nil), - ErrTableNeedsUpgrade: Message("Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\"", nil), - ErrSpNoAggregate: Message("AGGREGATE is not supported for stored functions", nil), - ErrMaxPreparedStmtCountReached: Message("Can't create more than maxPreparedStmtCount statements (current value: %d)", nil), - ErrViewRecursive: Message("`%-.192s`.`%-.192s` contains view recursion", nil), - ErrNonGroupingFieldUsed: Message("Non-grouping field '%-.192s' is used in %-.64s clause", nil), - ErrTableCantHandleSpkeys: Message("The used table type doesn't support SPATIAL indexes", nil), - ErrNoTriggersOnSystemSchema: Message("Triggers can not be created on system tables", nil), - ErrRemovedSpaces: Message("Leading spaces are removed from name '%s'", nil), - ErrAutoincReadFailed: Message("Failed to read auto-increment value from storage engine", nil), - ErrUsername: Message("user name", nil), - ErrHostname: Message("host name", nil), - ErrWrongStringLength: Message("String '%-.70s' is too long for %s (should be no longer than %d)", nil), - ErrNonInsertableTable: Message("The target table %-.100s of the %s is not insertable-into", nil), - ErrAdminWrongMrgTable: Message("Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist", nil), - ErrTooHighLevelOfNestingForSelect: Message("Too high level of nesting for select", nil), - ErrNameBecomesEmpty: Message("Name '%-.64s' has become ''", nil), - ErrAmbiguousFieldTerm: Message("First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY", nil), - ErrForeignServerExists: Message("The foreign server, %s, you are trying to create already exists.", nil), - ErrForeignServerDoesntExist: Message("The foreign server name you are trying to reference does not exist. Data source : %-.64s", nil), - ErrIllegalHaCreateOption: Message("Table storage engine '%-.64s' does not support the create option '%.64s'", nil), - ErrPartitionRequiresValues: Message("Syntax : %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition", nil), - ErrPartitionWrongValues: Message("Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition", nil), - ErrPartitionMaxvalue: Message("MAXVALUE can only be used in last partition definition", nil), - ErrPartitionSubpartition: Message("Subpartitions can only be hash partitions and by key", nil), - ErrPartitionSubpartMix: Message("Must define subpartitions on all partitions if on one partition", nil), - ErrPartitionWrongNoPart: Message("Wrong number of partitions defined, mismatch with previous setting", nil), - ErrPartitionWrongNoSubpart: Message("Wrong number of subpartitions defined, mismatch with previous setting", nil), - ErrWrongExprInPartitionFunc: Message("Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed", nil), - ErrNoConstExprInRangeOrList: Message("Expression in RANGE/LIST VALUES must be constant", nil), - ErrFieldNotFoundPart: Message("Field in list of fields for partition function not found in table", nil), - ErrListOfFieldsOnlyInHash: Message("List of fields is only allowed in KEY partitions", nil), - ErrInconsistentPartitionInfo: Message("The partition info in the frm file is not consistent with what can be written into the frm file", nil), - ErrPartitionFuncNotAllowed: Message("The %-.192s function returns the wrong type", nil), - ErrPartitionsMustBeDefined: Message("For %-.64s partitions each partition must be defined", nil), - ErrRangeNotIncreasing: Message("VALUES LESS THAN value must be strictly increasing for each partition", nil), - ErrInconsistentTypeOfFunctions: Message("VALUES value must be of same type as partition function", nil), - ErrMultipleDefConstInListPart: Message("Multiple definition of same constant in list partitioning", nil), - ErrPartitionEntry: Message("Partitioning can not be used stand-alone in query", nil), - ErrMixHandler: Message("The mix of handlers in the partitions is not allowed in this version of MySQL", nil), - ErrPartitionNotDefined: Message("For the partitioned engine it is necessary to define all %-.64s", nil), - ErrTooManyPartitions: Message("Too many partitions (including subpartitions) were defined", nil), - ErrSubpartition: Message("It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning", nil), - ErrCantCreateHandlerFile: Message("Failed to create specific handler file", nil), - ErrBlobFieldInPartFunc: Message("A BLOB field is not allowed in partition function", nil), - ErrUniqueKeyNeedAllFieldsInPf: Message("A %-.192s must include all columns in the table's partitioning function", nil), - ErrNoParts: Message("Number of %-.64s = 0 is not an allowed value", nil), - ErrPartitionMgmtOnNonpartitioned: Message("Partition management on a not partitioned table is not possible", nil), - ErrForeignKeyOnPartitioned: Message("Foreign key clause is not yet supported in conjunction with partitioning", nil), - ErrDropPartitionNonExistent: Message("Error in list of partitions to %-.64s", nil), - ErrDropLastPartition: Message("Cannot remove all partitions, use DROP TABLE instead", nil), - ErrCoalesceOnlyOnHashPartition: Message("COALESCE PARTITION can only be used on HASH/KEY partitions", nil), - ErrReorgHashOnlyOnSameNo: Message("REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers", nil), - ErrReorgNoParam: Message("REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs", nil), - ErrOnlyOnRangeListPartition: Message("%-.64s PARTITION can only be used on RANGE/LIST partitions", nil), - ErrAddPartitionSubpart: Message("Trying to Add partition(s) with wrong number of subpartitions", nil), - ErrAddPartitionNoNewPartition: Message("At least one partition must be added", nil), - ErrCoalescePartitionNoPartition: Message("At least one partition must be coalesced", nil), - ErrReorgPartitionNotExist: Message("More partitions to reorganize than there are partitions", nil), - ErrSameNamePartition: Message("Duplicate partition name %-.192s", nil), - ErrNoBinlog: Message("It is not allowed to shut off binlog on this command", nil), - ErrConsecutiveReorgPartitions: Message("When reorganizing a set of partitions they must be in consecutive order", nil), - ErrReorgOutsideRange: Message("Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range", nil), - ErrPartitionFunctionFailure: Message("Partition function not supported in this version for this handler", nil), - ErrPartState: Message("Partition state cannot be defined from CREATE/ALTER TABLE", nil), - ErrLimitedPartRange: Message("The %-.64s handler only supports 32 bit integers in VALUES", nil), - ErrPluginIsNotLoaded: Message("Plugin '%-.192s' is not loaded", nil), - ErrWrongValue: Message("Incorrect %-.32s value: '%-.128s'", nil), - ErrNoPartitionForGivenValue: Message("Table has no partition for value %-.64s", nil), - ErrFilegroupOptionOnlyOnce: Message("It is not allowed to specify %s more than once", nil), - ErrCreateFilegroupFailed: Message("Failed to create %s", nil), - ErrDropFilegroupFailed: Message("Failed to drop %s", nil), - ErrTablespaceAutoExtend: Message("The handler doesn't support autoextend of tablespaces", nil), - ErrWrongSizeNumber: Message("A size parameter was incorrectly specified, either number or on the form 10M", nil), - ErrSizeOverflow: Message("The size number was correct but we don't allow the digit part to be more than 2 billion", nil), - ErrAlterFilegroupFailed: Message("Failed to alter: %s", nil), - ErrBinlogRowLoggingFailed: Message("Writing one row to the row-based binary log failed", nil), - ErrBinlogRowWrongTableDef: Message("Table definition on master and slave does not match: %s", nil), - ErrBinlogRowRbrToSbr: Message("Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events", nil), - ErrEventAlreadyExists: Message("Event '%-.192s' already exists", nil), - ErrEventStoreFailed: Message("Failed to store event %s. Error code %d from storage engine.", nil), - ErrEventDoesNotExist: Message("Unknown event '%-.192s'", nil), - ErrEventCantAlter: Message("Failed to alter event '%-.192s'", nil), - ErrEventDropFailed: Message("Failed to drop %s", nil), - ErrEventIntervalNotPositiveOrTooBig: Message("INTERVAL is either not positive or too big", nil), - ErrEventEndsBeforeStarts: Message("ENDS is either invalid or before STARTS", nil), - ErrEventExecTimeInThePast: Message("Event execution time is in the past. Event has been disabled", nil), - ErrEventOpenTableFailed: Message("Failed to open mysql.event", nil), - ErrEventNeitherMExprNorMAt: Message("No datetime expression provided", nil), - ErrObsoleteColCountDoesntMatchCorrupted: Message("Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), - ErrObsoleteCannotLoadFromTable: Message("Cannot load from mysql.%s. The table is probably corrupted", nil), - ErrEventCannotDelete: Message("Failed to delete the event from mysql.event", nil), - ErrEventCompile: Message("Error during compilation of event's body", nil), - ErrEventSameName: Message("Same old and new event name", nil), - ErrEventDataTooLong: Message("Data for column '%s' too long", nil), - ErrDropIndexNeededInForeignKey: Message("Cannot drop index '%-.192s': needed in a foreign key constraint", nil), - ErrWarnDeprecatedSyntaxWithVer: Message("The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead", nil), - ErrCantWriteLockLogTable: Message("You can't write-lock a log table. Only read access is possible", nil), - ErrCantLockLogTable: Message("You can't use locks with log tables.", nil), - ErrForeignDuplicateKeyOldUnused: Message("Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry", nil), - ErrColCountDoesntMatchPleaseUpdate: Message("Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysqlUpgrade to fix this error.", nil), - ErrTempTablePreventsSwitchOutOfRbr: Message("Cannot switch out of the row-based binary log format when the session has open temporary tables", nil), - ErrStoredFunctionPreventsSwitchBinlogFormat: Message("Cannot change the binary logging format inside a stored function or trigger", nil), - ErrNdbCantSwitchBinlogFormat: Message("The NDB cluster engine does not support changing the binlog format on the fly yet", nil), - ErrPartitionNoTemporary: Message("Cannot create temporary table with partitions", nil), - ErrPartitionConstDomain: Message("Partition constant is out of partition function domain", nil), - ErrPartitionFunctionIsNotAllowed: Message("This partition function is not allowed", nil), - ErrDdlLog: Message("Error in DDL log", nil), - ErrNullInValuesLessThan: Message("Not allowed to use NULL value in VALUES LESS THAN", nil), - ErrWrongPartitionName: Message("Incorrect partition name", nil), - ErrCantChangeTxCharacteristics: Message("Transaction characteristics can't be changed while a transaction is in progress", nil), - ErrDupEntryAutoincrementCase: Message("ALTER TABLE causes autoIncrement resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'", nil), - ErrEventModifyQueue: Message("Internal scheduler error %d", nil), - ErrEventSetVar: Message("Error during starting/stopping of the scheduler. Error code %d", nil), - ErrPartitionMerge: Message("Engine cannot be used in partitioned tables", nil), - ErrCantActivateLog: Message("Cannot activate '%-.64s' log", nil), - ErrRbrNotAvailable: Message("The server was not built with row-based replication", nil), - ErrBase64Decode: Message("Decoding of base64 string failed", nil), - ErrEventRecursionForbidden: Message("Recursion of EVENT DDL statements is forbidden when body is present", nil), - ErrEventsDB: Message("Cannot proceed because system tables used by Event Scheduler were found damaged at server start", nil), - ErrOnlyIntegersAllowed: Message("Only integers allowed as number here", nil), - ErrUnsuportedLogEngine: Message("This storage engine cannot be used for log tables\"", nil), - ErrBadLogStatement: Message("You cannot '%s' a log table if logging is enabled", nil), - ErrCantRenameLogTable: Message("Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'", nil), - ErrWrongParamcountToNativeFct: Message("Incorrect parameter count in the call to native function '%-.192s'", nil), - ErrWrongParametersToNativeFct: Message("Incorrect parameters in the call to native function '%-.192s'", nil), - ErrWrongParametersToStoredFct: Message("Incorrect parameters in the call to stored function '%-.192s'", nil), - ErrNativeFctNameCollision: Message("This function '%-.192s' has the same name as a native function", nil), - ErrDupEntryWithKeyName: Message("Duplicate entry '%-.64s' for key '%-.192s'", nil), - ErrBinlogPurgeEmFile: Message("Too many files opened, please execute the command again", nil), - ErrEventCannotCreateInThePast: Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.", nil), - ErrEventCannotAlterInThePast: Message("Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.", nil), - ErrSlaveIncident: Message("The incident %s occurred on the master. Message: %-.64s", nil), - ErrNoPartitionForGivenValueSilent: Message("Table has no partition for some existing values", nil), - ErrBinlogUnsafeStatement: Message("Unsafe statement written to the binary log using statement format since BINLOGFORMAT = STATEMENT. %s", nil), - ErrSlaveFatal: Message("Fatal : %s", nil), - ErrSlaveRelayLogReadFailure: Message("Relay log read failure: %s", nil), - ErrSlaveRelayLogWriteFailure: Message("Relay log write failure: %s", nil), - ErrSlaveCreateEventFailure: Message("Failed to create %s", nil), - ErrSlaveMasterComFailure: Message("Master command %s failed: %s", nil), - ErrBinlogLoggingImpossible: Message("Binary logging not possible. Message: %s", nil), - ErrViewNoCreationCtx: Message("View `%-.64s`.`%-.64s` has no creation context", nil), - ErrViewInvalidCreationCtx: Message("Creation context of view `%-.64s`.`%-.64s' is invalid", nil), - ErrSrInvalidCreationCtx: Message("Creation context of stored routine `%-.64s`.`%-.64s` is invalid", nil), - ErrTrgCorruptedFile: Message("Corrupted TRG file for table `%-.64s`.`%-.64s`", nil), - ErrTrgNoCreationCtx: Message("Triggers for table `%-.64s`.`%-.64s` have no creation context", nil), - ErrTrgInvalidCreationCtx: Message("Trigger creation context of table `%-.64s`.`%-.64s` is invalid", nil), - ErrEventInvalidCreationCtx: Message("Creation context of event `%-.64s`.`%-.64s` is invalid", nil), - ErrTrgCantOpenTable: Message("Cannot open table for trigger `%-.64s`.`%-.64s`", nil), - ErrCantCreateSroutine: Message("Cannot create stored routine `%-.64s`. Check warnings", nil), - ErrNeverUsed: Message("Ambiguous slave modes combination. %s", nil), - ErrNoFormatDescriptionEventBeforeBinlogStatement: Message("The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement.", nil), - ErrSlaveCorruptEvent: Message("Corrupted replication event was detected", nil), - ErrLoadDataInvalidColumn: Message("Invalid column reference (%-.64s) in LOAD DATA", nil), - ErrLogPurgeNoFile: Message("Being purged log %s was not found", nil), - ErrXaRbtimeout: Message("XARBTIMEOUT: Transaction branch was rolled back: took too long", nil), - ErrXaRbdeadlock: Message("XARBDEADLOCK: Transaction branch was rolled back: deadlock was detected", nil), - ErrNeedReprepare: Message("Prepared statement needs to be re-prepared", nil), - ErrDelayedNotSupported: Message("DELAYED option not supported for table '%-.192s'", nil), - WarnNoMasterInfo: Message("The master info structure does not exist", nil), - WarnOptionIgnored: Message("<%-.64s> option ignored", nil), - WarnPluginDeleteBuiltin: Message("Built-in plugins cannot be deleted", nil), - WarnPluginBusy: Message("Plugin is busy and will be uninstalled on shutdown", nil), - ErrVariableIsReadonly: Message("%s variable '%s' is read-only. Use SET %s to assign the value", nil), - ErrWarnEngineTransactionRollback: Message("Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted", nil), - ErrSlaveHeartbeatFailure: Message("Unexpected master's heartbeat data: %s", nil), - ErrSlaveHeartbeatValueOutOfRange: Message("The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds).", nil), - ErrNdbReplicationSchema: Message("Bad schema for mysql.ndbReplication table. Message: %-.64s", nil), - ErrConflictFnParse: Message("Error in parsing conflict function. Message: %-.64s", nil), - ErrExceptionsWrite: Message("Write to exceptions table failed. Message: %-.128s\"", nil), - ErrTooLongTableComment: Message("Comment for table '%-.64s' is too long (max = %d)", nil), - ErrTooLongFieldComment: Message("Comment for field '%-.64s' is too long (max = %d)", nil), - ErrFuncInexistentNameCollision: Message("FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual", nil), - ErrDatabaseName: Message("Database", nil), - ErrTableName: Message("Table", nil), - ErrPartitionName: Message("Partition", nil), - ErrSubpartitionName: Message("Subpartition", nil), - ErrTemporaryName: Message("Temporary", nil), - ErrRenamedName: Message("Renamed", nil), - ErrTooManyConcurrentTrxs: Message("Too many active concurrent transactions", nil), - WarnNonASCIISeparatorNotImplemented: Message("Non-ASCII separator arguments are not fully supported", nil), - ErrDebugSyncTimeout: Message("debug sync point wait timed out", nil), - ErrDebugSyncHitLimit: Message("debug sync point hit limit reached", nil), - ErrDupSignalSet: Message("Duplicate condition information item '%s'", nil), - ErrSignalWarn: Message("Unhandled user-defined warning condition", nil), - ErrSignalNotFound: Message("Unhandled user-defined not found condition", nil), - ErrSignalException: Message("Unhandled user-defined exception condition", nil), - ErrResignalWithoutActiveHandler: Message("RESIGNAL when handler not active", nil), - ErrSignalBadConditionType: Message("SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE", nil), - WarnCondItemTruncated: Message("Data truncated for condition item '%s'", nil), - ErrCondItemTooLong: Message("Data too long for condition item '%s'", nil), - ErrUnknownLocale: Message("Unknown locale: '%-.64s'", nil), - ErrSlaveIgnoreServerIDs: Message("The requested server id %d clashes with the slave startup option --replicate-same-server-id", nil), - ErrQueryCacheDisabled: Message("Query cache is disabled; restart the server with queryCacheType=1 to enable it", nil), - ErrSameNamePartitionField: Message("Duplicate partition field name '%-.192s'", nil), - ErrPartitionColumnList: Message("Inconsistency in usage of column lists for partitioning", nil), - ErrWrongTypeColumnValue: Message("Partition column values of incorrect type", nil), - ErrTooManyPartitionFuncFields: Message("Too many fields in '%-.192s'", nil), - ErrMaxvalueInValuesIn: Message("Cannot use MAXVALUE as value in VALUES IN", nil), - ErrTooManyValues: Message("Cannot have more than one value for this type of %-.64s partitioning", nil), - ErrRowSinglePartitionField: Message("Row expressions in VALUES IN only allowed for multi-field column partitioning", nil), - ErrFieldTypeNotAllowedAsPartitionField: Message("Field '%-.192s' is of a not allowed type for this type of partitioning", nil), - ErrPartitionFieldsTooLong: Message("The total length of the partitioning fields is too large", nil), - ErrBinlogRowEngineAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved.", nil), - ErrBinlogRowModeAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.", nil), - ErrBinlogUnsafeAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOGFORMAT = MIXED. %s", nil), - ErrBinlogRowInjectionAndStmtEngine: Message("Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.", nil), - ErrBinlogStmtModeAndRowEngine: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s", nil), - ErrBinlogRowInjectionAndStmtMode: Message("Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOGFORMAT = STATEMENT.", nil), - ErrBinlogMultipleEnginesAndSelfLoggingEngine: Message("Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.", nil), - ErrBinlogUnsafeLimit: Message("The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.", nil), - ErrBinlogUnsafeInsertDelayed: Message("The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted.", nil), - ErrBinlogUnsafeSystemTable: Message("The statement is unsafe because it uses the general log, slow query log, or performanceSchema table(s). This is unsafe because system tables may differ on slaves.", nil), - ErrBinlogUnsafeAutoincColumns: Message("Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTOINCREMENT column. Inserted values cannot be logged correctly.", nil), - ErrBinlogUnsafeUdf: Message("Statement is unsafe because it uses a UDF which may not return the same value on the slave.", nil), - ErrBinlogUnsafeSystemVariable: Message("Statement is unsafe because it uses a system variable that may have a different value on the slave.", nil), - ErrBinlogUnsafeSystemFunction: Message("Statement is unsafe because it uses a system function that may return a different value on the slave.", nil), - ErrBinlogUnsafeNontransAfterTrans: Message("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.", nil), - ErrMessageAndStatement: Message("%s Statement: %s", nil), - ErrSlaveConversionFailed: Message("Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'", nil), - ErrSlaveCantCreateConversion: Message("Can't create conversion table for table '%-.192s.%-.192s'", nil), - ErrInsideTransactionPreventsSwitchBinlogFormat: Message("Cannot modify @@session.binlogFormat inside a transaction", nil), - ErrPathLength: Message("The path specified for %.64s is too long.", nil), - ErrWarnDeprecatedSyntaxNoReplacement: Message("%s is deprecated and will be removed in a future release.%s", nil), - ErrWrongNativeTableStructure: Message("Native table '%-.64s'.'%-.64s' has the wrong structure", nil), - ErrWrongPerfSchemaUsage: Message("Invalid performanceSchema usage.", nil), - ErrWarnISSkippedTable: Message("Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement", nil), - ErrInsideTransactionPreventsSwitchBinlogDirect: Message("Cannot modify @@session.binlogDirectNonTransactionalUpdates inside a transaction", nil), - ErrStoredFunctionPreventsSwitchBinlogDirect: Message("Cannot change the binlog direct flag inside a stored function or trigger", nil), - ErrSpatialMustHaveGeomCol: Message("A SPATIAL index may only contain a geometrical type column", nil), - ErrTooLongIndexComment: Message("Comment for index '%-.64s' is too long (max = %d)", nil), - ErrLockAborted: Message("Wait on a lock was aborted due to a pending exclusive lock", nil), - ErrDataOutOfRange: Message("%s value is out of range in '%s'", nil), - ErrWrongSpvarTypeInLimit: Message("A variable of a non-integer based type in LIMIT clause", nil), - ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine: Message("Mixing self-logging and non-self-logging engines in a statement is unsafe.", nil), - ErrBinlogUnsafeMixedStatement: Message("Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.", nil), - ErrInsideTransactionPreventsSwitchSQLLogBin: Message("Cannot modify @@session.sqlLogBin inside a transaction", nil), - ErrStoredFunctionPreventsSwitchSQLLogBin: Message("Cannot change the sqlLogBin inside a stored function or trigger", nil), - ErrFailedReadFromParFile: Message("Failed to read from the .par file", nil), - ErrValuesIsNotIntType: Message("VALUES value for partition '%-.64s' must have type INT", nil), - ErrAccessDeniedNoPassword: Message("Access denied for user '%-.48s'@'%-.64s'", nil), - ErrSetPasswordAuthPlugin: Message("SET PASSWORD has no significance for user '%-.48s'@'%-.255s' as authentication plugin does not support it.", nil), - ErrGrantPluginUserExists: Message("GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists", nil), - ErrTruncateIllegalForeignKey: Message("Cannot truncate a table referenced in a foreign key constraint (%.192s)", nil), - ErrPluginIsPermanent: Message("Plugin '%s' is forcePlusPermanent and can not be unloaded", nil), - ErrSlaveHeartbeatValueOutOfRangeMin: Message("The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.", nil), - ErrSlaveHeartbeatValueOutOfRangeMax: Message("The requested value for the heartbeat period exceeds the value of `slaveNetTimeout' seconds. A sensible value for the period should be less than the timeout.", nil), - ErrStmtCacheFull: Message("Multi-row statements required more than 'maxBinlogStmtCacheSize' bytes of storage; increase this mysqld variable and try again", nil), - ErrMultiUpdateKeyConflict: Message("Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'.", nil), - ErrTableNeedsRebuild: Message("Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!", nil), - WarnOptionBelowLimit: Message("The value of '%s' should be no less than the value of '%s'", nil), - ErrIndexColumnTooLong: Message("Index column size too large. The maximum column size is %d bytes.", nil), - ErrErrorInTriggerBody: Message("Trigger '%-.64s' has an error in its body: '%-.256s'", nil), - ErrErrorInUnknownTriggerBody: Message("Unknown trigger has an error in its body: '%-.256s'", nil), - ErrIndexCorrupt: Message("Index %s is corrupted", nil), - ErrUndoRecordTooBig: Message("Undo log record is too big.", nil), - ErrBinlogUnsafeInsertIgnoreSelect: Message("INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeInsertSelectUpdate: Message("INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeReplaceSelect: Message("REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateIgnoreSelect: Message("CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateReplaceSelect: Message("CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeUpdateIgnore: Message("UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.", nil), - ErrPluginNoUninstall: Message("Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it.", nil), - ErrPluginNoInstall: Message("Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it.", nil), - ErrBinlogUnsafeWriteAutoincSelect: Message("Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeCreateSelectAutoinc: Message("CREATE TABLE... SELECT... on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave.", nil), - ErrBinlogUnsafeInsertTwoKeys: Message("INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe", nil), - ErrTableInFkCheck: Message("Table is being used in foreign key check.", nil), - ErrUnsupportedEngine: Message("Storage engine '%s' does not support system tables. [%s.%s]", nil), - ErrBinlogUnsafeAutoincNotFirst: Message("INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.", nil), - ErrCannotLoadFromTableV2: Message("Cannot load from %s.%s. The table is probably corrupted", nil), - ErrMasterDelayValueOutOfRange: Message("The requested value %d for the master delay exceeds the maximum %d", nil), - ErrOnlyFdAndRbrEventsAllowedInBinlogStatement: Message("Only FormatDescriptionLogEvent and row events are allowed in BINLOG statements (but %s was provided)", nil), - ErrPartitionExchangeDifferentOption: Message("Non matching attribute '%-.64s' between partition and table", nil), - ErrPartitionExchangePartTable: Message("Table to exchange with partition is partitioned: '%-.64s'", nil), - ErrPartitionExchangeTempTable: Message("Table to exchange with partition is temporary: '%-.64s'", nil), - ErrPartitionInsteadOfSubpartition: Message("Subpartitioned table, use subpartition instead of partition", nil), - ErrUnknownPartition: Message("Unknown partition '%-.64s' in table '%-.64s'", nil), - ErrTablesDifferentMetadata: Message("Tables have different definitions", nil), - ErrRowDoesNotMatchPartition: Message("Found a row that does not match the partition", nil), - ErrBinlogCacheSizeGreaterThanMax: Message("Option binlogCacheSize (%d) is greater than maxBinlogCacheSize (%d); setting binlogCacheSize equal to maxBinlogCacheSize.", nil), - ErrWarnIndexNotApplicable: Message("Cannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'", nil), - ErrPartitionExchangeForeignKey: Message("Table to exchange with partition has foreign key references: '%-.64s'", nil), - ErrNoSuchKeyValue: Message("Key value '%-.192s' was not found in table '%-.192s.%-.192s'", nil), - ErrRplInfoDataTooLong: Message("Data for column '%s' too long", nil), - ErrNetworkReadEventChecksumFailure: Message("Replication event checksum verification failed while reading from network.", nil), - ErrBinlogReadEventChecksumFailure: Message("Replication event checksum verification failed while reading from a log file.", nil), - ErrBinlogStmtCacheSizeGreaterThanMax: Message("Option binlogStmtCacheSize (%d) is greater than maxBinlogStmtCacheSize (%d); setting binlogStmtCacheSize equal to maxBinlogStmtCacheSize.", nil), - ErrCantUpdateTableInCreateTableSelect: Message("Can't update table '%-.192s' while '%-.192s' is being created.", nil), - ErrPartitionClauseOnNonpartitioned: Message("PARTITION () clause on non partitioned table", nil), - ErrRowDoesNotMatchGivenPartitionSet: Message("Found a row not matching the given partition set", nil), - ErrNoSuchPartitionunused: Message("partition '%-.64s' doesn't exist", nil), - ErrChangeRplInfoRepositoryFailure: Message("Failure while changing the type of replication repository: %s.", nil), - ErrWarningNotCompleteRollbackWithCreatedTempTable: Message("The creation of some temporary tables could not be rolled back.", nil), - ErrWarningNotCompleteRollbackWithDroppedTempTable: Message("Some temporary tables were dropped, but these operations could not be rolled back.", nil), - ErrMtsFeatureIsNotSupported: Message("%s is not supported in multi-threaded slave mode. %s", nil), - ErrMtsUpdatedDBsGreaterMax: Message("The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata.", nil), - ErrMtsCantParallel: Message("Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s.", nil), - ErrMtsInconsistentData: Message("%s", nil), - ErrFulltextNotSupportedWithPartitioning: Message("FULLTEXT index is not supported for partitioned tables.", nil), - ErrDaInvalidConditionNumber: Message("Invalid condition number", nil), - ErrInsecurePlainText: Message("Sending passwords in plain text without SSL/TLS is extremely insecure.", nil), - ErrInsecureChangeMaster: Message("Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.", nil), - ErrForeignDuplicateKeyWithChildInfo: Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'", nil), - ErrForeignDuplicateKeyWithoutChildInfo: Message("Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child table", nil), - ErrSQLthreadWithSecureSlave: Message("Setting authentication options is not possible when only the Slave SQL Thread is being started.", nil), - ErrTableHasNoFt: Message("The table does not have FULLTEXT index to support this query", nil), - ErrVariableNotSettableInSfOrTrigger: Message("The system variable %.200s cannot be set in stored functions or triggers.", nil), - ErrVariableNotSettableInTransaction: Message("The system variable %.200s cannot be set when there is an ongoing transaction.", nil), - ErrGtidNextIsNotInGtidNextList: Message("The system variable @@SESSION.GTIDNEXT has the value %.200s, which is not listed in @@SESSION.GTIDNEXTLIST.", nil), - ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull: Message("When @@SESSION.GTIDNEXTLIST == NULL, the system variable @@SESSION.GTIDNEXT cannot change inside a transaction.", nil), - ErrSetStatementCannotInvokeFunction: Message("The statement 'SET %.200s' cannot invoke a stored function.", nil), - ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull: Message("The system variable @@SESSION.GTIDNEXT cannot be 'AUTOMATIC' when @@SESSION.GTIDNEXTLIST is non-NULL.", nil), - ErrSkippingLoggedTransaction: Message("Skipping transaction %.200s because it has already been executed and logged.", nil), - ErrMalformedGtidSetSpecification: Message("Malformed GTID set specification '%.200s'.", nil), - ErrMalformedGtidSetEncoding: Message("Malformed GTID set encoding.", nil), - ErrMalformedGtidSpecification: Message("Malformed GTID specification '%.200s'.", nil), - ErrGnoExhausted: Message("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new serverUuid.", nil), - ErrBadSlaveAutoPosition: Message("Parameters MASTERLOGFILE, MASTERLOGPOS, RELAYLOGFILE and RELAYLOGPOS cannot be set when MASTERAUTOPOSITION is active.", nil), - ErrAutoPositionRequiresGtidModeOn: Message("CHANGE MASTER TO MASTERAUTOPOSITION = 1 can only be executed when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet: Message("Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTIDNEXT != AUTOMATIC or @@SESSION.GTIDNEXTLIST != NULL.", nil), - ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn: Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP2 requires @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), - ErrGtidModeRequiresBinlog: Message("@@GLOBAL.GTIDMODE = ON or UPGRADESTEP1 or UPGRADESTEP2 requires --log-bin and --log-slave-updates.", nil), - ErrCantSetGtidNextToGtidWhenGtidModeIsOff: Message("@@SESSION.GTIDNEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn: Message("@@SESSION.GTIDNEXT cannot be set to ANONYMOUS when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff: Message("@@SESSION.GTIDNEXTLIST cannot be set to a non-NULL value when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrFoundGtidEventWhenGtidModeIsOff: Message("Found a GtidLogEvent or PreviousGtidsLogEvent when @@GLOBAL.GTIDMODE = OFF.", nil), - ErrGtidUnsafeNonTransactionalTable: Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.", nil), - ErrGtidUnsafeCreateSelect: Message("CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.", nil), - ErrGtidUnsafeCreateDropTemporaryTableInTransaction: Message("When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.", nil), - ErrGtidModeCanOnlyChangeOneStepAtATime: Message("The value of @@GLOBAL.GTIDMODE can only change one step at a time: OFF <-> UPGRADESTEP1 <-> UPGRADESTEP2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.", nil), - ErrMasterHasPurgedRequiredGtids: Message("The slave is connecting using CHANGE MASTER TO MASTERAUTOPOSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.", nil), - ErrCantSetGtidNextWhenOwningGtid: Message("@@SESSION.GTIDNEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK.", nil), - ErrUnknownExplainFormat: Message("Unknown EXPLAIN format name: '%s'", nil), - ErrCantExecuteInReadOnlyTransaction: Message("Cannot execute statement in a READ ONLY transaction.", nil), - ErrTooLongTablePartitionComment: Message("Comment for table partition '%-.64s' is too long (max = %d)", nil), - ErrSlaveConfiguration: Message("Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.", nil), - ErrInnodbFtLimit: Message("InnoDB presently supports one FULLTEXT index creation at a time", nil), - ErrInnodbNoFtTempTable: Message("Cannot create FULLTEXT index on temporary InnoDB table", nil), - ErrInnodbFtWrongDocidColumn: Message("Column '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), - ErrInnodbFtWrongDocidIndex: Message("Index '%-.192s' is of wrong type for an InnoDB FULLTEXT index", nil), - ErrInnodbOnlineLogTooBig: Message("Creating index '%-.192s' required more than 'innodbOnlineAlterLogMaxSize' bytes of modification log. Please try again.", nil), - ErrUnknownAlterAlgorithm: Message("Unknown ALGORITHM '%s'", nil), - ErrUnknownAlterLock: Message("Unknown LOCK type '%s'", nil), - ErrMtsChangeMasterCantRunWithGaps: Message("CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.", nil), - ErrMtsRecoveryFailure: Message("Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MySQL error log.", nil), - ErrMtsResetWorkers: Message("Cannot clean up worker info tables. Additional error messages can be found in the MySQL error log.", nil), - ErrColCountDoesntMatchCorruptedV2: Message("Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted", nil), - ErrSlaveSilentRetryTransaction: Message("Slave must silently retry current transaction", nil), - ErrDiscardFkChecksRunning: Message("There is a foreign key check running on table '%-.192s'. Cannot discard the table.", nil), - ErrTableSchemaMismatch: Message("Schema mismatch (%s)", nil), - ErrTableInSystemTablespace: Message("Table '%-.192s' in system tablespace", nil), - ErrIoRead: Message("IO Read : (%d, %s) %s", nil), - ErrIoWrite: Message("IO Write : (%d, %s) %s", nil), - ErrTablespaceMissing: Message("Tablespace is missing for table '%-.192s'", nil), - ErrTablespaceExists: Message("Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORT.", nil), - ErrTablespaceDiscarded: Message("Tablespace has been discarded for table '%-.192s'", nil), - ErrInternal: Message("Internal : %s", nil), - ErrInnodbImport: Message("ALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %d : '%s'", nil), - ErrInnodbIndexCorrupt: Message("Index corrupt: %s", nil), - ErrInvalidYearColumnLength: Message("Supports only YEAR or YEAR(4) column", nil), - ErrNotValidPassword: Message("Your password does not satisfy the current policy requirements (%s)", nil), - ErrMustChangePassword: Message("You must SET PASSWORD before executing this statement", nil), - ErrFkNoIndexChild: Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'", nil), - ErrForeignKeyNoIndexInParent: Message("Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'", nil), - ErrFkFailAddSystem: Message("Failed to add the foreign key constraint '%s' to system tables", nil), - ErrForeignKeyCannotOpenParent: Message("Failed to open the referenced table '%s'", nil), - ErrFkIncorrectOption: Message("Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'", nil), - ErrFkDupName: Message("Duplicate foreign key constraint name '%s'", nil), - ErrPasswordFormat: Message("The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.", nil), - ErrFkColumnCannotDrop: Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'", nil), - ErrFkColumnCannotDropChild: Message("Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrForeignKeyColumnNotNull: Message("Column '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULL", nil), - ErrDupIndex: Message("Duplicate index '%-.64s' defined on the table '%-.64s.%-.64s'. This is deprecated and will be disallowed in a future release.", nil), - ErrForeignKeyColumnCannotChange: Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s'", nil), - ErrForeignKeyColumnCannotChangeChild: Message("Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrFkCannotDeleteParent: Message("Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'", nil), - ErrMalformedPacket: Message("Malformed communication packet.", nil), - ErrReadOnlyMode: Message("Running in read-only mode", nil), - ErrGtidNextTypeUndefinedGroup: Message("When @@SESSION.GTIDNEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET @@SESSION.GTIDNEXT before a transaction and forgot to set @@SESSION.GTIDNEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current @@SESSION.GTIDNEXT is '%s'.", nil), - ErrVariableNotSettableInSp: Message("The system variable %.200s cannot be set in stored procedures.", nil), - ErrCantSetGtidPurgedWhenGtidModeIsOff: Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDMODE = ON.", nil), - ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty: Message("@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDEXECUTED is empty.", nil), - ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty: Message("@@GLOBAL.GTIDPURGED can only be set when there are no ongoing transactions (not even in other clients).", nil), - ErrGtidPurgedWasChanged: Message("@@GLOBAL.GTIDPURGED was changed from '%s' to '%s'.", nil), - ErrGtidExecutedWasChanged: Message("@@GLOBAL.GTIDEXECUTED was changed from '%s' to '%s'.", nil), - ErrBinlogStmtModeAndNoReplTables: Message("Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT, and both replicated and non replicated tables are written to.", nil), - ErrAlterOperationNotSupported: Message("%s is not supported for this operation. Try %s.", nil), - ErrAlterOperationNotSupportedReason: Message("%s is not supported. Reason: %s. Try %s.", nil), - ErrAlterOperationNotSupportedReasonCopy: Message("COPY algorithm requires a lock", nil), - ErrAlterOperationNotSupportedReasonPartition: Message("Partition specific operations do not yet support LOCK/ALGORITHM", nil), - ErrAlterOperationNotSupportedReasonFkRename: Message("Columns participating in a foreign key are renamed", nil), - ErrAlterOperationNotSupportedReasonColumnType: Message("Cannot change column type INPLACE", nil), - ErrAlterOperationNotSupportedReasonFkCheck: Message("Adding foreign keys needs foreignKeyChecks=OFF", nil), - ErrAlterOperationNotSupportedReasonIgnore: Message("Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows", nil), - ErrAlterOperationNotSupportedReasonNopk: Message("Dropping a primary key is not allowed without also adding a new primary key", nil), - ErrAlterOperationNotSupportedReasonAutoinc: Message("Adding an auto-increment column requires a lock", nil), - ErrAlterOperationNotSupportedReasonHiddenFts: Message("Cannot replace hidden FTSDOCID with a user-visible one", nil), - ErrAlterOperationNotSupportedReasonChangeFts: Message("Cannot drop or rename FTSDOCID", nil), - ErrAlterOperationNotSupportedReasonFts: Message("Fulltext index creation requires a lock", nil), - ErrSQLSlaveSkipCounterNotSettableInGtidMode: Message("sqlSlaveSkipCounter can not be set when the server is running with @@GLOBAL.GTIDMODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction", nil), - ErrDupUnknownInIndex: Message("Duplicate entry for key '%-.192s'", nil), - ErrIdentCausesTooLongPath: Message("Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'.", nil), - ErrAlterOperationNotSupportedReasonNotNull: Message("cannot silently convert NULL values, as required in this SQLMODE", nil), - ErrMustChangePasswordLogin: Message("Your password has expired. To log in you must change it using a client that supports expired passwords.", nil), - ErrRowInWrongPartition: Message("Found a row in wrong partition %s", nil), - ErrGeneratedColumnFunctionIsNotAllowed: Message("Expression of generated column '%s' contains a disallowed function.", nil), - ErrUnsupportedAlterInplaceOnVirtualColumn: Message("INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions.", nil), - ErrWrongFKOptionForGeneratedColumn: Message("Cannot define foreign key with %s clause on a generated column.", nil), - ErrBadGeneratedColumn: Message("The value specified for generated column '%s' in table '%s' is not allowed.", nil), - ErrUnsupportedOnGeneratedColumn: Message("'%s' is not supported for generated columns.", nil), - ErrGeneratedColumnNonPrior: Message("Generated column can refer only to generated columns defined prior to it.", nil), - ErrDependentByGeneratedColumn: Message("Column '%s' has a generated column dependency.", nil), - ErrGeneratedColumnRefAutoInc: Message("Generated column '%s' cannot refer to auto-increment column.", nil), - ErrInvalidFieldSize: Message("Invalid size for column '%s'.", nil), - ErrPasswordExpireAnonymousUser: Message("The password for anonymous user cannot be expired.", nil), - ErrIncorrectType: Message("Incorrect type for argument %s in function %s.", nil), - ErrInvalidJSONData: Message("Invalid JSON data provided to function %s: %s", nil), - ErrInvalidJSONText: Message("Invalid JSON text: %-.192s", nil), - ErrInvalidJSONTextInParam: Message("Invalid JSON text in argument %d to function %s: \"%s\" at position %d.", nil), - ErrInvalidJSONPath: Message("Invalid JSON path expression %s.", nil), - ErrInvalidJSONCharset: Message("Cannot create a JSON value from a string with CHARACTER SET '%s'.", nil), - ErrInvalidTypeForJSON: Message("Invalid data type for JSON data in argument %d to function %s; a JSON string or JSON type is required.", nil), - ErrInvalidJSONPathWildcard: Message("In this situation, path expressions may not contain the * and ** tokens or an array range.", nil), - ErrInvalidJSONContainsPathType: Message("The second argument can only be either 'one' or 'all'.", nil), - ErrJSONUsedAsKey: Message("JSON column '%-.192s' cannot be used in key specification.", nil), - ErrJSONDocumentTooDeep: Message("The JSON document exceeds the maximum depth.", nil), - ErrJSONDocumentNULLKey: Message("JSON documents may not contain NULL member names.", nil), - ErrBadUser: Message("User %s does not exist.", nil), - ErrUserAlreadyExists: Message("User %s already exists.", nil), - ErrInvalidJSONPathArrayCell: Message("A path expression is not a path to a cell in an array.", nil), - ErrInvalidEncryptionOption: Message("Invalid encryption option.", nil), - ErrWindowNoSuchWindow: Message("Window name '%s' is not defined.", nil), - ErrWindowCircularityInWindowGraph: Message("There is a circularity in the window dependency graph.", nil), - ErrWindowNoChildPartitioning: Message("A window which depends on another cannot define partitioning.", nil), - ErrWindowNoInherentFrame: Message("Window '%s' has a frame definition, so cannot be referenced by another window.", nil), - ErrWindowNoRedefineOrderBy: Message("Window '%s' cannot inherit '%s' since both contain an ORDER BY clause.", nil), - ErrWindowFrameStartIllegal: Message("Window '%s': frame start cannot be UNBOUNDED FOLLOWING.", nil), - ErrWindowFrameEndIllegal: Message("Window '%s': frame end cannot be UNBOUNDED PRECEDING.", nil), - ErrWindowFrameIllegal: Message("Window '%s': frame start or end is negative, NULL or of non-integral type", nil), - ErrWindowRangeFrameOrderType: Message("Window '%s' with RANGE N PRECEDING/FOLLOWING frame requires exactly one ORDER BY expression, of numeric or temporal type", nil), - ErrWindowRangeFrameTemporalType: Message("Window '%s' with RANGE frame has ORDER BY expression of datetime type. Only INTERVAL bound value allowed.", nil), - ErrWindowRangeFrameNumericType: Message("Window '%s' with RANGE frame has ORDER BY expression of numeric type, INTERVAL bound value not allowed.", nil), - ErrWindowRangeBoundNotConstant: Message("Window '%s' has a non-constant frame bound.", nil), - ErrWindowDuplicateName: Message("Window '%s' is defined twice.", nil), - ErrWindowIllegalOrderBy: Message("Window '%s': ORDER BY or PARTITION BY uses legacy position indication which is not supported, use expression.", nil), - ErrWindowInvalidWindowFuncUse: Message("You cannot use the window function '%s' in this context.'", nil), - ErrWindowInvalidWindowFuncAliasUse: Message("You cannot use the alias '%s' of an expression containing a window function in this context.'", nil), - ErrWindowNestedWindowFuncUseInWindowSpec: Message("You cannot nest a window function in the specification of window '%s'.", nil), - ErrWindowRowsIntervalUse: Message("Window '%s': INTERVAL can only be used with RANGE frames.", nil), - ErrWindowNoGroupOrderUnused: Message("ASC or DESC with GROUP BY isn't allowed with window functions; put ASC or DESC in ORDER BY", nil), - ErrWindowExplainJson: Message("To get information about window functions use EXPLAIN FORMAT=JSON", nil), - ErrWindowFunctionIgnoresFrame: Message("Window function '%s' ignores the frame clause of window '%s' and aggregates over the whole partition", nil), - ErrRoleNotGranted: Message("%s is not granted to %s", nil), - ErrMaxExecTimeExceeded: Message("Query execution was interrupted, maximum statement execution time exceeded", nil), - ErrLockAcquireFailAndNoWaitSet: Message("Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.", nil), - ErrDataTruncatedFunctionalIndex: Message("Data truncated for functional index '%s' at row %d", nil), - ErrDataOutOfRangeFunctionalIndex: Message("Value is out of range for functional index '%s' at row %d", nil), - ErrFunctionalIndexOnJsonOrGeometryFunction: Message("Cannot create a functional index on a function that returns a JSON or GEOMETRY value", nil), - ErrFunctionalIndexRefAutoIncrement: Message("Functional index '%s' cannot refer to an auto-increment column", nil), - ErrCannotDropColumnFunctionalIndex: Message("Cannot drop column '%s' because it is used by a functional index. In order to drop the column, you must remove the functional index", nil), - ErrFunctionalIndexPrimaryKey: Message("The primary key cannot be a functional index", nil), - ErrFunctionalIndexOnLob: Message("Cannot create a functional index on an expression that returns a BLOB or TEXT. Please consider using CAST", nil), - ErrFunctionalIndexFunctionIsNotAllowed: Message("Expression of functional index '%s' contains a disallowed function", nil), - ErrFulltextFunctionalIndex: Message("Fulltext functional index is not supported", nil), - ErrSpatialFunctionalIndex: Message("Spatial functional index is not supported", nil), - ErrWrongKeyColumnFunctionalIndex: Message("The used storage engine cannot index the expression '%s'", nil), - ErrFunctionalIndexOnField: Message("Functional index on a column is not supported. Consider using a regular index instead", nil), - ErrFKIncompatibleColumns: Message("Referencing column '%s' and referenced column '%s' in foreign key constraint '%s' are incompatible.", nil), - ErrFunctionalIndexRowValueIsNotAllowed: Message("Expression of functional index '%s' cannot refer to a row value", nil), - ErrDependentByFunctionalIndex: Message("Column '%s' has a functional index dependency and cannot be dropped or renamed", nil), - ErrInvalidJSONType: Message("Invalid JSON type in argument %d to function %s; an %s is required.", nil), - ErrInvalidJsonValueForFuncIndex: Message("Invalid JSON value for CAST for functional index '%s'", nil), - ErrJsonValueOutOfRangeForFuncIndex: Message("Out of range JSON value for CAST for functional index '%s'", nil), - ErrFunctionalIndexDataIsTooLong: Message("Data too long for functional index '%s'", nil), - ErrFunctionalIndexNotApplicable: Message("Cannot use functional index '%s' due to type or collation conversion", nil), - - // MariaDB errors. - ErrOnlyOneDefaultPartionAllowed: Message("Only one DEFAULT partition allowed", nil), - ErrWrongPartitionTypeExpectedSystemTime: Message("Wrong partitioning type, expected type: `SYSTEM_TIME`", nil), - ErrSystemVersioningWrongPartitions: Message("Wrong Partitions: must have at least one HISTORY and exactly one last CURRENT", nil), - ErrSequenceRunOut: Message("Sequence '%-.64s.%-.64s' has run out", nil), - ErrSequenceInvalidData: Message("Sequence '%-.64s.%-.64s' values are conflicting", nil), - ErrSequenceAccessFail: Message("Sequence '%-.64s.%-.64s' access error", nil), - ErrNotSequence: Message("'%-.64s.%-.64s' is not a SEQUENCE", nil), - ErrUnknownSequence: Message("Unknown SEQUENCE: '%-.300s'", nil), - ErrWrongInsertIntoSequence: Message("Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mysqldump). If you want to change the SEQUENCE, use ALTER SEQUENCE instead.", nil), - ErrSequenceInvalidTableStructure: Message("Sequence '%-.64s.%-.64s' table structure is invalid (%s)", nil), - - // TiDB errors. - ErrWarnOptimizerHintInvalidInteger: Message("integer value is out of range in '%s'", nil), - ErrWarnOptimizerHintUnsupportedHint: Message("Optimizer hint %s is not supported by TiDB and is ignored", nil), - ErrWarnOptimizerHintInvalidToken: Message("Cannot use %s '%s' (tok = %d) in an optimizer hint", nil), - ErrWarnMemoryQuotaOverflow: Message("Max value of MEMORY_QUOTA is %d bytes, ignore this invalid limit", nil), - ErrWarnOptimizerHintParseError: Message("Optimizer hint syntax error at %v", nil), - ErrWarnOptimizerHintWrongPos: Message("Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.", nil), -} diff --git a/pkg/parser/mysql/error.go b/pkg/parser/mysql/error.go index 4d58d9fe23573..c854f8b913ae2 100644 --- a/pkg/parser/mysql/error.go +++ b/pkg/parser/mysql/error.go @@ -17,6 +17,7 @@ import ( "fmt" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" ) // Portable analogs of some common call errors. @@ -47,7 +48,7 @@ func NewErr(errCode uint16, args ...interface{}) *SQLError { e.State = DefaultMySQLState } - if sqlErr, ok := MySQLErrName[errCode]; ok { + if sqlErr, ok := errno.MySQLErrName[errCode]; ok { errors.RedactErrorArg(args, sqlErr.RedactArgPos) e.Message = fmt.Sprintf(sqlErr.Raw, args...) } else { diff --git a/pkg/parser/mysql/state.go b/pkg/parser/mysql/state.go index 307965d08838a..10a7b0b705447 100644 --- a/pkg/parser/mysql/state.go +++ b/pkg/parser/mysql/state.go @@ -13,6 +13,10 @@ package mysql +import ( + "github.com/pingcap/tidb/pkg/errno" +) + const ( // DefaultMySQLState is default state of the mySQL DefaultMySQLState = "HY000" @@ -21,248 +25,248 @@ const ( // MySQLState maps error code to MySQL SQLSTATE value. // The values are taken from ANSI SQL and ODBC and are more standardized. var MySQLState = map[uint16]string{ - ErrDupKey: "23000", - ErrOutofMemory: "HY001", - ErrOutOfSortMemory: "HY001", - ErrConCount: "08004", - ErrBadHost: "08S01", - ErrHandshake: "08S01", - ErrDBaccessDenied: "42000", - ErrAccessDenied: "28000", - ErrNoDB: "3D000", - ErrUnknownCom: "08S01", - ErrBadNull: "23000", - ErrBadDB: "42000", - ErrTableExists: "42S01", - ErrBadTable: "42S02", - ErrNonUniq: "23000", - ErrServerShutdown: "08S01", - ErrBadField: "42S22", - ErrFieldNotInGroupBy: "42000", - ErrWrongSumSelect: "42000", - ErrWrongGroupField: "42000", - ErrWrongValueCount: "21S01", - ErrTooLongIdent: "42000", - ErrDupFieldName: "42S21", - ErrDupKeyName: "42000", - ErrDupEntry: "23000", - ErrWrongFieldSpec: "42000", - ErrParse: "42000", - ErrEmptyQuery: "42000", - ErrNonuniqTable: "42000", - ErrInvalidDefault: "42000", - ErrMultiplePriKey: "42000", - ErrTooManyKeys: "42000", - ErrTooManyKeyParts: "42000", - ErrTooLongKey: "42000", - ErrKeyColumnDoesNotExits: "42000", - ErrBlobUsedAsKey: "42000", - ErrJSONDocumentTooDeep: "22032", - ErrTooBigFieldlength: "42000", - ErrWrongAutoKey: "42000", - ErrForcingClose: "08S01", - ErrIpsock: "08S01", - ErrNoSuchIndex: "42S12", - ErrWrongFieldTerminators: "42000", - ErrBlobsAndNoTerminated: "42000", - ErrCantRemoveAllFields: "42000", - ErrCantDropFieldOrKey: "42000", - ErrBlobCantHaveDefault: "42000", - ErrWrongDBName: "42000", - ErrWrongTableName: "42000", - ErrTooBigSelect: "42000", - ErrUnknownProcedure: "42000", - ErrWrongParamcountToProcedure: "42000", - ErrUnknownTable: "42S02", - ErrFieldSpecifiedTwice: "42000", - ErrUnsupportedExtension: "42000", - ErrTableMustHaveColumns: "42000", - ErrUnknownCharacterSet: "42000", - ErrTooBigRowsize: "42000", - ErrWrongOuterJoin: "42000", - ErrNullColumnInIndex: "42000", - ErrPasswordAnonymousUser: "42000", - ErrPasswordNotAllowed: "42000", - ErrPasswordNoMatch: "42000", - ErrWrongValueCountOnRow: "21S01", - ErrInvalidUseOfNull: "22004", - ErrRegexp: "42000", - ErrMixOfGroupFuncAndFields: "42000", - ErrNonexistingGrant: "42000", - ErrTableaccessDenied: "42000", - ErrColumnaccessDenied: "42000", - ErrIllegalGrantForTable: "42000", - ErrGrantWrongHostOrUser: "42000", - ErrNoSuchTable: "42S02", - ErrNonexistingTableGrant: "42000", - ErrNotAllowedCommand: "42000", - ErrSyntax: "42000", - ErrAbortingConnection: "08S01", - ErrNetPacketTooLarge: "08S01", - ErrNetReadErrorFromPipe: "08S01", - ErrNetFcntl: "08S01", - ErrNetPacketsOutOfOrder: "08S01", - ErrNetUncompress: "08S01", - ErrNetRead: "08S01", - ErrNetReadInterrupted: "08S01", - ErrNetErrorOnWrite: "08S01", - ErrNetWriteInterrupted: "08S01", - ErrTooLongString: "42000", - ErrTableCantHandleBlob: "42000", - ErrTableCantHandleAutoIncrement: "42000", - ErrWrongColumnName: "42000", - ErrWrongKeyColumn: "42000", - ErrDupUnique: "23000", - ErrBlobKeyWithoutLength: "42000", - ErrPrimaryCantHaveNull: "42000", - ErrTooManyRows: "42000", - ErrRequiresPrimaryKey: "42000", - ErrKeyDoesNotExist: "42000", - ErrCheckNoSuchTable: "42000", - ErrCheckNotImplemented: "42000", - ErrCantDoThisDuringAnTransaction: "25000", - ErrNewAbortingConnection: "08S01", - ErrMasterNetRead: "08S01", - ErrMasterNetWrite: "08S01", - ErrTooManyUserConnections: "42000", - ErrReadOnlyTransaction: "25000", - ErrNoPermissionToCreateUser: "42000", - ErrLockDeadlock: "40001", - ErrNoReferencedRow: "23000", - ErrRowIsReferenced: "23000", - ErrConnectToMaster: "08S01", - ErrWrongNumberOfColumnsInSelect: "21000", - ErrUserLimitReached: "42000", - ErrSpecificAccessDenied: "42000", - ErrNoDefault: "42000", - ErrWrongValueForVar: "42000", - ErrWrongTypeForVar: "42000", - ErrCantUseOptionHere: "42000", - ErrNotSupportedYet: "42000", - ErrWrongFkDef: "42000", - ErrOperandColumns: "21000", - ErrSubqueryNo1Row: "21000", - ErrIllegalReference: "42S22", - ErrDerivedMustHaveAlias: "42000", - ErrSelectReduced: "01000", - ErrTablenameNotAllowedHere: "42000", - ErrNotSupportedAuthMode: "08004", - ErrSpatialCantHaveNull: "42000", - ErrCollationCharsetMismatch: "42000", - ErrWarnTooFewRecords: "01000", - ErrWarnTooManyRecords: "01000", - ErrWarnNullToNotnull: "22004", - ErrWarnDataOutOfRange: "22003", - WarnDataTruncated: "01000", - ErrWrongNameForIndex: "42000", - ErrWrongNameForCatalog: "42000", - ErrUnknownStorageEngine: "42000", - ErrTruncatedWrongValue: "22007", - ErrSpNoRecursiveCreate: "2F003", - ErrSpAlreadyExists: "42000", - ErrSpDoesNotExist: "42000", - ErrSpLilabelMismatch: "42000", - ErrSpLabelRedefine: "42000", - ErrSpLabelMismatch: "42000", - ErrSpUninitVar: "01000", - ErrSpBadselect: "0A000", - ErrSpBadreturn: "42000", - ErrSpBadstatement: "0A000", - ErrUpdateLogDeprecatedIgnored: "42000", - ErrUpdateLogDeprecatedTranslated: "42000", - ErrQueryInterrupted: "70100", - ErrSpWrongNoOfArgs: "42000", - ErrSpCondMismatch: "42000", - ErrSpNoreturn: "42000", - ErrSpNoreturnend: "2F005", - ErrSpBadCursorQuery: "42000", - ErrSpBadCursorSelect: "42000", - ErrSpCursorMismatch: "42000", - ErrSpCursorAlreadyOpen: "24000", - ErrSpCursorNotOpen: "24000", - ErrSpUndeclaredVar: "42000", - ErrSpFetchNoData: "02000", - ErrSpDupParam: "42000", - ErrSpDupVar: "42000", - ErrSpDupCond: "42000", - ErrSpDupCurs: "42000", - ErrSpSubselectNyi: "0A000", - ErrStmtNotAllowedInSfOrTrg: "0A000", - ErrSpVarcondAfterCurshndlr: "42000", - ErrSpCursorAfterHandler: "42000", - ErrSpCaseNotFound: "20000", - ErrDivisionByZero: "22012", - ErrIllegalValueForType: "22007", - ErrProcaccessDenied: "42000", - ErrXaerNota: "XAE04", - ErrXaerInval: "XAE05", - ErrXaerRmfail: "XAE07", - ErrXaerOutside: "XAE09", - ErrXaerRmerr: "XAE03", - ErrXaRbrollback: "XA100", - ErrNonexistingProcGrant: "42000", - ErrDataTooLong: "22001", - ErrSpBadSQLstate: "42000", - ErrCantCreateUserWithGrant: "42000", - ErrSpDupHandler: "42000", - ErrSpNotVarArg: "42000", - ErrSpNoRetset: "0A000", - ErrCantCreateGeometryObject: "22003", - ErrTooBigScale: "42000", - ErrTooBigPrecision: "42000", - ErrMBiggerThanD: "42000", - ErrTooLongBody: "42000", - ErrTooBigDisplaywidth: "42000", - ErrXaerDupid: "XAE08", - ErrDatetimeFunctionOverflow: "22008", - ErrRowIsReferenced2: "23000", - ErrNoReferencedRow2: "23000", - ErrSpBadVarShadow: "42000", - ErrSpWrongName: "42000", - ErrSpNoAggregate: "42000", - ErrMaxPreparedStmtCountReached: "42000", - ErrNonGroupingFieldUsed: "42000", - ErrForeignDuplicateKeyOldUnused: "23000", - ErrCantChangeTxCharacteristics: "25001", - ErrWrongParamcountToNativeFct: "42000", - ErrWrongParametersToNativeFct: "42000", - ErrWrongParametersToStoredFct: "42000", - ErrDupEntryWithKeyName: "23000", - ErrXaRbtimeout: "XA106", - ErrXaRbdeadlock: "XA102", - ErrFuncInexistentNameCollision: "42000", - ErrDupSignalSet: "42000", - ErrSignalWarn: "01000", - ErrSignalNotFound: "02000", - ErrSignalException: "HY000", - ErrResignalWithoutActiveHandler: "0K000", - ErrSpatialMustHaveGeomCol: "42000", - ErrDataOutOfRange: "22003", - ErrAccessDeniedNoPassword: "28000", - ErrTruncateIllegalForeignKey: "42000", - ErrDaInvalidConditionNumber: "35000", - ErrForeignDuplicateKeyWithChildInfo: "23000", - ErrForeignDuplicateKeyWithoutChildInfo: "23000", - ErrCantExecuteInReadOnlyTransaction: "25006", - ErrAlterOperationNotSupported: "0A000", - ErrAlterOperationNotSupportedReason: "0A000", - ErrDupUnknownInIndex: "23000", - ErrBadGeneratedColumn: "HY000", - ErrUnsupportedOnGeneratedColumn: "HY000", - ErrGeneratedColumnNonPrior: "HY000", - ErrDependentByGeneratedColumn: "HY000", - ErrInvalidJSONText: "22032", - ErrInvalidJSONTextInParam: "22032", - ErrInvalidJSONPath: "42000", - ErrInvalidJSONCharset: "22032", - ErrInvalidJSONData: "22032", - ErrInvalidJSONPathWildcard: "42000", - ErrJSONUsedAsKey: "42000", - ErrJSONVacuousPath: "42000", - ErrJSONBadOneOrAllArg: "42000", - ErrJSONDocumentNULLKey: "22032", - ErrInvalidJSONPathArrayCell: "42000", - ErrInvalidTypeForJSON: "22032", - ErrInvalidJsonValueForFuncIndex: "22018", - ErrInvalidJSONType: "22032", + errno.ErrDupKey: "23000", + errno.ErrOutofMemory: "HY001", + errno.ErrOutOfSortMemory: "HY001", + errno.ErrConCount: "08004", + errno.ErrBadHost: "08S01", + errno.ErrHandshake: "08S01", + errno.ErrDBaccessDenied: "42000", + errno.ErrAccessDenied: "28000", + errno.ErrNoDB: "3D000", + errno.ErrUnknownCom: "08S01", + errno.ErrBadNull: "23000", + errno.ErrBadDB: "42000", + errno.ErrTableExists: "42S01", + errno.ErrBadTable: "42S02", + errno.ErrNonUniq: "23000", + errno.ErrServerShutdown: "08S01", + errno.ErrBadField: "42S22", + errno.ErrFieldNotInGroupBy: "42000", + errno.ErrWrongSumSelect: "42000", + errno.ErrWrongGroupField: "42000", + errno.ErrWrongValueCount: "21S01", + errno.ErrTooLongIdent: "42000", + errno.ErrDupFieldName: "42S21", + errno.ErrDupKeyName: "42000", + errno.ErrDupEntry: "23000", + errno.ErrWrongFieldSpec: "42000", + errno.ErrParse: "42000", + errno.ErrEmptyQuery: "42000", + errno.ErrNonuniqTable: "42000", + errno.ErrInvalidDefault: "42000", + errno.ErrMultiplePriKey: "42000", + errno.ErrTooManyKeys: "42000", + errno.ErrTooManyKeyParts: "42000", + errno.ErrTooLongKey: "42000", + errno.ErrKeyColumnDoesNotExits: "42000", + errno.ErrBlobUsedAsKey: "42000", + errno.ErrJSONDocumentTooDeep: "22032", + errno.ErrTooBigFieldlength: "42000", + errno.ErrWrongAutoKey: "42000", + errno.ErrForcingClose: "08S01", + errno.ErrIpsock: "08S01", + errno.ErrNoSuchIndex: "42S12", + errno.ErrWrongFieldTerminators: "42000", + errno.ErrBlobsAndNoTerminated: "42000", + errno.ErrCantRemoveAllFields: "42000", + errno.ErrCantDropFieldOrKey: "42000", + errno.ErrBlobCantHaveDefault: "42000", + errno.ErrWrongDBName: "42000", + errno.ErrWrongTableName: "42000", + errno.ErrTooBigSelect: "42000", + errno.ErrUnknownProcedure: "42000", + errno.ErrWrongParamcountToProcedure: "42000", + errno.ErrUnknownTable: "42S02", + errno.ErrFieldSpecifiedTwice: "42000", + errno.ErrUnsupportedExtension: "42000", + errno.ErrTableMustHaveColumns: "42000", + errno.ErrUnknownCharacterSet: "42000", + errno.ErrTooBigRowsize: "42000", + errno.ErrWrongOuterJoin: "42000", + errno.ErrNullColumnInIndex: "42000", + errno.ErrPasswordAnonymousUser: "42000", + errno.ErrPasswordNotAllowed: "42000", + errno.ErrPasswordNoMatch: "42000", + errno.ErrWrongValueCountOnRow: "21S01", + errno.ErrInvalidUseOfNull: "22004", + errno.ErrRegexp: "42000", + errno.ErrMixOfGroupFuncAndFields: "42000", + errno.ErrNonexistingGrant: "42000", + errno.ErrTableaccessDenied: "42000", + errno.ErrColumnaccessDenied: "42000", + errno.ErrIllegalGrantForTable: "42000", + errno.ErrGrantWrongHostOrUser: "42000", + errno.ErrNoSuchTable: "42S02", + errno.ErrNonexistingTableGrant: "42000", + errno.ErrNotAllowedCommand: "42000", + errno.ErrSyntax: "42000", + errno.ErrAbortingConnection: "08S01", + errno.ErrNetPacketTooLarge: "08S01", + errno.ErrNetReadErrorFromPipe: "08S01", + errno.ErrNetFcntl: "08S01", + errno.ErrNetPacketsOutOfOrder: "08S01", + errno.ErrNetUncompress: "08S01", + errno.ErrNetRead: "08S01", + errno.ErrNetReadInterrupted: "08S01", + errno.ErrNetErrorOnWrite: "08S01", + errno.ErrNetWriteInterrupted: "08S01", + errno.ErrTooLongString: "42000", + errno.ErrTableCantHandleBlob: "42000", + errno.ErrTableCantHandleAutoIncrement: "42000", + errno.ErrWrongColumnName: "42000", + errno.ErrWrongKeyColumn: "42000", + errno.ErrDupUnique: "23000", + errno.ErrBlobKeyWithoutLength: "42000", + errno.ErrPrimaryCantHaveNull: "42000", + errno.ErrTooManyRows: "42000", + errno.ErrRequiresPrimaryKey: "42000", + errno.ErrKeyDoesNotExist: "42000", + errno.ErrCheckNoSuchTable: "42000", + errno.ErrCheckNotImplemented: "42000", + errno.ErrCantDoThisDuringAnTransaction: "25000", + errno.ErrNewAbortingConnection: "08S01", + errno.ErrMasterNetRead: "08S01", + errno.ErrMasterNetWrite: "08S01", + errno.ErrTooManyUserConnections: "42000", + errno.ErrReadOnlyTransaction: "25000", + errno.ErrNoPermissionToCreateUser: "42000", + errno.ErrLockDeadlock: "40001", + errno.ErrNoReferencedRow: "23000", + errno.ErrRowIsReferenced: "23000", + errno.ErrConnectToMaster: "08S01", + errno.ErrWrongNumberOfColumnsInSelect: "21000", + errno.ErrUserLimitReached: "42000", + errno.ErrSpecificAccessDenied: "42000", + errno.ErrNoDefault: "42000", + errno.ErrWrongValueForVar: "42000", + errno.ErrWrongTypeForVar: "42000", + errno.ErrCantUseOptionHere: "42000", + errno.ErrNotSupportedYet: "42000", + errno.ErrWrongFkDef: "42000", + errno.ErrOperandColumns: "21000", + errno.ErrSubqueryNo1Row: "21000", + errno.ErrIllegalReference: "42S22", + errno.ErrDerivedMustHaveAlias: "42000", + errno.ErrSelectReduced: "01000", + errno.ErrTablenameNotAllowedHere: "42000", + errno.ErrNotSupportedAuthMode: "08004", + errno.ErrSpatialCantHaveNull: "42000", + errno.ErrCollationCharsetMismatch: "42000", + errno.ErrWarnTooFewRecords: "01000", + errno.ErrWarnTooManyRecords: "01000", + errno.ErrWarnNullToNotnull: "22004", + errno.ErrWarnDataOutOfRange: "22003", + errno.WarnDataTruncated: "01000", + errno.ErrWrongNameForIndex: "42000", + errno.ErrWrongNameForCatalog: "42000", + errno.ErrUnknownStorageEngine: "42000", + errno.ErrTruncatedWrongValue: "22007", + errno.ErrSpNoRecursiveCreate: "2F003", + errno.ErrSpAlreadyExists: "42000", + errno.ErrSpDoesNotExist: "42000", + errno.ErrSpLilabelMismatch: "42000", + errno.ErrSpLabelRedefine: "42000", + errno.ErrSpLabelMismatch: "42000", + errno.ErrSpUninitVar: "01000", + errno.ErrSpBadselect: "0A000", + errno.ErrSpBadreturn: "42000", + errno.ErrSpBadstatement: "0A000", + errno.ErrUpdateLogDeprecatedIgnored: "42000", + errno.ErrUpdateLogDeprecatedTranslated: "42000", + errno.ErrQueryInterrupted: "70100", + errno.ErrSpWrongNoOfArgs: "42000", + errno.ErrSpCondMismatch: "42000", + errno.ErrSpNoreturn: "42000", + errno.ErrSpNoreturnend: "2F005", + errno.ErrSpBadCursorQuery: "42000", + errno.ErrSpBadCursorSelect: "42000", + errno.ErrSpCursorMismatch: "42000", + errno.ErrSpCursorAlreadyOpen: "24000", + errno.ErrSpCursorNotOpen: "24000", + errno.ErrSpUndeclaredVar: "42000", + errno.ErrSpFetchNoData: "02000", + errno.ErrSpDupParam: "42000", + errno.ErrSpDupVar: "42000", + errno.ErrSpDupCond: "42000", + errno.ErrSpDupCurs: "42000", + errno.ErrSpSubselectNyi: "0A000", + errno.ErrStmtNotAllowedInSfOrTrg: "0A000", + errno.ErrSpVarcondAfterCurshndlr: "42000", + errno.ErrSpCursorAfterHandler: "42000", + errno.ErrSpCaseNotFound: "20000", + errno.ErrDivisionByZero: "22012", + errno.ErrIllegalValueForType: "22007", + errno.ErrProcaccessDenied: "42000", + errno.ErrXaerNota: "XAE04", + errno.ErrXaerInval: "XAE05", + errno.ErrXaerRmfail: "XAE07", + errno.ErrXaerOutside: "XAE09", + errno.ErrXaerRmerr: "XAE03", + errno.ErrXaRbrollback: "XA100", + errno.ErrNonexistingProcGrant: "42000", + errno.ErrDataTooLong: "22001", + errno.ErrSpBadSQLstate: "42000", + errno.ErrCantCreateUserWithGrant: "42000", + errno.ErrSpDupHandler: "42000", + errno.ErrSpNotVarArg: "42000", + errno.ErrSpNoRetset: "0A000", + errno.ErrCantCreateGeometryObject: "22003", + errno.ErrTooBigScale: "42000", + errno.ErrTooBigPrecision: "42000", + errno.ErrMBiggerThanD: "42000", + errno.ErrTooLongBody: "42000", + errno.ErrTooBigDisplaywidth: "42000", + errno.ErrXaerDupid: "XAE08", + errno.ErrDatetimeFunctionOverflow: "22008", + errno.ErrRowIsReferenced2: "23000", + errno.ErrNoReferencedRow2: "23000", + errno.ErrSpBadVarShadow: "42000", + errno.ErrSpWrongName: "42000", + errno.ErrSpNoAggregate: "42000", + errno.ErrMaxPreparedStmtCountReached: "42000", + errno.ErrNonGroupingFieldUsed: "42000", + errno.ErrForeignDuplicateKeyOldUnused: "23000", + errno.ErrCantChangeTxCharacteristics: "25001", + errno.ErrWrongParamcountToNativeFct: "42000", + errno.ErrWrongParametersToNativeFct: "42000", + errno.ErrWrongParametersToStoredFct: "42000", + errno.ErrDupEntryWithKeyName: "23000", + errno.ErrXaRbtimeout: "XA106", + errno.ErrXaRbdeadlock: "XA102", + errno.ErrFuncInexistentNameCollision: "42000", + errno.ErrDupSignalSet: "42000", + errno.ErrSignalWarn: "01000", + errno.ErrSignalNotFound: "02000", + errno.ErrSignalException: "HY000", + errno.ErrResignalWithoutActiveHandler: "0K000", + errno.ErrSpatialMustHaveGeomCol: "42000", + errno.ErrDataOutOfRange: "22003", + errno.ErrAccessDeniedNoPassword: "28000", + errno.ErrTruncateIllegalForeignKey: "42000", + errno.ErrDaInvalidConditionNumber: "35000", + errno.ErrForeignDuplicateKeyWithChildInfo: "23000", + errno.ErrForeignDuplicateKeyWithoutChildInfo: "23000", + errno.ErrCantExecuteInReadOnlyTransaction: "25006", + errno.ErrAlterOperationNotSupported: "0A000", + errno.ErrAlterOperationNotSupportedReason: "0A000", + errno.ErrDupUnknownInIndex: "23000", + errno.ErrBadGeneratedColumn: "HY000", + errno.ErrUnsupportedOnGeneratedColumn: "HY000", + errno.ErrGeneratedColumnNonPrior: "HY000", + errno.ErrDependentByGeneratedColumn: "HY000", + errno.ErrInvalidJSONText: "22032", + errno.ErrInvalidJSONTextInParam: "22032", + errno.ErrInvalidJSONPath: "42000", + errno.ErrInvalidJSONCharset: "22032", + errno.ErrInvalidJSONData: "22032", + errno.ErrInvalidJSONPathMultipleSelection: "42000", + errno.ErrJSONUsedAsKey: "42000", + errno.ErrJSONVacuousPath: "42000", + errno.ErrJSONBadOneOrAllArg: "42000", + errno.ErrJSONDocumentNULLKey: "22032", + errno.ErrInvalidJSONPathArrayCell: "42000", + errno.ErrInvalidTypeForJSON: "22032", + errno.ErrInvalidJSONValueForFuncIndex: "22018", + errno.ErrInvalidJSONType: "22032", } diff --git a/pkg/parser/terror/BUILD.bazel b/pkg/parser/terror/BUILD.bazel index c51ac9bc2b5d9..a55152ad09e4f 100644 --- a/pkg/parser/terror/BUILD.bazel +++ b/pkg/parser/terror/BUILD.bazel @@ -6,6 +6,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser/terror", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/mysql", "@com_github_pingcap_errors//:errors", "@com_github_pingcap_log//:log", diff --git a/pkg/parser/terror/terror.go b/pkg/parser/terror/terror.go index 58be892236bab..8d8f4c856a5ee 100644 --- a/pkg/parser/terror/terror.go +++ b/pkg/parser/terror/terror.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/mysql" "go.uber.org/zap" ) @@ -197,7 +198,7 @@ func (ec ErrClass) New(code ErrCode, message string) *Error { // NewStdErr defines an *Error with an error code, an error // message and workaround to create standard error. -func (ec ErrClass) NewStdErr(code ErrCode, message *mysql.ErrMessage) *Error { +func (ec ErrClass) NewStdErr(code ErrCode, message *errno.ErrMessage) *Error { rfcCode := ec.initError(code) err := errors.Normalize( message.Raw, errors.RedactArgs(message.RedactArgPos), @@ -211,7 +212,7 @@ func (ec ErrClass) NewStdErr(code ErrCode, message *mysql.ErrMessage) *Error { // this method is not goroutine-safe and // usually be used in global variable initializer func (ec ErrClass) NewStd(code ErrCode) *Error { - return ec.NewStdErr(code, mysql.MySQLErrName[uint16(code)]) + return ec.NewStdErr(code, errno.MySQLErrName[uint16(code)]) } // Synthesize synthesizes an *Error in the air @@ -261,16 +262,16 @@ var ( // ErrClassToMySQLCodes is the map of ErrClass to code-set. ErrClassToMySQLCodes = make(map[ErrClass]map[ErrCode]struct{}) // ErrCritical is the critical error class. - ErrCritical = ClassGlobal.NewStdErr(CodeExecResultIsEmpty, mysql.Message("critical error %v", nil)) + ErrCritical = ClassGlobal.NewStdErr(CodeExecResultIsEmpty, errno.Message("critical error %v", nil)) // ErrResultUndetermined is the error when execution result is unknown. ErrResultUndetermined = ClassGlobal.NewStdErr( CodeResultUndetermined, - mysql.Message("execution result undetermined", nil), + errno.Message("execution result undetermined", nil), ) ) func init() { - defaultMySQLErrorCode = mysql.ErrUnknown + defaultMySQLErrorCode = errno.ErrUnknown } // ErrorEqual returns a boolean indicating whether err1 is equal to err2. diff --git a/pkg/parser/types/BUILD.bazel b/pkg/parser/types/BUILD.bazel index c9af955d45def..94133280ea583 100644 --- a/pkg/parser/types/BUILD.bazel +++ b/pkg/parser/types/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/parser/types", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/charset", "//pkg/parser/format", "//pkg/parser/mysql", diff --git a/pkg/parser/types/etc.go b/pkg/parser/types/etc.go index 74c89ac0d1185..396120220f1c3 100644 --- a/pkg/parser/types/etc.go +++ b/pkg/parser/types/etc.go @@ -20,6 +20,7 @@ package types import ( "strings" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" ) @@ -160,12 +161,12 @@ const ( var ( // ErrInvalidDefault is returned when meet a invalid default value. - ErrInvalidDefault = terror.ClassTypes.NewStd(mysql.ErrInvalidDefault) + ErrInvalidDefault = terror.ClassTypes.NewStd(errno.ErrInvalidDefault) // ErrDataOutOfRange is returned when meet a value out of range. - ErrDataOutOfRange = terror.ClassTypes.NewStd(mysql.ErrDataOutOfRange) + ErrDataOutOfRange = terror.ClassTypes.NewStd(errno.ErrDataOutOfRange) // ErrTruncatedWrongValue is returned when meet a value bigger than // 99999999999999999999999999999999999999999999999999999999999999999 during parsing. - ErrTruncatedWrongValue = terror.ClassTypes.NewStd(mysql.ErrTruncatedWrongValue) + ErrTruncatedWrongValue = terror.ClassTypes.NewStd(errno.ErrTruncatedWrongValue) // ErrIllegalValueForType is returned when strconv.ParseFloat meet strconv.ErrRange during parsing. - ErrIllegalValueForType = terror.ClassTypes.NewStd(mysql.ErrIllegalValueForType) + ErrIllegalValueForType = terror.ClassTypes.NewStd(errno.ErrIllegalValueForType) ) diff --git a/pkg/parser/yy_parser.go b/pkg/parser/yy_parser.go index db2f96bd1a174..3c567616702d0 100644 --- a/pkg/parser/yy_parser.go +++ b/pkg/parser/yy_parser.go @@ -21,6 +21,7 @@ import ( "unicode" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/auth" "github.com/pingcap/tidb/pkg/parser/charset" @@ -31,35 +32,35 @@ import ( var ( // ErrSyntax returns for sql syntax error. - ErrSyntax = terror.ClassParser.NewStd(mysql.ErrSyntax) + ErrSyntax = terror.ClassParser.NewStd(errno.ErrSyntax) // ErrParse returns for sql parse error. - ErrParse = terror.ClassParser.NewStd(mysql.ErrParse) + ErrParse = terror.ClassParser.NewStd(errno.ErrParse) // ErrUnknownCharacterSet returns for no character set found error. - ErrUnknownCharacterSet = terror.ClassParser.NewStd(mysql.ErrUnknownCharacterSet) + ErrUnknownCharacterSet = terror.ClassParser.NewStd(errno.ErrUnknownCharacterSet) // ErrInvalidYearColumnLength returns for illegal column length for year type. - ErrInvalidYearColumnLength = terror.ClassParser.NewStd(mysql.ErrInvalidYearColumnLength) + ErrInvalidYearColumnLength = terror.ClassParser.NewStd(errno.ErrInvalidYearColumnLength) // ErrWrongArguments returns for illegal argument. - ErrWrongArguments = terror.ClassParser.NewStd(mysql.ErrWrongArguments) + ErrWrongArguments = terror.ClassParser.NewStd(errno.ErrWrongArguments) // ErrWrongFieldTerminators returns for illegal field terminators. - ErrWrongFieldTerminators = terror.ClassParser.NewStd(mysql.ErrWrongFieldTerminators) + ErrWrongFieldTerminators = terror.ClassParser.NewStd(errno.ErrWrongFieldTerminators) // ErrTooBigDisplayWidth returns for data display width exceed limit . - ErrTooBigDisplayWidth = terror.ClassParser.NewStd(mysql.ErrTooBigDisplaywidth) + ErrTooBigDisplayWidth = terror.ClassParser.NewStd(errno.ErrTooBigDisplaywidth) // ErrTooBigPrecision returns for data precision exceed limit. - ErrTooBigPrecision = terror.ClassParser.NewStd(mysql.ErrTooBigPrecision) + ErrTooBigPrecision = terror.ClassParser.NewStd(errno.ErrTooBigPrecision) // ErrUnknownAlterLock returns for no alter lock type found error. - ErrUnknownAlterLock = terror.ClassParser.NewStd(mysql.ErrUnknownAlterLock) + ErrUnknownAlterLock = terror.ClassParser.NewStd(errno.ErrUnknownAlterLock) // ErrUnknownAlterAlgorithm returns for no alter algorithm found error. - ErrUnknownAlterAlgorithm = terror.ClassParser.NewStd(mysql.ErrUnknownAlterAlgorithm) + ErrUnknownAlterAlgorithm = terror.ClassParser.NewStd(errno.ErrUnknownAlterAlgorithm) // ErrWrongValue returns for wrong value - ErrWrongValue = terror.ClassParser.NewStd(mysql.ErrWrongValue) + ErrWrongValue = terror.ClassParser.NewStd(errno.ErrWrongValue) // ErrWarnDeprecatedSyntax return when the syntax was deprecated - ErrWarnDeprecatedSyntax = terror.ClassParser.NewStd(mysql.ErrWarnDeprecatedSyntax) + ErrWarnDeprecatedSyntax = terror.ClassParser.NewStd(errno.ErrWarnDeprecatedSyntax) // ErrWarnDeprecatedSyntaxNoReplacement return when the syntax was deprecated and there is no replacement. - ErrWarnDeprecatedSyntaxNoReplacement = terror.ClassParser.NewStd(mysql.ErrWarnDeprecatedSyntaxNoReplacement) + ErrWarnDeprecatedSyntaxNoReplacement = terror.ClassParser.NewStd(errno.ErrWarnDeprecatedSyntaxNoReplacement) // ErrWrongUsage returns for incorrect usages. - ErrWrongUsage = terror.ClassParser.NewStd(mysql.ErrWrongUsage) + ErrWrongUsage = terror.ClassParser.NewStd(errno.ErrWrongUsage) // ErrWrongDBName returns for incorrect DB name. - ErrWrongDBName = terror.ClassParser.NewStd(mysql.ErrWrongDBName) + ErrWrongDBName = terror.ClassParser.NewStd(errno.ErrWrongDBName) // SpecFieldPattern special result field pattern SpecFieldPattern = regexp.MustCompile(`(\/\*!(M?[0-9]{5,6})?|\*\/)`) specCodeStart = regexp.MustCompile(`^\/\*!(M?[0-9]{5,6})?[ \t]*`) diff --git a/pkg/privilege/privileges/cache.go b/pkg/privilege/privileges/cache.go index 30db8dff136d3..b5ba60d048c2a 100644 --- a/pkg/privilege/privileges/cache.go +++ b/pkg/privilege/privileges/cache.go @@ -28,6 +28,7 @@ import ( "time" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/parser/auth" "github.com/pingcap/tidb/pkg/parser/mysql" @@ -583,7 +584,7 @@ func (p *MySQLPrivilege) merge(diff *immutable, userList []string) *MySQLPrivile func noSuchTable(err error) bool { e1 := errors.Cause(err) if e2, ok := e1.(*terror.Error); ok { - if terror.ErrCode(e2.Code()) == terror.ErrCode(mysql.ErrNoSuchTable) { + if terror.ErrCode(e2.Code()) == terror.ErrCode(errno.ErrNoSuchTable) { return true } } diff --git a/pkg/privilege/privileges/errors.go b/pkg/privilege/privileges/errors.go index 2caaade103fe4..1b0f05a103399 100644 --- a/pkg/privilege/privileges/errors.go +++ b/pkg/privilege/privileges/errors.go @@ -15,17 +15,17 @@ package privileges import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // error definitions. var ( - errInvalidPrivilegeType = dbterror.ClassPrivilege.NewStd(mysql.ErrInvalidPrivilegeType) - ErrNonexistingGrant = dbterror.ClassPrivilege.NewStd(mysql.ErrNonexistingGrant) - errLoadPrivilege = dbterror.ClassPrivilege.NewStd(mysql.ErrLoadPrivilege) - ErrAccessDenied = dbterror.ClassPrivilege.NewStd(mysql.ErrAccessDenied) - errAccountHasBeenLocked = dbterror.ClassPrivilege.NewStd(mysql.ErrAccountHasBeenLocked) - ErUserAccessDeniedForUserAccountBlockedByPasswordLock = dbterror.ClassPrivilege.NewStd(mysql.ErUserAccessDeniedForUserAccountBlockedByPasswordLock) - ErrMustChangePasswordLogin = dbterror.ClassPrivilege.NewStd(mysql.ErrMustChangePasswordLogin) + errInvalidPrivilegeType = dbterror.ClassPrivilege.NewStd(errno.ErrInvalidPrivilegeType) + ErrNonexistingGrant = dbterror.ClassPrivilege.NewStd(errno.ErrNonexistingGrant) + errLoadPrivilege = dbterror.ClassPrivilege.NewStd(errno.ErrLoadPrivilege) + ErrAccessDenied = dbterror.ClassPrivilege.NewStd(errno.ErrAccessDenied) + errAccountHasBeenLocked = dbterror.ClassPrivilege.NewStd(errno.ErrAccountHasBeenLocked) + ErUserAccessDeniedForUserAccountBlockedByPasswordLock = dbterror.ClassPrivilege.NewStd(errno.ErUserAccessDeniedForUserAccountBlockedByPasswordLock) + ErrMustChangePasswordLogin = dbterror.ClassPrivilege.NewStd(errno.ErrMustChangePasswordLogin) ) diff --git a/pkg/privilege/privileges/privileges_test.go b/pkg/privilege/privileges/privileges_test.go index 8ec8e217124d2..41e32b95fbf28 100644 --- a/pkg/privilege/privileges/privileges_test.go +++ b/pkg/privilege/privileges/privileges_test.go @@ -1623,7 +1623,7 @@ func TestGrantCreateTmpTables(t *testing.T) { tk.MustExec("CREATE TABLE create_tmp_table_table (a int)") tk.MustExec("GRANT CREATE TEMPORARY TABLES on create_tmp_table_db.* to u1") tk.MustExec("GRANT CREATE TEMPORARY TABLES on *.* to u1") - tk.MustGetErrCode("GRANT CREATE TEMPORARY TABLES on create_tmp_table_db.tmp to u1", mysql.ErrIllegalGrantForTable) + tk.MustGetErrCode("GRANT CREATE TEMPORARY TABLES on create_tmp_table_db.tmp to u1", errno.ErrIllegalGrantForTable) // Must set a session user to avoid null pointer dereference tk.Session().Auth(&auth.UserIdentity{ Username: "root", @@ -1680,21 +1680,21 @@ func TestCreateTmpTablesPriv(t *testing.T) { }, { sql: "insert into tmp select * from t", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "update tmp set id=1 where id=1", }, { sql: "update tmp t1, t t2 set t1.id=t2.id where t1.id=t2.id", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "delete from tmp where id=1", }, { sql: "delete t1 from tmp t1 join t t2 where t1.id=t2.id", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "select * from tmp where id=1", @@ -1707,30 +1707,30 @@ func TestCreateTmpTablesPriv(t *testing.T) { }, { sql: "select * from tmp join t where tmp.id=t.id", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "(select * from tmp) union (select * from t)", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "create temporary table tmp1 like t", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "create table tmp(id int primary key)", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "create table t(id int primary key)", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "analyze table tmp", }, { sql: "analyze table tmp, t", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "show create table tmp", @@ -1738,11 +1738,11 @@ func TestCreateTmpTablesPriv(t *testing.T) { // TODO: issue #29281 to be fixed. //{ // sql: "show create table t", - // errcode: mysql.ErrTableaccessDenied, + // errcode: errno.ErrTableaccessDenied, //}, { sql: "drop sequence tmp", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "alter table tmp add column c1 char(10)", @@ -1753,15 +1753,15 @@ func TestCreateTmpTablesPriv(t *testing.T) { }, { sql: "drop temporary table t", - errcode: mysql.ErrBadTable, + errcode: errno.ErrBadTable, }, { sql: "drop table t", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "drop table t, tmp", - errcode: mysql.ErrTableaccessDenied, + errcode: errno.ErrTableaccessDenied, }, { sql: "drop temporary table tmp", diff --git a/pkg/resourcegroup/tests/resource_group_test.go b/pkg/resourcegroup/tests/resource_group_test.go index f50f1bdacfba1..c256bea6b05eb 100644 --- a/pkg/resourcegroup/tests/resource_group_test.go +++ b/pkg/resourcegroup/tests/resource_group_test.go @@ -27,7 +27,7 @@ import ( "github.com/pingcap/tidb/pkg/ddl/resourcegroup" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/domain/infosync" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/auth" @@ -54,10 +54,10 @@ func TestResourceGroupBasic(t *testing.T) { }) tk.MustExec("set global tidb_enable_resource_control = 'off'") - tk.MustGetErrCode("create user usr1 resource group rg1", mysql.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("create user usr1 resource group rg1", errno.ErrResourceGroupSupportDisabled) tk.MustExec("create user usr1") - tk.MustGetErrCode("alter user usr1 resource group rg1", mysql.ErrResourceGroupSupportDisabled) - tk.MustGetErrCode("create resource group x RU_PER_SEC=1000 ", mysql.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("alter user usr1 resource group rg1", errno.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("create resource group x RU_PER_SEC=1000 ", errno.ErrResourceGroupSupportDisabled) tk.MustExec("set global tidb_enable_resource_control = 'on'") @@ -91,14 +91,14 @@ func TestResourceGroupBasic(t *testing.T) { res.Check(testkit.Rows("Note 8248 Resource group 'x' already exists")) tk.MustExec("set global tidb_enable_resource_control = off") - tk.MustGetErrCode("alter resource group x RU_PER_SEC=2000 ", mysql.ErrResourceGroupSupportDisabled) - tk.MustGetErrCode("alter resource group x RU_PER_SEC=unlimited ", mysql.ErrResourceGroupSupportDisabled) - tk.MustGetErrCode("drop resource group x ", mysql.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("alter resource group x RU_PER_SEC=2000 ", errno.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("alter resource group x RU_PER_SEC=unlimited ", errno.ErrResourceGroupSupportDisabled) + tk.MustGetErrCode("drop resource group x ", errno.ErrResourceGroupSupportDisabled) tk.MustExec("set global tidb_enable_resource_control = DEFAULT") - tk.MustGetErrCode("create resource group x RU_PER_SEC=1000 ", mysql.ErrResourceGroupExists) - tk.MustGetErrCode("create resource group x RU_PER_SEC=UNLIMITED ", mysql.ErrResourceGroupExists) + tk.MustGetErrCode("create resource group x RU_PER_SEC=1000 ", errno.ErrResourceGroupExists) + tk.MustGetErrCode("create resource group x RU_PER_SEC=UNLIMITED ", errno.ErrResourceGroupExists) tk.MustExec("alter resource group x RU_PER_SEC=2000 BURSTABLE QUERY_LIMIT=(EXEC_ELAPSED='15s' ACTION DRYRUN WATCH SIMILAR DURATION '10m0s')") g = testResourceGroupNameFromIS(t, tk.Session(), "x") @@ -151,7 +151,7 @@ func TestResourceGroupBasic(t *testing.T) { } g = testResourceGroupNameFromIS(t, tk.Session(), "y") checkFunc(g) - tk.MustGetErrCode("alter resource group y PRIORITY=hight", mysql.ErrParse) + tk.MustGetErrCode("alter resource group y PRIORITY=hight", errno.ErrParse) tk.MustExec("alter resource group y PRIORITY=high") checkFunc = func(groupInfo *model.ResourceGroupInfo) { re.Equal(true, groupInfo.ID != 0) @@ -202,21 +202,21 @@ func TestResourceGroupBasic(t *testing.T) { g = testResourceGroupNameFromIS(t, tk.Session(), "y") re.Nil(g) - tk.MustGetErrCode("create resource group x ru_per_sec=1000 ru_per_sec=200", mysql.ErrParse) + tk.MustGetErrCode("create resource group x ru_per_sec=1000 ru_per_sec=200", errno.ErrParse) tk.MustContainErrMsg("create resource group x ru_per_sec=1000 ru_per_sec=200, ru_per_sec=300", "Dupliated options specified") - tk.MustGetErrCode("create resource group x burstable, burstable", mysql.ErrParse) + tk.MustGetErrCode("create resource group x burstable, burstable", errno.ErrParse) tk.MustContainErrMsg("create resource group x burstable, burstable", "Dupliated options specified") - tk.MustGetErrCode("create resource group x ru_per_sec=1000, burstable, burstable", mysql.ErrParse) + tk.MustGetErrCode("create resource group x ru_per_sec=1000, burstable, burstable", errno.ErrParse) tk.MustContainErrMsg("create resource group x ru_per_sec=1000, burstable, burstable", "Dupliated options specified") - tk.MustGetErrCode("create resource group x burstable, ru_per_sec=1000, burstable", mysql.ErrParse) + tk.MustGetErrCode("create resource group x burstable, ru_per_sec=1000, burstable", errno.ErrParse) tk.MustContainErrMsg("create resource group x burstable, ru_per_sec=1000, burstable", "Dupliated options specified") tk.MustContainErrMsg("create resource group x ru_per_sec=1000 burstable QUERY_LIMIT=(EXEC_ELAPSED='15s' action kill action cooldown)", "Dupliated runaway options specified") tk.MustContainErrMsg("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15s') burstable priority=Low, QUERY_LIMIT=(EXEC_ELAPSED='15s')", "Dupliated options specified") tk.MustContainErrMsg("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15s') QUERY_LIMIT=(EXEC_ELAPSED='15s')", "Dupliated options specified") tk.MustContainErrMsg("create resource group x ru_per_sec=1000 QUERY_LIMIT=(action kill)", "please set at least one field(exec_elapsed_time_ms, processed_keys, ru)") - tk.MustGetErrCode("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15s' action kil)", mysql.ErrParse) + tk.MustGetErrCode("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15s' action kil)", errno.ErrParse) tk.MustContainErrMsg("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15s')", "unknown resource group runaway action") - tk.MustGetErrCode("create resource group x ru_per_sec=1000 EXEC_ELAPSED='15s' action kill", mysql.ErrParse) + tk.MustGetErrCode("create resource group x ru_per_sec=1000 EXEC_ELAPSED='15s' action kill", errno.ErrParse) tk.MustContainErrMsg("create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED='15d' action kill)", "unknown unit \"d\"") groups, err := infosync.ListResourceGroups(context.TODO()) re.Equal(1, len(groups)) @@ -261,10 +261,10 @@ func TestResourceGroupBasic(t *testing.T) { tk.MustQuery("show create resource group y").Check(testkit.Rows("y CREATE RESOURCE GROUP `y` RU_PER_SEC=4000, PRIORITY=HIGH, BURSTABLE, QUERY_LIMIT=(EXEC_ELAPSED=\"1s\" ACTION=COOLDOWN WATCH=EXACT DURATION=\"1h0m0s\")")) tk.MustQuery("select count(*) from information_schema.resource_groups").Check(testkit.Rows("6")) - tk.MustGetErrCode("create user usr_fail resource group nil_group", mysql.ErrResourceGroupNotExists) + tk.MustGetErrCode("create user usr_fail resource group nil_group", errno.ErrResourceGroupNotExists) tk.MustContainErrMsg("create user usr_fail resource group nil_group", "Unknown resource group 'nil_group'") tk.MustExec("create user user2") - tk.MustGetErrCode("alter user user2 resource group nil_group", mysql.ErrResourceGroupNotExists) + tk.MustGetErrCode("alter user user2 resource group nil_group", errno.ErrResourceGroupNotExists) tk.MustContainErrMsg("alter user user2 resource group nil_group", "Unknown resource group 'nil_group'") tk.MustExec("create resource group do_not_delete_rg ru_per_sec=100") @@ -284,7 +284,7 @@ func TestResourceGroupBasic(t *testing.T) { tk.MustContainErrMsg("create resource group bg ru_per_sec = 1000 background = (task_types = 'lightning')", "unsupported operation") tk.MustContainErrMsg("alter resource group x background=(task_types='')", "unsupported operation") - tk.MustGetErrCode("alter resource group default background=(task_types='a,b,c')", mysql.ErrResourceGroupInvalidBackgroundTaskName) + tk.MustGetErrCode("alter resource group default background=(task_types='a,b,c')", errno.ErrResourceGroupInvalidBackgroundTaskName) tk.MustExec("alter resource group `default` BACKGROUND=(task_types='br,ddl')") tk.MustQuery("select * from information_schema.resource_groups where name = 'default'").Check(testkit.Rows("default 1000 MEDIUM YES TASK_TYPES='br,ddl'")) @@ -348,7 +348,7 @@ func TestResourceGroupRunaway(t *testing.T) { err = tk.QueryToErr("select /*+ resource_group(rg2) */ * from t") require.ErrorContains(t, err, "Query execution was interrupted, identified as runaway query") - tk.MustGetErrCode("select /*+ resource_group(rg2) */ * from t", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg2) */ * from t", errno.ErrResourceGroupQueryRunawayQuarantine) tk.EventuallyMustQueryAndCheck("select SQL_NO_CACHE resource_group_name, sample_sql, match_type from mysql.tidb_runaway_queries", nil, testkit.Rows("rg2 select /*+ resource_group(rg2) */ * from t identify", "rg2 select /*+ resource_group(rg2) */ * from t watch"), maxWaitDuration, tryInterval) @@ -365,7 +365,7 @@ func TestResourceGroupRunaway(t *testing.T) { nil, maxWaitDuration, tryInterval) err = tk.QueryToErr("select /*+ resource_group(rg3) */ * from t") require.ErrorContains(t, err, "Query execution was interrupted, identified as runaway query") - tk.MustGetErrCode("select /*+ resource_group(rg3) */ * from t", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg3) */ * from t", errno.ErrResourceGroupQueryRunawayQuarantine) tk.EventuallyMustQueryAndCheck("select SQL_NO_CACHE resource_group_name, watch_text from mysql.tidb_runaway_watch", nil, testkit.Rows("rg3 select /*+ resource_group(rg3) */ * from t"), maxWaitDuration, tryInterval) @@ -373,7 +373,7 @@ func TestResourceGroupRunaway(t *testing.T) { tk.MustQuery("select /*+ resource_group(rg2) */ * from t").Check(testkit.Rows("1")) tk.MustExec("alter resource group rg2 RU_PER_SEC=1000 QUERY_LIMIT=(EXEC_ELAPSED='50ms' ACTION=DRYRUN)") tk.MustQuery("select /*+ resource_group(rg2) */ * from t").Check(testkit.Rows("1")) - tk.MustGetErrCode("select /*+ resource_group(rg3) */ * from t", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg3) */ * from t", errno.ErrResourceGroupQueryRunawayQuarantine) require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/store/copr/sleepCoprRequest")) tk.MustExec("create resource group rg4 BURSTABLE RU_PER_SEC=2000 QUERY_LIMIT=(EXEC_ELAPSED='50ms' action KILL WATCH EXACT)") @@ -384,7 +384,7 @@ func TestResourceGroupRunaway(t *testing.T) { require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/resourcegroup/runaway/checkThresholds", fmt.Sprintf("return(%d)", 60))) err = tk.QueryToErr("select /*+ resource_group(rg4) */ * from t") require.ErrorContains(t, err, "Query execution was interrupted, identified as runaway query") - tk.MustGetErrCode("select /*+ resource_group(rg4) */ * from t", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg4) */ * from t", errno.ErrResourceGroupQueryRunawayQuarantine) tk.EventuallyMustQueryAndCheck("select SQL_NO_CACHE resource_group_name, watch_text from mysql.tidb_runaway_watch", nil, testkit.Rows("rg3 select /*+ resource_group(rg3) */ * from t", "rg4 select /*+ resource_group(rg4) */ * from t"), maxWaitDuration, tryInterval) require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/resourcegroup/runaway/checkThresholds")) @@ -393,7 +393,7 @@ func TestResourceGroupRunaway(t *testing.T) { require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/resourcegroup/runaway/checkThresholds", "return(true)")) err = tk.QueryToErr("select /*+ resource_group(rg5) */ * from t") require.ErrorContains(t, err, "Query execution was interrupted, identified as runaway query") - tk.MustGetErrCode("select /*+ resource_group(rg5) */ * from t", mysql.ErrResourceGroupQueryRunawayQuarantine) + tk.MustGetErrCode("select /*+ resource_group(rg5) */ * from t", errno.ErrResourceGroupQueryRunawayQuarantine) require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/resourcegroup/runaway/checkThresholds")) } diff --git a/pkg/server/conn.go b/pkg/server/conn.go index f7a45129d4cce..cf2feedaec66d 100644 --- a/pkg/server/conn.go +++ b/pkg/server/conn.go @@ -1419,7 +1419,7 @@ func (cc *clientConn) dispatch(ctx context.Context, data []byte) error { return cc.handleResetConnection(ctx) // ComEnd default: - return mysql.NewErrf(mysql.ErrUnknown, "command %d not supported now", nil, cmd) + return mysql.NewErrf(errno.ErrUnknown, "command %d not supported now", nil, cmd) } } @@ -1550,7 +1550,7 @@ func (cc *clientConn) writeError(ctx context.Context, e error) error { case *terror.Error: m = terror.ToSQLError(y) default: - m = mysql.NewErrf(mysql.ErrUnknown, "%s", nil, e.Error()) + m = mysql.NewErrf(errno.ErrUnknown, "%s", nil, e.Error()) } } diff --git a/pkg/server/conn_stmt.go b/pkg/server/conn_stmt.go index 19ac430500944..782fdb2b77f3c 100644 --- a/pkg/server/conn_stmt.go +++ b/pkg/server/conn_stmt.go @@ -44,6 +44,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/param" "github.com/pingcap/tidb/pkg/parser" @@ -143,7 +144,7 @@ func (cc *clientConn) handleStmtExecute(ctx context.Context, data []byte) (err e stmt := cc.ctx.GetStatement(int(stmtID)) if stmt == nil { - return mysql.NewErr(mysql.ErrUnknownStmtHandler, + return mysql.NewErr(errno.ErrUnknownStmtHandler, strconv.FormatUint(uint64(stmtID), 10), "stmt_execute") } @@ -157,10 +158,10 @@ func (cc *clientConn) handleStmtExecute(ctx context.Context, data []byte) (err e useCursor = true } if flag&mysql.CursorTypeForUpdate > 0 { - return mysql.NewErrf(mysql.ErrUnknown, "unsupported flag: CursorTypeForUpdate", nil) + return mysql.NewErrf(errno.ErrUnknown, "unsupported flag: CursorTypeForUpdate", nil) } if flag&mysql.CursorTypeScrollable > 0 { - return mysql.NewErrf(mysql.ErrUnknown, "unsupported flag: CursorTypeScrollable", nil) + return mysql.NewErrf(errno.ErrUnknown, "unsupported flag: CursorTypeScrollable", nil) } if useCursor { @@ -494,11 +495,11 @@ func (cc *clientConn) handleStmtFetch(ctx context.Context, data []byte) (err err stmt := cc.ctx.GetStatement(int(stmtID)) if stmt == nil { - return errors.Annotate(mysql.NewErr(mysql.ErrUnknownStmtHandler, + return errors.Annotate(mysql.NewErr(errno.ErrUnknownStmtHandler, strconv.FormatUint(uint64(stmtID), 10), "stmt_fetch"), cc.preparedStmt2String(stmtID)) } if !stmt.GetCursorActive() { - return errors.Annotate(mysql.NewErr(mysql.ErrSpCursorNotOpen), cc.preparedStmt2String(stmtID)) + return errors.Annotate(mysql.NewErr(errno.ErrSpCursorNotOpen), cc.preparedStmt2String(stmtID)) } // from now on, we have made sure: the statement has an active cursor // then if facing any error, this cursor should be reset @@ -567,7 +568,7 @@ func (cc *clientConn) handleStmtSendLongData(data []byte) (err error) { stmt := cc.ctx.GetStatement(stmtID) if stmt == nil { - return mysql.NewErr(mysql.ErrUnknownStmtHandler, + return mysql.NewErr(errno.ErrUnknownStmtHandler, strconv.Itoa(stmtID), "stmt_send_longdata") } @@ -587,7 +588,7 @@ func (cc *clientConn) handleStmtReset(ctx context.Context, data []byte) (err err stmtID := int(binary.LittleEndian.Uint32(data[0:4])) stmt := cc.ctx.GetStatement(stmtID) if stmt == nil { - return mysql.NewErr(mysql.ErrUnknownStmtHandler, + return mysql.NewErr(errno.ErrUnknownStmtHandler, strconv.Itoa(stmtID), "stmt_reset") } err = stmt.Reset() diff --git a/pkg/server/conn_stmt_params.go b/pkg/server/conn_stmt_params.go index 29fbfd9b058c4..4c19b96ea9166 100644 --- a/pkg/server/conn_stmt_params.go +++ b/pkg/server/conn_stmt_params.go @@ -44,7 +44,7 @@ func parseBinaryParams(params []param.BinaryParam, boundParams [][]byte, nullBit } // The legacy logic is kept: if the `paramTypes` somehow didn't contain the type information, it will be treated as - // BLOB type. We didn't return `mysql.ErrMalformPacket` to keep compatibility with older versions, though it's + // BLOB type. We didn't return `errno.ErrMalformPacket` to keep compatibility with older versions, though it's // meaningless if every clients work properly. if (i<<1)+1 < len(paramTypes) { // Only TEXT or BLOB type will be sent through `SEND_LONG_DATA`. diff --git a/pkg/server/conn_test.go b/pkg/server/conn_test.go index 03b81fb0fa043..58f9257ca4818 100644 --- a/pkg/server/conn_test.go +++ b/pkg/server/conn_test.go @@ -35,6 +35,7 @@ import ( "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/tidb/pkg/config" "github.com/pingcap/tidb/pkg/domain" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/extension" "github.com/pingcap/tidb/pkg/metrics" "github.com/pingcap/tidb/pkg/parser/auth" @@ -335,7 +336,7 @@ func TestDispatch(t *testing.T) { { com: mysql.ComSleep, in: nil, - err: mysql.NewErrf(mysql.ErrUnknown, "command %d not supported now", nil, mysql.ComSleep), + err: mysql.NewErrf(errno.ErrUnknown, "command %d not supported now", nil, mysql.ComSleep), out: nil, }, { @@ -454,7 +455,7 @@ func TestDispatchClientProtocol41(t *testing.T) { { com: mysql.ComSleep, in: nil, - err: mysql.NewErrf(mysql.ErrUnknown, "command %d not supported now", nil, mysql.ComSleep), + err: mysql.NewErrf(errno.ErrUnknown, "command %d not supported now", nil, mysql.ComSleep), out: nil, }, { diff --git a/pkg/server/driver_tidb.go b/pkg/server/driver_tidb.go index 2369342728861..ed3366ccb5e54 100644 --- a/pkg/server/driver_tidb.go +++ b/pkg/server/driver_tidb.go @@ -21,6 +21,7 @@ import ( "strings" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/extension" "github.com/pingcap/tidb/pkg/kv" @@ -100,7 +101,7 @@ func (ts *TiDBStatement) Execute(ctx context.Context, args []expression.Expressi // AppendParam implements PreparedStatement AppendParam method. func (ts *TiDBStatement) AppendParam(paramID int, data []byte) error { if paramID >= len(ts.boundParams) { - return mysql.NewErr(mysql.ErrWrongArguments, "stmt_send_longdata") + return mysql.NewErr(errno.ErrWrongArguments, "stmt_send_longdata") } // If len(data) is 0, append an empty byte slice to the end to distinguish no data and no parameter. if len(data) == 0 { diff --git a/pkg/session/session.go b/pkg/session/session.go index 1cdf1bb96a8d8..dd051631a3a08 100644 --- a/pkg/session/session.go +++ b/pkg/session/session.go @@ -1691,7 +1691,7 @@ func (s *session) IsUsedAdvisoryLock(lockName string) uint64 { err = lock.IsUsedLock(lockName) if err != nil { // TODO: Return actual owner pid - // TODO: Check for mysql.ErrLockWaitTimeout and DeadLock + // TODO: Check for errno.ErrLockWaitTimeout and DeadLock return 1 } return 0 diff --git a/pkg/sessionctx/variable/error.go b/pkg/sessionctx/variable/error.go index 399b619aa157f..1c2d09efa9eda 100644 --- a/pkg/sessionctx/variable/error.go +++ b/pkg/sessionctx/variable/error.go @@ -15,36 +15,35 @@ package variable import ( - mysql "github.com/pingcap/tidb/pkg/errno" - pmysql "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // Error instances. var ( - errWarnDeprecatedSyntax = dbterror.ClassVariable.NewStd(mysql.ErrWarnDeprecatedSyntax) - ErrSnapshotTooOld = dbterror.ClassVariable.NewStd(mysql.ErrSnapshotTooOld) - ErrUnsupportedValueForVar = dbterror.ClassVariable.NewStd(mysql.ErrUnsupportedValueForVar) - ErrUnknownSystemVar = dbterror.ClassVariable.NewStd(mysql.ErrUnknownSystemVariable) - ErrIncorrectScope = dbterror.ClassVariable.NewStd(mysql.ErrIncorrectGlobalLocalVar) - ErrUnknownTimeZone = dbterror.ClassVariable.NewStd(mysql.ErrUnknownTimeZone) - ErrReadOnly = dbterror.ClassVariable.NewStd(mysql.ErrVariableIsReadonly) - ErrWrongValueForVar = dbterror.ClassVariable.NewStd(mysql.ErrWrongValueForVar) - ErrWrongTypeForVar = dbterror.ClassVariable.NewStd(mysql.ErrWrongTypeForVar) - ErrTruncatedWrongValue = dbterror.ClassVariable.NewStd(mysql.ErrTruncatedWrongValue) - ErrMaxPreparedStmtCountReached = dbterror.ClassVariable.NewStd(mysql.ErrMaxPreparedStmtCountReached) - ErrUnsupportedIsolationLevel = dbterror.ClassVariable.NewStd(mysql.ErrUnsupportedIsolationLevel) - errUnknownSystemVariable = dbterror.ClassVariable.NewStd(mysql.ErrUnknownSystemVariable) - errGlobalVariable = dbterror.ClassVariable.NewStd(mysql.ErrGlobalVariable) - errLocalVariable = dbterror.ClassVariable.NewStd(mysql.ErrLocalVariable) - errValueNotSupportedWhen = dbterror.ClassVariable.NewStdErr(mysql.ErrNotSupportedYet, pmysql.Message("%s = OFF is not supported when %s = ON", nil)) - ErrNotValidPassword = dbterror.ClassExecutor.NewStd(mysql.ErrNotValidPassword) + errWarnDeprecatedSyntax = dbterror.ClassVariable.NewStd(errno.ErrWarnDeprecatedSyntax) + ErrSnapshotTooOld = dbterror.ClassVariable.NewStd(errno.ErrSnapshotTooOld) + ErrUnsupportedValueForVar = dbterror.ClassVariable.NewStd(errno.ErrUnsupportedValueForVar) + ErrUnknownSystemVar = dbterror.ClassVariable.NewStd(errno.ErrUnknownSystemVariable) + ErrIncorrectScope = dbterror.ClassVariable.NewStd(errno.ErrIncorrectGlobalLocalVar) + ErrUnknownTimeZone = dbterror.ClassVariable.NewStd(errno.ErrUnknownTimeZone) + ErrReadOnly = dbterror.ClassVariable.NewStd(errno.ErrVariableIsReadonly) + ErrWrongValueForVar = dbterror.ClassVariable.NewStd(errno.ErrWrongValueForVar) + ErrWrongTypeForVar = dbterror.ClassVariable.NewStd(errno.ErrWrongTypeForVar) + ErrTruncatedWrongValue = dbterror.ClassVariable.NewStd(errno.ErrTruncatedWrongValue) + ErrMaxPreparedStmtCountReached = dbterror.ClassVariable.NewStd(errno.ErrMaxPreparedStmtCountReached) + ErrUnsupportedIsolationLevel = dbterror.ClassVariable.NewStd(errno.ErrUnsupportedIsolationLevel) + errUnknownSystemVariable = dbterror.ClassVariable.NewStd(errno.ErrUnknownSystemVariable) + errGlobalVariable = dbterror.ClassVariable.NewStd(errno.ErrGlobalVariable) + errLocalVariable = dbterror.ClassVariable.NewStd(errno.ErrLocalVariable) + errValueNotSupportedWhen = dbterror.ClassVariable.NewStdErr(errno.ErrNotSupportedYet, errno.Message("%s = OFF is not supported when %s = ON", nil)) + ErrNotValidPassword = dbterror.ClassExecutor.NewStd(errno.ErrNotValidPassword) // ErrFunctionsNoopImpl is an error to say the behavior is protected by the tidb_enable_noop_functions sysvar. // This is copied from expression.ErrFunctionsNoopImpl to prevent circular dependencies. // It needs to be public for tests. - ErrFunctionsNoopImpl = dbterror.ClassVariable.NewStdErr(mysql.ErrNotSupportedYet, pmysql.Message("function %s has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions", nil)) - ErrVariableNoLongerSupported = dbterror.ClassVariable.NewStd(mysql.ErrVariableNoLongerSupported) - ErrInvalidDefaultUTF8MB4Collation = dbterror.ClassVariable.NewStd(mysql.ErrInvalidDefaultUTF8MB4Collation) - ErrWarnDeprecatedSyntaxNoReplacement = dbterror.ClassVariable.NewStdErr(mysql.ErrWarnDeprecatedSyntaxNoReplacement, pmysql.Message("Updating '%s' is deprecated. It will be made read-only in a future release.", nil)) - ErrWarnDeprecatedSyntaxSimpleMsg = dbterror.ClassVariable.NewStdErr(mysql.ErrWarnDeprecatedSyntaxNoReplacement, pmysql.Message("%s is deprecated and will be removed in a future release.", nil)) + ErrFunctionsNoopImpl = dbterror.ClassVariable.NewStdErr(errno.ErrNotSupportedYet, errno.Message("function %s has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions", nil)) + ErrVariableNoLongerSupported = dbterror.ClassVariable.NewStd(errno.ErrVariableNoLongerSupported) + ErrInvalidDefaultUTF8MB4Collation = dbterror.ClassVariable.NewStd(errno.ErrInvalidDefaultUTF8MB4Collation) + ErrWarnDeprecatedSyntaxNoReplacement = dbterror.ClassVariable.NewStdErr(errno.ErrWarnDeprecatedSyntaxNoReplacement, errno.Message("Updating '%s' is deprecated. It will be made read-only in a future release.", nil)) + ErrWarnDeprecatedSyntaxSimpleMsg = dbterror.ClassVariable.NewStdErr(errno.ErrWarnDeprecatedSyntaxNoReplacement, errno.Message("%s is deprecated and will be removed in a future release.", nil)) ) diff --git a/pkg/sessionctx/variable/variable_test.go b/pkg/sessionctx/variable/variable_test.go index 3a1057082b647..ef2bb036cd88a 100644 --- a/pkg/sessionctx/variable/variable_test.go +++ b/pkg/sessionctx/variable/variable_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/pingcap/tidb/pkg/config" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" @@ -81,7 +82,7 @@ func TestError(t *testing.T) { ErrUnsupportedIsolationLevel, } for _, err := range kvErrs { - require.True(t, terror.ToSQLError(err).Code != mysql.ErrUnknown) + require.True(t, terror.ToSQLError(err).Code != errno.ErrUnknown) } } diff --git a/pkg/statistics/BUILD.bazel b/pkg/statistics/BUILD.bazel index 5b388ddc2cc5f..3c6d8e26fee96 100644 --- a/pkg/statistics/BUILD.bazel +++ b/pkg/statistics/BUILD.bazel @@ -23,6 +23,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/statistics", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/expression", "//pkg/kv", "//pkg/meta/model", diff --git a/pkg/statistics/cmsketch.go b/pkg/statistics/cmsketch.go index f0c1ee11ceceb..365fe456cd781 100644 --- a/pkg/statistics/cmsketch.go +++ b/pkg/statistics/cmsketch.go @@ -27,7 +27,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/planner/planctx" "github.com/pingcap/tidb/pkg/planner/util/debugtrace" "github.com/pingcap/tidb/pkg/sessionctx" @@ -46,7 +46,7 @@ const topNThreshold = uint64(10) var ( // ErrQueryInterrupted indicates interrupted - ErrQueryInterrupted = dbterror.ClassExecutor.NewStd(mysql.ErrQueryInterrupted) + ErrQueryInterrupted = dbterror.ClassExecutor.NewStd(errno.ErrQueryInterrupted) ) // CMSketch is used to estimate point queries. diff --git a/pkg/structure/structure.go b/pkg/structure/structure.go index 7d916a90720c1..5a53cb30cd424 100644 --- a/pkg/structure/structure.go +++ b/pkg/structure/structure.go @@ -15,20 +15,20 @@ package structure import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/util/dbterror" ) var ( // ErrInvalidHashKeyFlag used by structure - ErrInvalidHashKeyFlag = dbterror.ClassStructure.NewStd(mysql.ErrInvalidHashKeyFlag) + ErrInvalidHashKeyFlag = dbterror.ClassStructure.NewStd(errno.ErrInvalidHashKeyFlag) // ErrInvalidListIndex used by structure - ErrInvalidListIndex = dbterror.ClassStructure.NewStd(mysql.ErrInvalidListIndex) + ErrInvalidListIndex = dbterror.ClassStructure.NewStd(errno.ErrInvalidListIndex) // ErrInvalidListMetaData used by structure - ErrInvalidListMetaData = dbterror.ClassStructure.NewStd(mysql.ErrInvalidListMetaData) + ErrInvalidListMetaData = dbterror.ClassStructure.NewStd(errno.ErrInvalidListMetaData) // ErrWriteOnSnapshot used by structure - ErrWriteOnSnapshot = dbterror.ClassStructure.NewStd(mysql.ErrWriteOnSnapshot) + ErrWriteOnSnapshot = dbterror.ClassStructure.NewStd(errno.ErrWriteOnSnapshot) ) // NewStructure creates a TxStructure with Retriever, RetrieverMutator and key prefix. diff --git a/pkg/structure/structure_test.go b/pkg/structure/structure_test.go index 92b31824f6351..7d81a6941dbad 100644 --- a/pkg/structure/structure_test.go +++ b/pkg/structure/structure_test.go @@ -18,8 +18,8 @@ import ( "context" "testing" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/structure" "github.com/pingcap/tidb/pkg/testkit" @@ -351,7 +351,7 @@ func TestError(t *testing.T) { } for _, err := range kvErrs { code := terror.ToSQLError(err).Code - require.NotEqual(t, mysql.ErrUnknown, code) + require.NotEqual(t, errno.ErrUnknown, code) require.Equal(t, uint16(err.Code()), code, "err: %v", err) } } diff --git a/pkg/table/table.go b/pkg/table/table.go index 73fc9f9260fdc..f38334cf36423 100644 --- a/pkg/table/table.go +++ b/pkg/table/table.go @@ -22,7 +22,7 @@ import ( "context" "time" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/expression/exprctx" "github.com/pingcap/tidb/pkg/kv" @@ -68,53 +68,53 @@ func (tp Type) IsClusterTable() bool { var ( // ErrColumnCantNull is used for inserting null to a not null column. - ErrColumnCantNull = dbterror.ClassTable.NewStd(mysql.ErrBadNull) + ErrColumnCantNull = dbterror.ClassTable.NewStd(errno.ErrBadNull) // ErrUnknownColumn is returned when accessing an unknown column. - ErrUnknownColumn = dbterror.ClassTable.NewStd(mysql.ErrBadField) - errDuplicateColumn = dbterror.ClassTable.NewStd(mysql.ErrFieldSpecifiedTwice) + ErrUnknownColumn = dbterror.ClassTable.NewStd(errno.ErrBadField) + errDuplicateColumn = dbterror.ClassTable.NewStd(errno.ErrFieldSpecifiedTwice) // ErrWarnNullToNotnull is like ErrColumnCantNull but it's used in LOAD DATA - ErrWarnNullToNotnull = dbterror.ClassExecutor.NewStd(mysql.ErrWarnNullToNotnull) + ErrWarnNullToNotnull = dbterror.ClassExecutor.NewStd(errno.ErrWarnNullToNotnull) - errGetDefaultFailed = dbterror.ClassTable.NewStd(mysql.ErrFieldGetDefaultFailed) + errGetDefaultFailed = dbterror.ClassTable.NewStd(errno.ErrFieldGetDefaultFailed) // ErrNoDefaultValue is used when insert a row, the column value is not given, and the column has not null flag // and it doesn't have a default value. - ErrNoDefaultValue = dbterror.ClassTable.NewStd(mysql.ErrNoDefaultForField) + ErrNoDefaultValue = dbterror.ClassTable.NewStd(errno.ErrNoDefaultForField) // ErrIndexOutBound returns for index column offset out of bound. - ErrIndexOutBound = dbterror.ClassTable.NewStd(mysql.ErrIndexOutBound) + ErrIndexOutBound = dbterror.ClassTable.NewStd(errno.ErrIndexOutBound) // ErrUnsupportedOp returns for unsupported operation. - ErrUnsupportedOp = dbterror.ClassTable.NewStd(mysql.ErrUnsupportedOp) + ErrUnsupportedOp = dbterror.ClassTable.NewStd(errno.ErrUnsupportedOp) // ErrRowNotFound returns for row not found. - ErrRowNotFound = dbterror.ClassTable.NewStd(mysql.ErrRowNotFound) + ErrRowNotFound = dbterror.ClassTable.NewStd(errno.ErrRowNotFound) // ErrTableStateCantNone returns for table none state. - ErrTableStateCantNone = dbterror.ClassTable.NewStd(mysql.ErrTableStateCantNone) + ErrTableStateCantNone = dbterror.ClassTable.NewStd(errno.ErrTableStateCantNone) // ErrColumnStateCantNone returns for column none state. - ErrColumnStateCantNone = dbterror.ClassTable.NewStd(mysql.ErrColumnStateCantNone) + ErrColumnStateCantNone = dbterror.ClassTable.NewStd(errno.ErrColumnStateCantNone) // ErrColumnStateNonPublic returns for column non-public state. - ErrColumnStateNonPublic = dbterror.ClassTable.NewStd(mysql.ErrColumnStateNonPublic) + ErrColumnStateNonPublic = dbterror.ClassTable.NewStd(errno.ErrColumnStateNonPublic) // ErrIndexStateCantNone returns for index none state. - ErrIndexStateCantNone = dbterror.ClassTable.NewStd(mysql.ErrIndexStateCantNone) + ErrIndexStateCantNone = dbterror.ClassTable.NewStd(errno.ErrIndexStateCantNone) // ErrInvalidRecordKey returns for invalid record key. - ErrInvalidRecordKey = dbterror.ClassTable.NewStd(mysql.ErrInvalidRecordKey) + ErrInvalidRecordKey = dbterror.ClassTable.NewStd(errno.ErrInvalidRecordKey) // ErrTruncatedWrongValueForField returns for truncate wrong value for field. - ErrTruncatedWrongValueForField = dbterror.ClassTable.NewStd(mysql.ErrTruncatedWrongValueForField) + ErrTruncatedWrongValueForField = dbterror.ClassTable.NewStd(errno.ErrTruncatedWrongValueForField) // ErrUnknownPartition returns unknown partition error. - ErrUnknownPartition = dbterror.ClassTable.NewStd(mysql.ErrUnknownPartition) + ErrUnknownPartition = dbterror.ClassTable.NewStd(errno.ErrUnknownPartition) // ErrNoPartitionForGivenValue returns table has no partition for value. - ErrNoPartitionForGivenValue = dbterror.ClassTable.NewStd(mysql.ErrNoPartitionForGivenValue) + ErrNoPartitionForGivenValue = dbterror.ClassTable.NewStd(errno.ErrNoPartitionForGivenValue) // ErrLockOrActiveTransaction returns when execute unsupported statement in a lock session or an active transaction. - ErrLockOrActiveTransaction = dbterror.ClassTable.NewStd(mysql.ErrLockOrActiveTransaction) + ErrLockOrActiveTransaction = dbterror.ClassTable.NewStd(errno.ErrLockOrActiveTransaction) // ErrSequenceHasRunOut returns when sequence has run out. - ErrSequenceHasRunOut = dbterror.ClassTable.NewStd(mysql.ErrSequenceRunOut) + ErrSequenceHasRunOut = dbterror.ClassTable.NewStd(errno.ErrSequenceRunOut) // ErrRowDoesNotMatchGivenPartitionSet returns when the destination partition conflict with the partition selection. - ErrRowDoesNotMatchGivenPartitionSet = dbterror.ClassTable.NewStd(mysql.ErrRowDoesNotMatchGivenPartitionSet) + ErrRowDoesNotMatchGivenPartitionSet = dbterror.ClassTable.NewStd(errno.ErrRowDoesNotMatchGivenPartitionSet) // ErrTempTableFull returns a table is full error, it's used by temporary table now. - ErrTempTableFull = dbterror.ClassTable.NewStd(mysql.ErrRecordFileFull) + ErrTempTableFull = dbterror.ClassTable.NewStd(errno.ErrRecordFileFull) // ErrOptOnCacheTable returns when exec unsupported opt at cache mode - ErrOptOnCacheTable = dbterror.ClassDDL.NewStd(mysql.ErrOptOnCacheTable) + ErrOptOnCacheTable = dbterror.ClassDDL.NewStd(errno.ErrOptOnCacheTable) // ErrCheckConstraintViolated return when check constraint is violated. - ErrCheckConstraintViolated = dbterror.ClassTable.NewStd(mysql.ErrCheckConstraintViolated) + ErrCheckConstraintViolated = dbterror.ClassTable.NewStd(errno.ErrCheckConstraintViolated) ) // RecordIterFunc is used for low-level record iteration. diff --git a/pkg/table/table_test.go b/pkg/table/table_test.go index 466dc819f871a..ff407e6b6feb4 100644 --- a/pkg/table/table_test.go +++ b/pkg/table/table_test.go @@ -18,29 +18,29 @@ import ( "context" "testing" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/stretchr/testify/require" ) func TestErrorCode(t *testing.T) { - require.Equal(t, mysql.ErrBadNull, int(terror.ToSQLError(ErrColumnCantNull).Code)) - require.Equal(t, mysql.ErrBadField, int(terror.ToSQLError(ErrUnknownColumn).Code)) - require.Equal(t, mysql.ErrFieldSpecifiedTwice, int(terror.ToSQLError(errDuplicateColumn).Code)) - require.Equal(t, mysql.ErrFieldGetDefaultFailed, int(terror.ToSQLError(errGetDefaultFailed).Code)) - require.Equal(t, mysql.ErrNoDefaultForField, int(terror.ToSQLError(ErrNoDefaultValue).Code)) - require.Equal(t, mysql.ErrIndexOutBound, int(terror.ToSQLError(ErrIndexOutBound).Code)) - require.Equal(t, mysql.ErrUnsupportedOp, int(terror.ToSQLError(ErrUnsupportedOp).Code)) - require.Equal(t, mysql.ErrRowNotFound, int(terror.ToSQLError(ErrRowNotFound).Code)) - require.Equal(t, mysql.ErrTableStateCantNone, int(terror.ToSQLError(ErrTableStateCantNone).Code)) - require.Equal(t, mysql.ErrColumnStateCantNone, int(terror.ToSQLError(ErrColumnStateCantNone).Code)) - require.Equal(t, mysql.ErrColumnStateNonPublic, int(terror.ToSQLError(ErrColumnStateNonPublic).Code)) - require.Equal(t, mysql.ErrIndexStateCantNone, int(terror.ToSQLError(ErrIndexStateCantNone).Code)) - require.Equal(t, mysql.ErrInvalidRecordKey, int(terror.ToSQLError(ErrInvalidRecordKey).Code)) - require.Equal(t, mysql.ErrTruncatedWrongValueForField, int(terror.ToSQLError(ErrTruncatedWrongValueForField).Code)) - require.Equal(t, mysql.ErrUnknownPartition, int(terror.ToSQLError(ErrUnknownPartition).Code)) - require.Equal(t, mysql.ErrNoPartitionForGivenValue, int(terror.ToSQLError(ErrNoPartitionForGivenValue).Code)) - require.Equal(t, mysql.ErrLockOrActiveTransaction, int(terror.ToSQLError(ErrLockOrActiveTransaction).Code)) + require.Equal(t, errno.ErrBadNull, int(terror.ToSQLError(ErrColumnCantNull).Code)) + require.Equal(t, errno.ErrBadField, int(terror.ToSQLError(ErrUnknownColumn).Code)) + require.Equal(t, errno.ErrFieldSpecifiedTwice, int(terror.ToSQLError(errDuplicateColumn).Code)) + require.Equal(t, errno.ErrFieldGetDefaultFailed, int(terror.ToSQLError(errGetDefaultFailed).Code)) + require.Equal(t, errno.ErrNoDefaultForField, int(terror.ToSQLError(ErrNoDefaultValue).Code)) + require.Equal(t, errno.ErrIndexOutBound, int(terror.ToSQLError(ErrIndexOutBound).Code)) + require.Equal(t, errno.ErrUnsupportedOp, int(terror.ToSQLError(ErrUnsupportedOp).Code)) + require.Equal(t, errno.ErrRowNotFound, int(terror.ToSQLError(ErrRowNotFound).Code)) + require.Equal(t, errno.ErrTableStateCantNone, int(terror.ToSQLError(ErrTableStateCantNone).Code)) + require.Equal(t, errno.ErrColumnStateCantNone, int(terror.ToSQLError(ErrColumnStateCantNone).Code)) + require.Equal(t, errno.ErrColumnStateNonPublic, int(terror.ToSQLError(ErrColumnStateNonPublic).Code)) + require.Equal(t, errno.ErrIndexStateCantNone, int(terror.ToSQLError(ErrIndexStateCantNone).Code)) + require.Equal(t, errno.ErrInvalidRecordKey, int(terror.ToSQLError(ErrInvalidRecordKey).Code)) + require.Equal(t, errno.ErrTruncatedWrongValueForField, int(terror.ToSQLError(ErrTruncatedWrongValueForField).Code)) + require.Equal(t, errno.ErrUnknownPartition, int(terror.ToSQLError(ErrUnknownPartition).Code)) + require.Equal(t, errno.ErrNoPartitionForGivenValue, int(terror.ToSQLError(ErrNoPartitionForGivenValue).Code)) + require.Equal(t, errno.ErrLockOrActiveTransaction, int(terror.ToSQLError(ErrLockOrActiveTransaction).Code)) } func TestOptions(t *testing.T) { diff --git a/pkg/tablecodec/tablecodec_test.go b/pkg/tablecodec/tablecodec_test.go index 1612a843900f9..221f3e76f79e2 100644 --- a/pkg/tablecodec/tablecodec_test.go +++ b/pkg/tablecodec/tablecodec_test.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/kvproto/pkg/keyspacepb" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" @@ -584,7 +585,7 @@ func TestError(t *testing.T) { } for _, err := range kvErrs { code := terror.ToSQLError(err).Code - require.NotEqual(t, code, mysql.ErrUnknown) + require.NotEqual(t, code, errno.ErrUnknown) require.Equal(t, code, uint16(err.Code())) } } diff --git a/pkg/types/errors.go b/pkg/types/errors.go index 2302932994f1f..ae6b22dc9bef8 100644 --- a/pkg/types/errors.go +++ b/pkg/types/errors.go @@ -15,7 +15,7 @@ package types import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" parser_types "github.com/pingcap/tidb/pkg/parser/types" "github.com/pingcap/tidb/pkg/util/dbterror" ) @@ -32,70 +32,70 @@ var ( // ErrInvalidDefault is returned when meet a invalid default value. ErrInvalidDefault = parser_types.ErrInvalidDefault // ErrDataTooLong is returned when converts a string value that is longer than field type length. - ErrDataTooLong = dbterror.ClassTypes.NewStd(mysql.ErrDataTooLong) + ErrDataTooLong = dbterror.ClassTypes.NewStd(errno.ErrDataTooLong) // ErrIllegalValueForType is returned when value of type is illegal. - ErrIllegalValueForType = dbterror.ClassTypes.NewStd(mysql.ErrIllegalValueForType) + ErrIllegalValueForType = dbterror.ClassTypes.NewStd(errno.ErrIllegalValueForType) // ErrTruncated is returned when data has been truncated during conversion. - ErrTruncated = dbterror.ClassTypes.NewStd(mysql.WarnDataTruncated) + ErrTruncated = dbterror.ClassTypes.NewStd(errno.WarnDataTruncated) // ErrOverflow is returned when data is out of range for a field type. - ErrOverflow = dbterror.ClassTypes.NewStd(mysql.ErrDataOutOfRange) + ErrOverflow = dbterror.ClassTypes.NewStd(errno.ErrDataOutOfRange) // ErrDivByZero is return when do division by 0. - ErrDivByZero = dbterror.ClassTypes.NewStd(mysql.ErrDivisionByZero) + ErrDivByZero = dbterror.ClassTypes.NewStd(errno.ErrDivisionByZero) // ErrTooBigDisplayWidth is return when display width out of range for column. - ErrTooBigDisplayWidth = dbterror.ClassTypes.NewStd(mysql.ErrTooBigDisplaywidth) + ErrTooBigDisplayWidth = dbterror.ClassTypes.NewStd(errno.ErrTooBigDisplaywidth) // ErrTooBigFieldLength is return when column length too big for column. - ErrTooBigFieldLength = dbterror.ClassTypes.NewStd(mysql.ErrTooBigFieldlength) + ErrTooBigFieldLength = dbterror.ClassTypes.NewStd(errno.ErrTooBigFieldlength) // ErrTooBigSet is returned when too many strings for column. - ErrTooBigSet = dbterror.ClassTypes.NewStd(mysql.ErrTooBigSet) + ErrTooBigSet = dbterror.ClassTypes.NewStd(errno.ErrTooBigSet) // ErrTooBigScale is returned when type DECIMAL/NUMERIC scale is bigger than mysql.MaxDecimalScale. - ErrTooBigScale = dbterror.ClassTypes.NewStd(mysql.ErrTooBigScale) + ErrTooBigScale = dbterror.ClassTypes.NewStd(errno.ErrTooBigScale) // ErrTooBigPrecision is returned when type DECIMAL/NUMERIC or DATETIME precision is bigger than mysql.MaxDecimalWidth or types.MaxFsp - ErrTooBigPrecision = dbterror.ClassTypes.NewStd(mysql.ErrTooBigPrecision) + ErrTooBigPrecision = dbterror.ClassTypes.NewStd(errno.ErrTooBigPrecision) // ErrBadNumber is return when parsing an invalid binary decimal number. - ErrBadNumber = dbterror.ClassTypes.NewStd(mysql.ErrBadNumber) + ErrBadNumber = dbterror.ClassTypes.NewStd(errno.ErrBadNumber) // ErrInvalidFieldSize is returned when the precision of a column is out of range. - ErrInvalidFieldSize = dbterror.ClassTypes.NewStd(mysql.ErrInvalidFieldSize) + ErrInvalidFieldSize = dbterror.ClassTypes.NewStd(errno.ErrInvalidFieldSize) // ErrMBiggerThanD is returned when precision less than the scale. - ErrMBiggerThanD = dbterror.ClassTypes.NewStd(mysql.ErrMBiggerThanD) + ErrMBiggerThanD = dbterror.ClassTypes.NewStd(errno.ErrMBiggerThanD) // ErrWarnDataOutOfRange is returned when the value in a numeric column that is outside the permissible range of the column data type. // See https://dev.mysql.com/doc/refman/5.5/en/out-of-range-and-overflow.html for details - ErrWarnDataOutOfRange = dbterror.ClassTypes.NewStd(mysql.ErrWarnDataOutOfRange) + ErrWarnDataOutOfRange = dbterror.ClassTypes.NewStd(errno.ErrWarnDataOutOfRange) // ErrDuplicatedValueInType is returned when enum column has duplicated value. - ErrDuplicatedValueInType = dbterror.ClassTypes.NewStd(mysql.ErrDuplicatedValueInType) + ErrDuplicatedValueInType = dbterror.ClassTypes.NewStd(errno.ErrDuplicatedValueInType) // ErrDatetimeFunctionOverflow is returned when the calculation in datetime function cause overflow. - ErrDatetimeFunctionOverflow = dbterror.ClassTypes.NewStd(mysql.ErrDatetimeFunctionOverflow) + ErrDatetimeFunctionOverflow = dbterror.ClassTypes.NewStd(errno.ErrDatetimeFunctionOverflow) // ErrCastAsSignedOverflow is returned when positive out-of-range integer, and convert to its negative complement. - ErrCastAsSignedOverflow = dbterror.ClassTypes.NewStd(mysql.ErrCastAsSignedOverflow) + ErrCastAsSignedOverflow = dbterror.ClassTypes.NewStd(errno.ErrCastAsSignedOverflow) // ErrCastNegIntAsUnsigned is returned when a negative integer be casted to an unsigned int. - ErrCastNegIntAsUnsigned = dbterror.ClassTypes.NewStd(mysql.ErrCastNegIntAsUnsigned) + ErrCastNegIntAsUnsigned = dbterror.ClassTypes.NewStd(errno.ErrCastNegIntAsUnsigned) // ErrInvalidYearFormat is returned when the input is not a valid year format. - ErrInvalidYearFormat = dbterror.ClassTypes.NewStd(mysql.ErrInvalidYearFormat) + ErrInvalidYearFormat = dbterror.ClassTypes.NewStd(errno.ErrInvalidYearFormat) // ErrInvalidYear is returned when the input value is not a valid year. - ErrInvalidYear = dbterror.ClassTypes.NewStd(mysql.ErrInvalidYear) + ErrInvalidYear = dbterror.ClassTypes.NewStd(errno.ErrInvalidYear) // ErrTruncatedWrongVal is returned when data has been truncated during conversion. - ErrTruncatedWrongVal = dbterror.ClassTypes.NewStd(mysql.ErrTruncatedWrongValue) + ErrTruncatedWrongVal = dbterror.ClassTypes.NewStd(errno.ErrTruncatedWrongValue) // ErrInvalidWeekModeFormat is returned when the week mode is wrong. - ErrInvalidWeekModeFormat = dbterror.ClassTypes.NewStd(mysql.ErrInvalidWeekModeFormat) + ErrInvalidWeekModeFormat = dbterror.ClassTypes.NewStd(errno.ErrInvalidWeekModeFormat) // ErrWrongFieldSpec is returned when the column specifier incorrect. - ErrWrongFieldSpec = dbterror.ClassTypes.NewStd(mysql.ErrWrongFieldSpec) + ErrWrongFieldSpec = dbterror.ClassTypes.NewStd(errno.ErrWrongFieldSpec) // ErrSyntax is returned when the syntax is not allowed. - ErrSyntax = dbterror.ClassTypes.NewStdErr(mysql.ErrParse, mysql.MySQLErrName[mysql.ErrSyntax]) + ErrSyntax = dbterror.ClassTypes.NewStdErr(errno.ErrParse, errno.MySQLErrName[errno.ErrSyntax]) // ErrWrongValue is returned when the input value is in wrong format. - ErrWrongValue = dbterror.ClassTypes.NewStdErr(mysql.ErrTruncatedWrongValue, mysql.MySQLErrName[mysql.ErrWrongValue]) + ErrWrongValue = dbterror.ClassTypes.NewStdErr(errno.ErrTruncatedWrongValue, errno.MySQLErrName[errno.ErrWrongValue]) // ErrWrongValue2 is returned when the input value is in wrong format. - ErrWrongValue2 = dbterror.ClassTypes.NewStdErr(mysql.ErrWrongValue, mysql.MySQLErrName[mysql.ErrWrongValue]) + ErrWrongValue2 = dbterror.ClassTypes.NewStdErr(errno.ErrWrongValue, errno.MySQLErrName[errno.ErrWrongValue]) // ErrWrongValueForType is returned when the input value is in wrong format for function. - ErrWrongValueForType = dbterror.ClassTypes.NewStdErr(mysql.ErrWrongValueForType, mysql.MySQLErrName[mysql.ErrWrongValueForType]) + ErrWrongValueForType = dbterror.ClassTypes.NewStdErr(errno.ErrWrongValueForType, errno.MySQLErrName[errno.ErrWrongValueForType]) // ErrPartitionStatsMissing is returned when the partition-level stats is missing and the build global-level stats fails. // Put this error here is to prevent `import cycle not allowed`. - ErrPartitionStatsMissing = dbterror.ClassTypes.NewStd(mysql.ErrPartitionStatsMissing) + ErrPartitionStatsMissing = dbterror.ClassTypes.NewStd(errno.ErrPartitionStatsMissing) // ErrPartitionColumnStatsMissing is returned when the partition-level column stats is missing and the build global-level stats fails. // Put this error here is to prevent `import cycle not allowed`. - ErrPartitionColumnStatsMissing = dbterror.ClassTypes.NewStd(mysql.ErrPartitionColumnStatsMissing) + ErrPartitionColumnStatsMissing = dbterror.ClassTypes.NewStd(errno.ErrPartitionColumnStatsMissing) // ErrIncorrectDatetimeValue is returned when the input value is in wrong format for datetime. - ErrIncorrectDatetimeValue = dbterror.ClassTypes.NewStd(mysql.ErrIncorrectDatetimeValue) + ErrIncorrectDatetimeValue = dbterror.ClassTypes.NewStd(errno.ErrIncorrectDatetimeValue) // ErrJSONBadOneOrAllArg is returned when the one_or_all argument isn't 'one' or 'all'. - ErrJSONBadOneOrAllArg = dbterror.ClassTypes.NewStd(mysql.ErrJSONBadOneOrAllArg) + ErrJSONBadOneOrAllArg = dbterror.ClassTypes.NewStd(errno.ErrJSONBadOneOrAllArg) // ErrJSONVacuousPath is returned for path expressions that are not allowed in that context. - ErrJSONVacuousPath = dbterror.ClassTypes.NewStd(mysql.ErrJSONVacuousPath) + ErrJSONVacuousPath = dbterror.ClassTypes.NewStd(errno.ErrJSONVacuousPath) ) diff --git a/pkg/types/json_constants.go b/pkg/types/json_constants.go index 9fb2a2e98ebbc..56eb083ed9f71 100644 --- a/pkg/types/json_constants.go +++ b/pkg/types/json_constants.go @@ -18,7 +18,7 @@ import ( "encoding/binary" "unicode/utf8" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) @@ -219,31 +219,31 @@ const ( var ( // ErrInvalidJSONText means invalid JSON text. - ErrInvalidJSONText = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONText) + ErrInvalidJSONText = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONText) // ErrInvalidJSONType means invalid JSON type. - ErrInvalidJSONType = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONType) + ErrInvalidJSONType = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONType) // ErrInvalidJSONTextInParam means invalid JSON text in arguments. - ErrInvalidJSONTextInParam = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONTextInParam) + ErrInvalidJSONTextInParam = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONTextInParam) // ErrInvalidJSONPath means invalid JSON path. - ErrInvalidJSONPath = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONPath) + ErrInvalidJSONPath = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONPath) // ErrInvalidJSONCharset means invalid JSON charset. - ErrInvalidJSONCharset = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONCharset) + ErrInvalidJSONCharset = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONCharset) // ErrInvalidJSONData means invalid JSON data. - ErrInvalidJSONData = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONData) + ErrInvalidJSONData = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONData) // ErrInvalidJSONPathMultipleSelection means invalid JSON path that contain wildcard characters or range selection. - ErrInvalidJSONPathMultipleSelection = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONPathMultipleSelection) + ErrInvalidJSONPathMultipleSelection = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONPathMultipleSelection) // ErrInvalidJSONContainsPathType means invalid JSON contains path type. - ErrInvalidJSONContainsPathType = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONContainsPathType) + ErrInvalidJSONContainsPathType = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONContainsPathType) // ErrJSONDocumentNULLKey means that json's key is null - ErrJSONDocumentNULLKey = dbterror.ClassJSON.NewStd(mysql.ErrJSONDocumentNULLKey) + ErrJSONDocumentNULLKey = dbterror.ClassJSON.NewStd(errno.ErrJSONDocumentNULLKey) // ErrJSONDocumentTooDeep means that json's depth is too deep. - ErrJSONDocumentTooDeep = dbterror.ClassJSON.NewStd(mysql.ErrJSONDocumentTooDeep) + ErrJSONDocumentTooDeep = dbterror.ClassJSON.NewStd(errno.ErrJSONDocumentTooDeep) // ErrJSONObjectKeyTooLong means JSON object with key length >= 65536 which is not yet supported. - ErrJSONObjectKeyTooLong = dbterror.ClassTypes.NewStdErr(mysql.ErrJSONObjectKeyTooLong, mysql.MySQLErrName[mysql.ErrJSONObjectKeyTooLong]) + ErrJSONObjectKeyTooLong = dbterror.ClassTypes.NewStdErr(errno.ErrJSONObjectKeyTooLong, errno.MySQLErrName[errno.ErrJSONObjectKeyTooLong]) // ErrInvalidJSONPathArrayCell means invalid JSON path for an array cell. - ErrInvalidJSONPathArrayCell = dbterror.ClassJSON.NewStd(mysql.ErrInvalidJSONPathArrayCell) + ErrInvalidJSONPathArrayCell = dbterror.ClassJSON.NewStd(errno.ErrInvalidJSONPathArrayCell) // ErrUnsupportedSecondArgumentType means unsupported second argument type in json_objectagg - ErrUnsupportedSecondArgumentType = dbterror.ClassJSON.NewStd(mysql.ErrUnsupportedSecondArgumentType) + ErrUnsupportedSecondArgumentType = dbterror.ClassJSON.NewStd(errno.ErrUnsupportedSecondArgumentType) ) // json_contains_path function type choices diff --git a/pkg/util/collate/BUILD.bazel b/pkg/util/collate/BUILD.bazel index 567ddd458cdbf..749010d7d943e 100644 --- a/pkg/util/collate/BUILD.bazel +++ b/pkg/util/collate/BUILD.bazel @@ -19,6 +19,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/util/collate", visibility = ["//visibility:public"], deps = [ + "//pkg/errno", "//pkg/parser/charset", "//pkg/parser/mysql", "//pkg/parser/terror", diff --git a/pkg/util/collate/collate.go b/pkg/util/collate/collate.go index fa80f0591cddc..6a2f50c13e3dd 100644 --- a/pkg/util/collate/collate.go +++ b/pkg/util/collate/collate.go @@ -21,6 +21,7 @@ import ( "sync/atomic" "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/charset" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" @@ -39,13 +40,13 @@ var ( binCollatorInstanceSliceWithLen1 = []Collator{binCollatorInstance} // ErrUnsupportedCollation is returned when an unsupported collation is specified. - ErrUnsupportedCollation = dbterror.ClassDDL.NewStdErr(mysql.ErrUnknownCollation, mysql.Message("Unsupported collation when new collation is enabled: '%-.64s'", nil)) + ErrUnsupportedCollation = dbterror.ClassDDL.NewStdErr(errno.ErrUnknownCollation, errno.Message("Unsupported collation when new collation is enabled: '%-.64s'", nil)) // ErrIllegalMixCollation is returned when illegal mix of collations. - ErrIllegalMixCollation = dbterror.ClassExpression.NewStd(mysql.ErrCantAggregateNcollations) + ErrIllegalMixCollation = dbterror.ClassExpression.NewStd(errno.ErrCantAggregateNcollations) // ErrIllegalMix2Collation is returned when illegal mix of 2 collations. - ErrIllegalMix2Collation = dbterror.ClassExpression.NewStd(mysql.ErrCantAggregate2collations) + ErrIllegalMix2Collation = dbterror.ClassExpression.NewStd(errno.ErrCantAggregate2collations) // ErrIllegalMix3Collation is returned when illegal mix of 3 collations. - ErrIllegalMix3Collation = dbterror.ClassExpression.NewStd(mysql.ErrCantAggregate3collations) + ErrIllegalMix3Collation = dbterror.ClassExpression.NewStd(errno.ErrCantAggregate3collations) ) const ( diff --git a/pkg/util/dbterror/BUILD.bazel b/pkg/util/dbterror/BUILD.bazel index 188fe9af542e3..4b2634e686bb6 100644 --- a/pkg/util/dbterror/BUILD.bazel +++ b/pkg/util/dbterror/BUILD.bazel @@ -10,7 +10,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/errno", - "//pkg/parser/mysql", "//pkg/parser/terror", ], ) diff --git a/pkg/util/dbterror/ddl_terror.go b/pkg/util/dbterror/ddl_terror.go index 62cac767d37c8..1ca4d4b140482 100644 --- a/pkg/util/dbterror/ddl_terror.go +++ b/pkg/util/dbterror/ddl_terror.go @@ -17,513 +17,512 @@ package dbterror import ( "fmt" - mysql "github.com/pingcap/tidb/pkg/errno" - parser_mysql "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" ) var ( // ErrInvalidWorker means the worker is invalid. - ErrInvalidWorker = ClassDDL.NewStd(mysql.ErrInvalidDDLWorker) + ErrInvalidWorker = ClassDDL.NewStd(errno.ErrInvalidDDLWorker) // ErrNotOwner means we are not owner and can't handle DDL jobs. - ErrNotOwner = ClassDDL.NewStd(mysql.ErrNotOwner) + ErrNotOwner = ClassDDL.NewStd(errno.ErrNotOwner) // ErrCantDecodeRecord means we can't decode the record. - ErrCantDecodeRecord = ClassDDL.NewStd(mysql.ErrCantDecodeRecord) + ErrCantDecodeRecord = ClassDDL.NewStd(errno.ErrCantDecodeRecord) // ErrInvalidDDLJob means the DDL job is invalid. - ErrInvalidDDLJob = ClassDDL.NewStd(mysql.ErrInvalidDDLJob) + ErrInvalidDDLJob = ClassDDL.NewStd(errno.ErrInvalidDDLJob) // ErrCancelledDDLJob means the DDL job is cancelled. - ErrCancelledDDLJob = ClassDDL.NewStd(mysql.ErrCancelledDDLJob) + ErrCancelledDDLJob = ClassDDL.NewStd(errno.ErrCancelledDDLJob) // ErrPausedDDLJob returns when the DDL job cannot be paused. - ErrPausedDDLJob = ClassDDL.NewStd(mysql.ErrPausedDDLJob) + ErrPausedDDLJob = ClassDDL.NewStd(errno.ErrPausedDDLJob) // ErrBDRRestrictedDDL means the DDL is restricted in BDR mode. - ErrBDRRestrictedDDL = ClassDDL.NewStd(mysql.ErrBDRRestrictedDDL) + ErrBDRRestrictedDDL = ClassDDL.NewStd(errno.ErrBDRRestrictedDDL) // ErrRunMultiSchemaChanges means we run multi schema changes. - ErrRunMultiSchemaChanges = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "multi schema change for %s"), nil)) + ErrRunMultiSchemaChanges = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "multi schema change for %s"), nil)) // ErrOperateSameColumn means we change the same columns multiple times in a DDL. - ErrOperateSameColumn = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "operate same column '%s'"), nil)) + ErrOperateSameColumn = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "operate same column '%s'"), nil)) // ErrOperateSameIndex means we change the same indexes multiple times in a DDL. - ErrOperateSameIndex = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "operate same index '%s'"), nil)) + ErrOperateSameIndex = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "operate same index '%s'"), nil)) // ErrWaitReorgTimeout means we wait for reorganization timeout. - ErrWaitReorgTimeout = ClassDDL.NewStdErr(mysql.ErrLockWaitTimeout, mysql.MySQLErrName[mysql.ErrWaitReorgTimeout]) + ErrWaitReorgTimeout = ClassDDL.NewStdErr(errno.ErrLockWaitTimeout, errno.MySQLErrName[errno.ErrWaitReorgTimeout]) // ErrInvalidStoreVer means invalid store version. - ErrInvalidStoreVer = ClassDDL.NewStd(mysql.ErrInvalidStoreVersion) + ErrInvalidStoreVer = ClassDDL.NewStd(errno.ErrInvalidStoreVersion) // ErrRepairTableFail is used to repair tableInfo in repair mode. - ErrRepairTableFail = ClassDDL.NewStd(mysql.ErrRepairTable) + ErrRepairTableFail = ClassDDL.NewStd(errno.ErrRepairTable) // ErrUnsupportedAddVectorIndex means add vector index is unsupported - ErrUnsupportedAddVectorIndex = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "add vector index: %s"), nil)) + ErrUnsupportedAddVectorIndex = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "add vector index: %s"), nil)) // ErrCantDropColWithIndex means can't drop the column with index. We don't support dropping column with index covered now. - ErrCantDropColWithIndex = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "drop column with index"), nil)) + ErrCantDropColWithIndex = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "drop column with index"), nil)) // ErrCantDropColWithAutoInc means can't drop column with auto_increment - ErrCantDropColWithAutoInc = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "can't remove column with auto_increment when @@tidb_allow_remove_auto_inc disabled"), nil)) + ErrCantDropColWithAutoInc = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "can't remove column with auto_increment when @@tidb_allow_remove_auto_inc disabled"), nil)) // ErrCantDropColWithCheckConstraint means can't drop column with check constraint - ErrCantDropColWithCheckConstraint = ClassDDL.NewStd(mysql.ErrDependentByCheckConstraint) + ErrCantDropColWithCheckConstraint = ClassDDL.NewStd(errno.ErrDependentByCheckConstraint) // ErrUnsupportedAddColumn means add columns is unsupported - ErrUnsupportedAddColumn = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "add column"), nil)) + ErrUnsupportedAddColumn = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "add column"), nil)) // ErrUnsupportedModifyColumn means modify columns is unsupoorted - ErrUnsupportedModifyColumn = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "modify column: %s"), nil)) + ErrUnsupportedModifyColumn = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "modify column: %s"), nil)) // ErrUnsupportedModifyCharset means modify charset is unsupoorted - ErrUnsupportedModifyCharset = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "modify %s"), nil)) + ErrUnsupportedModifyCharset = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "modify %s"), nil)) // ErrUnsupportedModifyCollation means modify collation is unsupoorted - ErrUnsupportedModifyCollation = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "modifying collation from %s to %s"), nil)) + ErrUnsupportedModifyCollation = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "modifying collation from %s to %s"), nil)) // ErrUnsupportedPKHandle is used to indicate that we can't support this PK handle. - ErrUnsupportedPKHandle = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "drop integer primary key"), nil)) + ErrUnsupportedPKHandle = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "drop integer primary key"), nil)) // ErrUnsupportedCharset means we don't support the charset. - ErrUnsupportedCharset = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "charset %s and collate %s"), nil)) + ErrUnsupportedCharset = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "charset %s and collate %s"), nil)) // ErrUnsupportedShardRowIDBits means we don't support the shard_row_id_bits. - ErrUnsupportedShardRowIDBits = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "shard_row_id_bits for table with primary key as row id"), nil)) + ErrUnsupportedShardRowIDBits = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "shard_row_id_bits for table with primary key as row id"), nil)) // ErrUnsupportedAlterTableWithValidation means we don't support the alter table with validation. - ErrUnsupportedAlterTableWithValidation = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("ALTER TABLE WITH VALIDATION is currently unsupported", nil)) + ErrUnsupportedAlterTableWithValidation = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("ALTER TABLE WITH VALIDATION is currently unsupported", nil)) // ErrUnsupportedAlterTableWithoutValidation means we don't support the alter table without validation. - ErrUnsupportedAlterTableWithoutValidation = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("ALTER TABLE WITHOUT VALIDATION is currently unsupported", nil)) + ErrUnsupportedAlterTableWithoutValidation = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("ALTER TABLE WITHOUT VALIDATION is currently unsupported", nil)) // ErrUnsupportedAlterTableOption means we don't support the alter table option. - ErrUnsupportedAlterTableOption = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("This type of ALTER TABLE is currently unsupported", nil)) + ErrUnsupportedAlterTableOption = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("This type of ALTER TABLE is currently unsupported", nil)) // ErrUnsupportedAlterCacheForSysTable means we don't support the alter cache for system table. - ErrUnsupportedAlterCacheForSysTable = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("ALTER table cache for tables in system database is currently unsupported", nil)) + ErrUnsupportedAlterCacheForSysTable = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("ALTER table cache for tables in system database is currently unsupported", nil)) // ErrBlobKeyWithoutLength is used when BLOB is used as key but without a length. - ErrBlobKeyWithoutLength = ClassDDL.NewStd(mysql.ErrBlobKeyWithoutLength) + ErrBlobKeyWithoutLength = ClassDDL.NewStd(errno.ErrBlobKeyWithoutLength) // ErrKeyPart0 is used when key parts length is 0. - ErrKeyPart0 = ClassDDL.NewStd(mysql.ErrKeyPart0) + ErrKeyPart0 = ClassDDL.NewStd(errno.ErrKeyPart0) // ErrIncorrectPrefixKey is used when the prefix length is incorrect for a string key. - ErrIncorrectPrefixKey = ClassDDL.NewStd(mysql.ErrWrongSubKey) + ErrIncorrectPrefixKey = ClassDDL.NewStd(errno.ErrWrongSubKey) // ErrTooLongKey is used when the column key is too long. - ErrTooLongKey = ClassDDL.NewStd(mysql.ErrTooLongKey) + ErrTooLongKey = ClassDDL.NewStd(errno.ErrTooLongKey) // ErrKeyColumnDoesNotExits is used when the key column doesn't exist. - ErrKeyColumnDoesNotExits = ClassDDL.NewStd(mysql.ErrKeyColumnDoesNotExits) + ErrKeyColumnDoesNotExits = ClassDDL.NewStd(errno.ErrKeyColumnDoesNotExits) // ErrInvalidDDLJobVersion is used when the DDL job version is invalid. - ErrInvalidDDLJobVersion = ClassDDL.NewStd(mysql.ErrInvalidDDLJobVersion) + ErrInvalidDDLJobVersion = ClassDDL.NewStd(errno.ErrInvalidDDLJobVersion) // ErrInvalidUseOfNull is used when the column is not null. - ErrInvalidUseOfNull = ClassDDL.NewStd(mysql.ErrInvalidUseOfNull) + ErrInvalidUseOfNull = ClassDDL.NewStd(errno.ErrInvalidUseOfNull) // ErrTooManyFields is used when too many columns are used in a select statement. - ErrTooManyFields = ClassDDL.NewStd(mysql.ErrTooManyFields) + ErrTooManyFields = ClassDDL.NewStd(errno.ErrTooManyFields) // ErrTooManyKeys is used when too many keys used. - ErrTooManyKeys = ClassDDL.NewStd(mysql.ErrTooManyKeys) + ErrTooManyKeys = ClassDDL.NewStd(errno.ErrTooManyKeys) // ErrInvalidSplitRegionRanges is used when split region ranges is invalid. - ErrInvalidSplitRegionRanges = ClassDDL.NewStd(mysql.ErrInvalidSplitRegionRanges) + ErrInvalidSplitRegionRanges = ClassDDL.NewStd(errno.ErrInvalidSplitRegionRanges) // ErrReorgPanic is used when reorg process is panic. - ErrReorgPanic = ClassDDL.NewStd(mysql.ErrReorgPanic) + ErrReorgPanic = ClassDDL.NewStd(errno.ErrReorgPanic) // ErrFkColumnCannotDrop is used when foreign key column can't be dropped. - ErrFkColumnCannotDrop = ClassDDL.NewStd(mysql.ErrFkColumnCannotDrop) + ErrFkColumnCannotDrop = ClassDDL.NewStd(errno.ErrFkColumnCannotDrop) // ErrFkColumnCannotDropChild is used when foreign key column can't be dropped. - ErrFkColumnCannotDropChild = ClassDDL.NewStd(mysql.ErrFkColumnCannotDropChild) + ErrFkColumnCannotDropChild = ClassDDL.NewStd(errno.ErrFkColumnCannotDropChild) // ErrFKIncompatibleColumns is used when foreign key column type is incompatible. - ErrFKIncompatibleColumns = ClassDDL.NewStd(mysql.ErrFKIncompatibleColumns) + ErrFKIncompatibleColumns = ClassDDL.NewStd(errno.ErrFKIncompatibleColumns) // ErrOnlyOnRangeListPartition is used when the partition type is range list. - ErrOnlyOnRangeListPartition = ClassDDL.NewStd(mysql.ErrOnlyOnRangeListPartition) + ErrOnlyOnRangeListPartition = ClassDDL.NewStd(errno.ErrOnlyOnRangeListPartition) // ErrWrongKeyColumn is for table column cannot be indexed. - ErrWrongKeyColumn = ClassDDL.NewStd(mysql.ErrWrongKeyColumn) + ErrWrongKeyColumn = ClassDDL.NewStd(errno.ErrWrongKeyColumn) // ErrWrongKeyColumnFunctionalIndex is for expression cannot be indexed. - ErrWrongKeyColumnFunctionalIndex = ClassDDL.NewStd(mysql.ErrWrongKeyColumnFunctionalIndex) + ErrWrongKeyColumnFunctionalIndex = ClassDDL.NewStd(errno.ErrWrongKeyColumnFunctionalIndex) // ErrWrongFKOptionForGeneratedColumn is for wrong foreign key reference option on generated columns. - ErrWrongFKOptionForGeneratedColumn = ClassDDL.NewStd(mysql.ErrWrongFKOptionForGeneratedColumn) + ErrWrongFKOptionForGeneratedColumn = ClassDDL.NewStd(errno.ErrWrongFKOptionForGeneratedColumn) // ErrUnsupportedOnGeneratedColumn is for unsupported actions on generated columns. - ErrUnsupportedOnGeneratedColumn = ClassDDL.NewStd(mysql.ErrUnsupportedOnGeneratedColumn) + ErrUnsupportedOnGeneratedColumn = ClassDDL.NewStd(errno.ErrUnsupportedOnGeneratedColumn) // ErrGeneratedColumnNonPrior forbids to refer generated column non prior to it. - ErrGeneratedColumnNonPrior = ClassDDL.NewStd(mysql.ErrGeneratedColumnNonPrior) + ErrGeneratedColumnNonPrior = ClassDDL.NewStd(errno.ErrGeneratedColumnNonPrior) // ErrDependentByGeneratedColumn forbids to delete columns which are dependent by generated columns. - ErrDependentByGeneratedColumn = ClassDDL.NewStd(mysql.ErrDependentByGeneratedColumn) + ErrDependentByGeneratedColumn = ClassDDL.NewStd(errno.ErrDependentByGeneratedColumn) // ErrJSONUsedAsKey forbids to use JSON as key or index. - ErrJSONUsedAsKey = ClassDDL.NewStd(mysql.ErrJSONUsedAsKey) + ErrJSONUsedAsKey = ClassDDL.NewStd(errno.ErrJSONUsedAsKey) // ErrBlobCantHaveDefault forbids to give not null default value to TEXT/BLOB/JSON. - ErrBlobCantHaveDefault = ClassDDL.NewStd(mysql.ErrBlobCantHaveDefault) + ErrBlobCantHaveDefault = ClassDDL.NewStd(errno.ErrBlobCantHaveDefault) // ErrTooLongIndexComment means the comment for index is too long. - ErrTooLongIndexComment = ClassDDL.NewStd(mysql.ErrTooLongIndexComment) + ErrTooLongIndexComment = ClassDDL.NewStd(errno.ErrTooLongIndexComment) // ErrTooLongTableComment means the comment for table is too long. - ErrTooLongTableComment = ClassDDL.NewStd(mysql.ErrTooLongTableComment) + ErrTooLongTableComment = ClassDDL.NewStd(errno.ErrTooLongTableComment) // ErrTooLongFieldComment means the comment for field/column is too long. - ErrTooLongFieldComment = ClassDDL.NewStd(mysql.ErrTooLongFieldComment) + ErrTooLongFieldComment = ClassDDL.NewStd(errno.ErrTooLongFieldComment) // ErrTooLongTablePartitionComment means the comment for table partition is too long. - ErrTooLongTablePartitionComment = ClassDDL.NewStd(mysql.ErrTooLongTablePartitionComment) + ErrTooLongTablePartitionComment = ClassDDL.NewStd(errno.ErrTooLongTablePartitionComment) // ErrInvalidDefaultValue returns for invalid default value for columns. - ErrInvalidDefaultValue = ClassDDL.NewStd(mysql.ErrInvalidDefault) + ErrInvalidDefaultValue = ClassDDL.NewStd(errno.ErrInvalidDefault) // ErrDefValGeneratedNamedFunctionIsNotAllowed returns for disallowed function as default value expression of column. - ErrDefValGeneratedNamedFunctionIsNotAllowed = ClassDDL.NewStd(mysql.ErrDefValGeneratedNamedFunctionIsNotAllowed) + ErrDefValGeneratedNamedFunctionIsNotAllowed = ClassDDL.NewStd(errno.ErrDefValGeneratedNamedFunctionIsNotAllowed) // ErrGeneratedColumnRefAutoInc forbids to refer generated columns to auto-increment columns . - ErrGeneratedColumnRefAutoInc = ClassDDL.NewStd(mysql.ErrGeneratedColumnRefAutoInc) + ErrGeneratedColumnRefAutoInc = ClassDDL.NewStd(errno.ErrGeneratedColumnRefAutoInc) // ErrExpressionIndexCanNotRefer forbids to refer expression index to auto-increment column. - ErrExpressionIndexCanNotRefer = ClassDDL.NewStd(mysql.ErrFunctionalIndexRefAutoIncrement) + ErrExpressionIndexCanNotRefer = ClassDDL.NewStd(errno.ErrFunctionalIndexRefAutoIncrement) // ErrUnsupportedAddPartition returns for does not support add partitions. - ErrUnsupportedAddPartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "add partitions"), nil)) + ErrUnsupportedAddPartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "add partitions"), nil)) // ErrUnsupportedCoalescePartition returns for does not support coalesce partitions. - ErrUnsupportedCoalescePartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "coalesce partitions"), nil)) + ErrUnsupportedCoalescePartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "coalesce partitions"), nil)) // ErrUnsupportedReorganizePartition returns for does not support reorganize partitions. - ErrUnsupportedReorganizePartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "reorganize partition"), nil)) + ErrUnsupportedReorganizePartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "reorganize partition"), nil)) // ErrUnsupportedCheckPartition returns for does not support check partitions. - ErrUnsupportedCheckPartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "check partition"), nil)) + ErrUnsupportedCheckPartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "check partition"), nil)) // ErrUnsupportedOptimizePartition returns for does not support optimize partitions. - ErrUnsupportedOptimizePartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "optimize partition"), nil)) + ErrUnsupportedOptimizePartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "optimize partition"), nil)) // ErrUnsupportedRebuildPartition returns for does not support rebuild partitions. - ErrUnsupportedRebuildPartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "rebuild partition"), nil)) + ErrUnsupportedRebuildPartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "rebuild partition"), nil)) // ErrUnsupportedRemovePartition returns for does not support remove partitions. - ErrUnsupportedRemovePartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "remove partitioning"), nil)) + ErrUnsupportedRemovePartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "remove partitioning"), nil)) // ErrUnsupportedRepairPartition returns for does not support repair partitions. - ErrUnsupportedRepairPartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "repair partition"), nil)) + ErrUnsupportedRepairPartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "repair partition"), nil)) // ErrGeneratedColumnFunctionIsNotAllowed returns for unsupported functions for generated columns. - ErrGeneratedColumnFunctionIsNotAllowed = ClassDDL.NewStd(mysql.ErrGeneratedColumnFunctionIsNotAllowed) + ErrGeneratedColumnFunctionIsNotAllowed = ClassDDL.NewStd(errno.ErrGeneratedColumnFunctionIsNotAllowed) // ErrGeneratedColumnRowValueIsNotAllowed returns for generated columns referring to row values. - ErrGeneratedColumnRowValueIsNotAllowed = ClassDDL.NewStd(mysql.ErrGeneratedColumnRowValueIsNotAllowed) + ErrGeneratedColumnRowValueIsNotAllowed = ClassDDL.NewStd(errno.ErrGeneratedColumnRowValueIsNotAllowed) // ErrUnsupportedPartitionByRangeColumns returns for does unsupported partition by range columns. - ErrUnsupportedPartitionByRangeColumns = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "partition by range columns"), nil)) + ErrUnsupportedPartitionByRangeColumns = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "partition by range columns"), nil)) // ErrFunctionalIndexFunctionIsNotAllowed returns for unsupported functions for functional index. - ErrFunctionalIndexFunctionIsNotAllowed = ClassDDL.NewStd(mysql.ErrFunctionalIndexFunctionIsNotAllowed) + ErrFunctionalIndexFunctionIsNotAllowed = ClassDDL.NewStd(errno.ErrFunctionalIndexFunctionIsNotAllowed) // ErrFunctionalIndexRowValueIsNotAllowed returns for functional index referring to row values. - ErrFunctionalIndexRowValueIsNotAllowed = ClassDDL.NewStd(mysql.ErrFunctionalIndexRowValueIsNotAllowed) + ErrFunctionalIndexRowValueIsNotAllowed = ClassDDL.NewStd(errno.ErrFunctionalIndexRowValueIsNotAllowed) // ErrUnsupportedCreatePartition returns for does not support create partitions. - ErrUnsupportedCreatePartition = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "partition type, treat as normal table"), nil)) + ErrUnsupportedCreatePartition = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "partition type, treat as normal table"), nil)) // ErrUnsupportedIndexType returns for unsupported index type. - ErrUnsupportedIndexType = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "index type"), nil)) + ErrUnsupportedIndexType = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "index type"), nil)) // ErrWindowInvalidWindowFuncUse returns for invalid window function use. - ErrWindowInvalidWindowFuncUse = ClassDDL.NewStd(mysql.ErrWindowInvalidWindowFuncUse) + ErrWindowInvalidWindowFuncUse = ClassDDL.NewStd(errno.ErrWindowInvalidWindowFuncUse) // ErrDupKeyName returns for duplicated key name. - ErrDupKeyName = ClassDDL.NewStd(mysql.ErrDupKeyName) + ErrDupKeyName = ClassDDL.NewStd(errno.ErrDupKeyName) // ErrFkDupName returns for duplicated FK name. - ErrFkDupName = ClassDDL.NewStd(mysql.ErrFkDupName) + ErrFkDupName = ClassDDL.NewStd(errno.ErrFkDupName) // ErrInvalidDDLState returns for invalid ddl model object state. - ErrInvalidDDLState = ClassDDL.NewStdErr(mysql.ErrInvalidDDLState, parser_mysql.Message(mysql.MySQLErrName[mysql.ErrInvalidDDLState].Raw, nil)) + ErrInvalidDDLState = ClassDDL.NewStdErr(errno.ErrInvalidDDLState, errno.Message(errno.MySQLErrName[errno.ErrInvalidDDLState].Raw, nil)) // ErrUnsupportedModifyPrimaryKey returns an error when add or drop the primary key. // It's exported for testing. - ErrUnsupportedModifyPrimaryKey = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "%s primary key"), nil)) + ErrUnsupportedModifyPrimaryKey = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "%s primary key"), nil)) // ErrPKIndexCantBeInvisible return an error when primary key is invisible index - ErrPKIndexCantBeInvisible = ClassDDL.NewStd(mysql.ErrPKIndexCantBeInvisible) + ErrPKIndexCantBeInvisible = ClassDDL.NewStd(errno.ErrPKIndexCantBeInvisible) // ErrColumnBadNull returns for a bad null value. - ErrColumnBadNull = ClassDDL.NewStd(mysql.ErrBadNull) + ErrColumnBadNull = ClassDDL.NewStd(errno.ErrBadNull) // ErrBadField forbids to refer to unknown column. - ErrBadField = ClassDDL.NewStd(mysql.ErrBadField) + ErrBadField = ClassDDL.NewStd(errno.ErrBadField) // ErrCantRemoveAllFields returns for deleting all columns. - ErrCantRemoveAllFields = ClassDDL.NewStd(mysql.ErrCantRemoveAllFields) + ErrCantRemoveAllFields = ClassDDL.NewStd(errno.ErrCantRemoveAllFields) // ErrCantDropFieldOrKey returns for dropping a non-existent field or key. - ErrCantDropFieldOrKey = ClassDDL.NewStd(mysql.ErrCantDropFieldOrKey) + ErrCantDropFieldOrKey = ClassDDL.NewStd(errno.ErrCantDropFieldOrKey) // ErrInvalidOnUpdate returns for invalid ON UPDATE clause. - ErrInvalidOnUpdate = ClassDDL.NewStd(mysql.ErrInvalidOnUpdate) + ErrInvalidOnUpdate = ClassDDL.NewStd(errno.ErrInvalidOnUpdate) // ErrTooLongIdent returns for too long name of database/table/column/index. - ErrTooLongIdent = ClassDDL.NewStd(mysql.ErrTooLongIdent) + ErrTooLongIdent = ClassDDL.NewStd(errno.ErrTooLongIdent) // ErrWrongDBName returns for wrong database name. - ErrWrongDBName = ClassDDL.NewStd(mysql.ErrWrongDBName) + ErrWrongDBName = ClassDDL.NewStd(errno.ErrWrongDBName) // ErrWrongTableName returns for wrong table name. - ErrWrongTableName = ClassDDL.NewStd(mysql.ErrWrongTableName) + ErrWrongTableName = ClassDDL.NewStd(errno.ErrWrongTableName) // ErrWrongColumnName returns for wrong column name. - ErrWrongColumnName = ClassDDL.NewStd(mysql.ErrWrongColumnName) + ErrWrongColumnName = ClassDDL.NewStd(errno.ErrWrongColumnName) // ErrWrongPartitionName returns for wrong partition name. - ErrWrongPartitionName = ClassDDL.NewStd(mysql.ErrWrongPartitionName) + ErrWrongPartitionName = ClassDDL.NewStd(errno.ErrWrongPartitionName) // ErrWrongUsage returns for wrong ddl syntax usage. - ErrWrongUsage = ClassDDL.NewStd(mysql.ErrWrongUsage) + ErrWrongUsage = ClassDDL.NewStd(errno.ErrWrongUsage) // ErrInvalidGroupFuncUse returns for using invalid group functions. - ErrInvalidGroupFuncUse = ClassDDL.NewStd(mysql.ErrInvalidGroupFuncUse) + ErrInvalidGroupFuncUse = ClassDDL.NewStd(errno.ErrInvalidGroupFuncUse) // ErrTableMustHaveColumns returns for missing column when creating a table. - ErrTableMustHaveColumns = ClassDDL.NewStd(mysql.ErrTableMustHaveColumns) + ErrTableMustHaveColumns = ClassDDL.NewStd(errno.ErrTableMustHaveColumns) // ErrWrongNameForIndex returns for wrong index name. - ErrWrongNameForIndex = ClassDDL.NewStd(mysql.ErrWrongNameForIndex) + ErrWrongNameForIndex = ClassDDL.NewStd(errno.ErrWrongNameForIndex) // ErrUnknownCharacterSet returns unknown character set. - ErrUnknownCharacterSet = ClassDDL.NewStd(mysql.ErrUnknownCharacterSet) + ErrUnknownCharacterSet = ClassDDL.NewStd(errno.ErrUnknownCharacterSet) // ErrUnknownCollation returns unknown collation. - ErrUnknownCollation = ClassDDL.NewStd(mysql.ErrUnknownCollation) + ErrUnknownCollation = ClassDDL.NewStd(errno.ErrUnknownCollation) // ErrCollationCharsetMismatch returns when collation not match the charset. - ErrCollationCharsetMismatch = ClassDDL.NewStd(mysql.ErrCollationCharsetMismatch) + ErrCollationCharsetMismatch = ClassDDL.NewStd(errno.ErrCollationCharsetMismatch) // ErrConflictingDeclarations return conflict declarations. - ErrConflictingDeclarations = ClassDDL.NewStdErr(mysql.ErrConflictingDeclarations, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrConflictingDeclarations].Raw, "CHARACTER SET ", "%s", "CHARACTER SET ", "%s"), nil)) + ErrConflictingDeclarations = ClassDDL.NewStdErr(errno.ErrConflictingDeclarations, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrConflictingDeclarations].Raw, "CHARACTER SET ", "%s", "CHARACTER SET ", "%s"), nil)) // ErrPrimaryCantHaveNull returns All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead - ErrPrimaryCantHaveNull = ClassDDL.NewStd(mysql.ErrPrimaryCantHaveNull) + ErrPrimaryCantHaveNull = ClassDDL.NewStd(errno.ErrPrimaryCantHaveNull) // ErrErrorOnRename returns error for wrong database name in alter table rename - ErrErrorOnRename = ClassDDL.NewStd(mysql.ErrErrorOnRename) + ErrErrorOnRename = ClassDDL.NewStd(errno.ErrErrorOnRename) // ErrViewSelectClause returns error for create view with select into clause - ErrViewSelectClause = ClassDDL.NewStd(mysql.ErrViewSelectClause) + ErrViewSelectClause = ClassDDL.NewStd(errno.ErrViewSelectClause) // ErrViewSelectVariable returns error for create view with select into clause - ErrViewSelectVariable = ClassDDL.NewStd(mysql.ErrViewSelectVariable) + ErrViewSelectVariable = ClassDDL.NewStd(errno.ErrViewSelectVariable) // ErrNotAllowedTypeInPartition returns not allowed type error when creating table partition with unsupported expression type. - ErrNotAllowedTypeInPartition = ClassDDL.NewStd(mysql.ErrFieldTypeNotAllowedAsPartitionField) + ErrNotAllowedTypeInPartition = ClassDDL.NewStd(errno.ErrFieldTypeNotAllowedAsPartitionField) // ErrPartitionMgmtOnNonpartitioned returns it's not a partition table. - ErrPartitionMgmtOnNonpartitioned = ClassDDL.NewStd(mysql.ErrPartitionMgmtOnNonpartitioned) + ErrPartitionMgmtOnNonpartitioned = ClassDDL.NewStd(errno.ErrPartitionMgmtOnNonpartitioned) // ErrDropPartitionNonExistent returns error in list of partition. - ErrDropPartitionNonExistent = ClassDDL.NewStd(mysql.ErrDropPartitionNonExistent) + ErrDropPartitionNonExistent = ClassDDL.NewStd(errno.ErrDropPartitionNonExistent) // ErrSameNamePartition returns duplicate partition name. - ErrSameNamePartition = ClassDDL.NewStd(mysql.ErrSameNamePartition) + ErrSameNamePartition = ClassDDL.NewStd(errno.ErrSameNamePartition) // ErrSameNamePartitionField returns duplicate partition field. - ErrSameNamePartitionField = ClassDDL.NewStd(mysql.ErrSameNamePartitionField) + ErrSameNamePartitionField = ClassDDL.NewStd(errno.ErrSameNamePartitionField) // ErrRangeNotIncreasing returns values less than value must be strictly increasing for each partition. - ErrRangeNotIncreasing = ClassDDL.NewStd(mysql.ErrRangeNotIncreasing) + ErrRangeNotIncreasing = ClassDDL.NewStd(errno.ErrRangeNotIncreasing) // ErrPartitionMaxvalue returns maxvalue can only be used in last partition definition. - ErrPartitionMaxvalue = ClassDDL.NewStd(mysql.ErrPartitionMaxvalue) + ErrPartitionMaxvalue = ClassDDL.NewStd(errno.ErrPartitionMaxvalue) // ErrMaxvalueInValuesIn returns maxvalue cannot be used in values in. - ErrMaxvalueInValuesIn = ClassDDL.NewStd(mysql.ErrMaxvalueInValuesIn) + ErrMaxvalueInValuesIn = ClassDDL.NewStd(errno.ErrMaxvalueInValuesIn) // ErrDropLastPartition returns cannot remove all partitions, use drop table instead. - ErrDropLastPartition = ClassDDL.NewStd(mysql.ErrDropLastPartition) + ErrDropLastPartition = ClassDDL.NewStd(errno.ErrDropLastPartition) // ErrTooManyPartitions returns too many partitions were defined. - ErrTooManyPartitions = ClassDDL.NewStd(mysql.ErrTooManyPartitions) + ErrTooManyPartitions = ClassDDL.NewStd(errno.ErrTooManyPartitions) // ErrPartitionConstDomain returns partition constant is out of partition function domain. - ErrPartitionConstDomain = ClassDDL.NewStd(mysql.ErrPartitionConstDomain) + ErrPartitionConstDomain = ClassDDL.NewStd(errno.ErrPartitionConstDomain) // ErrPartitionFunctionIsNotAllowed returns this partition function is not allowed. - ErrPartitionFunctionIsNotAllowed = ClassDDL.NewStd(mysql.ErrPartitionFunctionIsNotAllowed) + ErrPartitionFunctionIsNotAllowed = ClassDDL.NewStd(errno.ErrPartitionFunctionIsNotAllowed) // ErrPartitionFuncNotAllowed returns partition function returns the wrong type. - ErrPartitionFuncNotAllowed = ClassDDL.NewStd(mysql.ErrPartitionFuncNotAllowed) + ErrPartitionFuncNotAllowed = ClassDDL.NewStd(errno.ErrPartitionFuncNotAllowed) // ErrUniqueKeyNeedAllFieldsInPf returns must include all columns in the table's partitioning function. - ErrUniqueKeyNeedAllFieldsInPf = ClassDDL.NewStd(mysql.ErrUniqueKeyNeedAllFieldsInPf) + ErrUniqueKeyNeedAllFieldsInPf = ClassDDL.NewStd(errno.ErrUniqueKeyNeedAllFieldsInPf) // ErrWrongExprInPartitionFunc Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed. - ErrWrongExprInPartitionFunc = ClassDDL.NewStd(mysql.ErrWrongExprInPartitionFunc) + ErrWrongExprInPartitionFunc = ClassDDL.NewStd(errno.ErrWrongExprInPartitionFunc) // ErrWarnDataTruncated returns data truncated error. - ErrWarnDataTruncated = ClassDDL.NewStd(mysql.WarnDataTruncated) + ErrWarnDataTruncated = ClassDDL.NewStd(errno.WarnDataTruncated) // ErrCoalesceOnlyOnHashPartition returns coalesce partition can only be used on hash/key partitions. - ErrCoalesceOnlyOnHashPartition = ClassDDL.NewStd(mysql.ErrCoalesceOnlyOnHashPartition) + ErrCoalesceOnlyOnHashPartition = ClassDDL.NewStd(errno.ErrCoalesceOnlyOnHashPartition) // ErrViewWrongList returns create view must include all columns in the select clause - ErrViewWrongList = ClassDDL.NewStd(mysql.ErrViewWrongList) + ErrViewWrongList = ClassDDL.NewStd(errno.ErrViewWrongList) // ErrAlterOperationNotSupported returns when alter operations is not supported. - ErrAlterOperationNotSupported = ClassDDL.NewStd(mysql.ErrAlterOperationNotSupportedReason) + ErrAlterOperationNotSupported = ClassDDL.NewStd(errno.ErrAlterOperationNotSupportedReason) // ErrWrongObject returns for wrong object. - ErrWrongObject = ClassDDL.NewStd(mysql.ErrWrongObject) + ErrWrongObject = ClassDDL.NewStd(errno.ErrWrongObject) // ErrTableCantHandleFt returns FULLTEXT keys are not supported by table type - ErrTableCantHandleFt = ClassDDL.NewStd(mysql.ErrTableCantHandleFt) + ErrTableCantHandleFt = ClassDDL.NewStd(errno.ErrTableCantHandleFt) // ErrFieldNotFoundPart returns an error when 'partition by columns' are not found in table columns. - ErrFieldNotFoundPart = ClassDDL.NewStd(mysql.ErrFieldNotFoundPart) + ErrFieldNotFoundPart = ClassDDL.NewStd(errno.ErrFieldNotFoundPart) // ErrWrongTypeColumnValue returns 'Partition column values of incorrect type' - ErrWrongTypeColumnValue = ClassDDL.NewStd(mysql.ErrWrongTypeColumnValue) + ErrWrongTypeColumnValue = ClassDDL.NewStd(errno.ErrWrongTypeColumnValue) // ErrValuesIsNotIntType returns 'VALUES value for partition '%-.64s' must have type INT' - ErrValuesIsNotIntType = ClassDDL.NewStd(mysql.ErrValuesIsNotIntType) + ErrValuesIsNotIntType = ClassDDL.NewStd(errno.ErrValuesIsNotIntType) // ErrFunctionalIndexPrimaryKey returns 'The primary key cannot be a functional index' - ErrFunctionalIndexPrimaryKey = ClassDDL.NewStd(mysql.ErrFunctionalIndexPrimaryKey) + ErrFunctionalIndexPrimaryKey = ClassDDL.NewStd(errno.ErrFunctionalIndexPrimaryKey) // ErrFunctionalIndexOnField returns 'Functional index on a column is not supported. Consider using a regular index instead' - ErrFunctionalIndexOnField = ClassDDL.NewStd(mysql.ErrFunctionalIndexOnField) + ErrFunctionalIndexOnField = ClassDDL.NewStd(errno.ErrFunctionalIndexOnField) // ErrInvalidAutoRandom returns when auto_random is used incorrectly. - ErrInvalidAutoRandom = ClassDDL.NewStd(mysql.ErrInvalidAutoRandom) + ErrInvalidAutoRandom = ClassDDL.NewStd(errno.ErrInvalidAutoRandom) // ErrUnsupportedConstraintCheck returns when use ADD CONSTRAINT CHECK - ErrUnsupportedConstraintCheck = ClassDDL.NewStd(mysql.ErrUnsupportedConstraintCheck) + ErrUnsupportedConstraintCheck = ClassDDL.NewStd(errno.ErrUnsupportedConstraintCheck) // ErrDerivedMustHaveAlias returns when a sub select statement does not have a table alias. - ErrDerivedMustHaveAlias = ClassDDL.NewStd(mysql.ErrDerivedMustHaveAlias) + ErrDerivedMustHaveAlias = ClassDDL.NewStd(errno.ErrDerivedMustHaveAlias) // ErrNullInValuesLessThan returns when a range partition LESS THAN expression includes a NULL - ErrNullInValuesLessThan = ClassDDL.NewStd(mysql.ErrNullInValuesLessThan) + ErrNullInValuesLessThan = ClassDDL.NewStd(errno.ErrNullInValuesLessThan) // ErrSequenceRunOut returns when the sequence has been run out. - ErrSequenceRunOut = ClassDDL.NewStd(mysql.ErrSequenceRunOut) + ErrSequenceRunOut = ClassDDL.NewStd(errno.ErrSequenceRunOut) // ErrSequenceInvalidData returns when sequence values are conflicting. - ErrSequenceInvalidData = ClassDDL.NewStd(mysql.ErrSequenceInvalidData) + ErrSequenceInvalidData = ClassDDL.NewStd(errno.ErrSequenceInvalidData) // ErrSequenceAccessFail returns when sequences are not able to access. - ErrSequenceAccessFail = ClassDDL.NewStd(mysql.ErrSequenceAccessFail) + ErrSequenceAccessFail = ClassDDL.NewStd(errno.ErrSequenceAccessFail) // ErrNotSequence returns when object is not a sequence. - ErrNotSequence = ClassDDL.NewStd(mysql.ErrNotSequence) + ErrNotSequence = ClassDDL.NewStd(errno.ErrNotSequence) // ErrUnknownSequence returns when drop / alter unknown sequence. - ErrUnknownSequence = ClassDDL.NewStd(mysql.ErrUnknownSequence) + ErrUnknownSequence = ClassDDL.NewStd(errno.ErrUnknownSequence) // ErrSequenceUnsupportedTableOption returns when unsupported table option exists in sequence. - ErrSequenceUnsupportedTableOption = ClassDDL.NewStd(mysql.ErrSequenceUnsupportedTableOption) + ErrSequenceUnsupportedTableOption = ClassDDL.NewStd(errno.ErrSequenceUnsupportedTableOption) // ErrColumnTypeUnsupportedNextValue is returned when sequence next value is assigned to unsupported column type. - ErrColumnTypeUnsupportedNextValue = ClassDDL.NewStd(mysql.ErrColumnTypeUnsupportedNextValue) + ErrColumnTypeUnsupportedNextValue = ClassDDL.NewStd(errno.ErrColumnTypeUnsupportedNextValue) // ErrAddColumnWithSequenceAsDefault is returned when the new added column with sequence's nextval as it's default value. - ErrAddColumnWithSequenceAsDefault = ClassDDL.NewStd(mysql.ErrAddColumnWithSequenceAsDefault) + ErrAddColumnWithSequenceAsDefault = ClassDDL.NewStd(errno.ErrAddColumnWithSequenceAsDefault) // ErrUnsupportedExpressionIndex is returned when create an expression index without allow-expression-index. - ErrUnsupportedExpressionIndex = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "creating expression index containing unsafe functions without allow-expression-index in config"), nil)) + ErrUnsupportedExpressionIndex = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "creating expression index containing unsafe functions without allow-expression-index in config"), nil)) // ErrPartitionExchangePartTable is returned when exchange table partition with another table is partitioned. - ErrPartitionExchangePartTable = ClassDDL.NewStd(mysql.ErrPartitionExchangePartTable) + ErrPartitionExchangePartTable = ClassDDL.NewStd(errno.ErrPartitionExchangePartTable) // ErrPartitionExchangeTempTable is returned when exchange table partition with a temporary table - ErrPartitionExchangeTempTable = ClassDDL.NewStd(mysql.ErrPartitionExchangeTempTable) + ErrPartitionExchangeTempTable = ClassDDL.NewStd(errno.ErrPartitionExchangeTempTable) // ErrTablesDifferentMetadata is returned when exchanges tables is not compatible. - ErrTablesDifferentMetadata = ClassDDL.NewStd(mysql.ErrTablesDifferentMetadata) + ErrTablesDifferentMetadata = ClassDDL.NewStd(errno.ErrTablesDifferentMetadata) // ErrRowDoesNotMatchPartition is returned when the row record of exchange table does not match the partition rule. - ErrRowDoesNotMatchPartition = ClassDDL.NewStd(mysql.ErrRowDoesNotMatchPartition) + ErrRowDoesNotMatchPartition = ClassDDL.NewStd(errno.ErrRowDoesNotMatchPartition) // ErrPartitionExchangeForeignKey is returned when exchanged normal table has foreign keys. - ErrPartitionExchangeForeignKey = ClassDDL.NewStd(mysql.ErrPartitionExchangeForeignKey) + ErrPartitionExchangeForeignKey = ClassDDL.NewStd(errno.ErrPartitionExchangeForeignKey) // ErrCheckNoSuchTable is returned when exchanged normal table is view or sequence. - ErrCheckNoSuchTable = ClassDDL.NewStd(mysql.ErrCheckNoSuchTable) + ErrCheckNoSuchTable = ClassDDL.NewStd(errno.ErrCheckNoSuchTable) // ErrUnsupportedPartitionType is returned when exchange table partition type is not supported. - ErrUnsupportedPartitionType = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "partition type of table %s when exchanging partition"), nil)) + ErrUnsupportedPartitionType = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "partition type of table %s when exchanging partition"), nil)) // ErrPartitionExchangeDifferentOption is returned when attribute does not match between partition table and normal table. - ErrPartitionExchangeDifferentOption = ClassDDL.NewStd(mysql.ErrPartitionExchangeDifferentOption) + ErrPartitionExchangeDifferentOption = ClassDDL.NewStd(errno.ErrPartitionExchangeDifferentOption) // ErrTableOptionUnionUnsupported is returned when create/alter table with union option. - ErrTableOptionUnionUnsupported = ClassDDL.NewStd(mysql.ErrTableOptionUnionUnsupported) + ErrTableOptionUnionUnsupported = ClassDDL.NewStd(errno.ErrTableOptionUnionUnsupported) // ErrTableOptionInsertMethodUnsupported is returned when create/alter table with insert method option. - ErrTableOptionInsertMethodUnsupported = ClassDDL.NewStd(mysql.ErrTableOptionInsertMethodUnsupported) + ErrTableOptionInsertMethodUnsupported = ClassDDL.NewStd(errno.ErrTableOptionInsertMethodUnsupported) // ErrInvalidPlacementPolicyCheck is returned when txn_scope and commit data changing do not meet the placement policy - ErrInvalidPlacementPolicyCheck = ClassDDL.NewStd(mysql.ErrPlacementPolicyCheck) + ErrInvalidPlacementPolicyCheck = ClassDDL.NewStd(errno.ErrPlacementPolicyCheck) // ErrPlacementPolicyWithDirectOption is returned when create/alter table with both placement policy and placement options existed. - ErrPlacementPolicyWithDirectOption = ClassDDL.NewStd(mysql.ErrPlacementPolicyWithDirectOption) + ErrPlacementPolicyWithDirectOption = ClassDDL.NewStd(errno.ErrPlacementPolicyWithDirectOption) // ErrPlacementPolicyInUse is returned when placement policy is in use in drop/alter. - ErrPlacementPolicyInUse = ClassDDL.NewStd(mysql.ErrPlacementPolicyInUse) + ErrPlacementPolicyInUse = ClassDDL.NewStd(errno.ErrPlacementPolicyInUse) // ErrMultipleDefConstInListPart returns multiple definition of same constant in list partitioning. - ErrMultipleDefConstInListPart = ClassDDL.NewStd(mysql.ErrMultipleDefConstInListPart) + ErrMultipleDefConstInListPart = ClassDDL.NewStd(errno.ErrMultipleDefConstInListPart) // ErrTruncatedWrongValue is returned when data has been truncated during conversion. - ErrTruncatedWrongValue = ClassDDL.NewStd(mysql.ErrTruncatedWrongValue) + ErrTruncatedWrongValue = ClassDDL.NewStd(errno.ErrTruncatedWrongValue) // ErrWarnDataOutOfRange is returned when the value in a numeric column that is outside the permissible range of the column data type. // See https://dev.mysql.com/doc/refman/5.5/en/out-of-range-and-overflow.html for details - ErrWarnDataOutOfRange = ClassDDL.NewStd(mysql.ErrWarnDataOutOfRange) + ErrWarnDataOutOfRange = ClassDDL.NewStd(errno.ErrWarnDataOutOfRange) // ErrTooLongValueForType is returned when the individual enum element length is too long. - ErrTooLongValueForType = ClassDDL.NewStd(mysql.ErrTooLongValueForType) + ErrTooLongValueForType = ClassDDL.NewStd(errno.ErrTooLongValueForType) // ErrUnknownEngine is returned when the table engine is unknown. - ErrUnknownEngine = ClassDDL.NewStd(mysql.ErrUnknownStorageEngine) + ErrUnknownEngine = ClassDDL.NewStd(errno.ErrUnknownStorageEngine) // ErrExchangePartitionDisabled is returned when exchange partition is disabled. - ErrExchangePartitionDisabled = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("Exchange Partition is disabled, please set 'tidb_enable_exchange_partition' if you need to need to enable it", nil)) + ErrExchangePartitionDisabled = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("Exchange Partition is disabled, please set 'tidb_enable_exchange_partition' if you need to need to enable it", nil)) // ErrPartitionNoTemporary returns when partition at temporary mode - ErrPartitionNoTemporary = ClassDDL.NewStd(mysql.ErrPartitionNoTemporary) + ErrPartitionNoTemporary = ClassDDL.NewStd(errno.ErrPartitionNoTemporary) // ErrOptOnTemporaryTable returns when exec unsupported opt at temporary mode - ErrOptOnTemporaryTable = ClassDDL.NewStd(mysql.ErrOptOnTemporaryTable) + ErrOptOnTemporaryTable = ClassDDL.NewStd(errno.ErrOptOnTemporaryTable) // ErrOptOnCacheTable returns when exec unsupported opt at cache mode - ErrOptOnCacheTable = ClassDDL.NewStd(mysql.ErrOptOnCacheTable) + ErrOptOnCacheTable = ClassDDL.NewStd(errno.ErrOptOnCacheTable) // ErrUnsupportedOnCommitPreserve returns when exec unsupported opt on commit preserve - ErrUnsupportedOnCommitPreserve = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("TiDB doesn't support ON COMMIT PRESERVE ROWS for now", nil)) + ErrUnsupportedOnCommitPreserve = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("TiDB doesn't support ON COMMIT PRESERVE ROWS for now", nil)) // ErrUnsupportedClusteredSecondaryKey returns when exec unsupported clustered secondary key - ErrUnsupportedClusteredSecondaryKey = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("CLUSTERED/NONCLUSTERED keyword is only supported for primary key", nil)) + ErrUnsupportedClusteredSecondaryKey = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("CLUSTERED/NONCLUSTERED keyword is only supported for primary key", nil)) // ErrUnsupportedLocalTempTableDDL returns when ddl operation unsupported for local temporary table - ErrUnsupportedLocalTempTableDDL = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("TiDB doesn't support %s for local temporary table", nil)) + ErrUnsupportedLocalTempTableDDL = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("TiDB doesn't support %s for local temporary table", nil)) // ErrInvalidAttributesSpec is returned when meeting invalid attributes. - ErrInvalidAttributesSpec = ClassDDL.NewStd(mysql.ErrInvalidAttributesSpec) + ErrInvalidAttributesSpec = ClassDDL.NewStd(errno.ErrInvalidAttributesSpec) // ErrFunctionalIndexOnJSONOrGeometryFunction returns when creating expression index and the type of the expression is JSON. - ErrFunctionalIndexOnJSONOrGeometryFunction = ClassDDL.NewStd(mysql.ErrFunctionalIndexOnJSONOrGeometryFunction) + ErrFunctionalIndexOnJSONOrGeometryFunction = ClassDDL.NewStd(errno.ErrFunctionalIndexOnJSONOrGeometryFunction) // ErrDependentByFunctionalIndex returns when the dropped column depends by expression index. - ErrDependentByFunctionalIndex = ClassDDL.NewStd(mysql.ErrDependentByFunctionalIndex) + ErrDependentByFunctionalIndex = ClassDDL.NewStd(errno.ErrDependentByFunctionalIndex) // ErrFunctionalIndexOnBlob when the expression of expression index returns blob or text. - ErrFunctionalIndexOnBlob = ClassDDL.NewStd(mysql.ErrFunctionalIndexOnBlob) + ErrFunctionalIndexOnBlob = ClassDDL.NewStd(errno.ErrFunctionalIndexOnBlob) // ErrDependentByPartitionFunctional returns when the dropped column depends by expression partition. - ErrDependentByPartitionFunctional = ClassDDL.NewStd(mysql.ErrDependentByPartitionFunctional) + ErrDependentByPartitionFunctional = ClassDDL.NewStd(errno.ErrDependentByPartitionFunctional) // ErrUnsupportedAlterTableSpec means we don't support this alter table specification (i.e. unknown) - ErrUnsupportedAlterTableSpec = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "Unsupported/unknown ALTER TABLE specification"), nil)) + ErrUnsupportedAlterTableSpec = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "Unsupported/unknown ALTER TABLE specification"), nil)) // ErrGeneralUnsupportedDDL as a generic error to customise by argument - ErrGeneralUnsupportedDDL = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "%s"), nil)) + ErrGeneralUnsupportedDDL = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "%s"), nil)) // ErrAutoConvert when auto convert happens - ErrAutoConvert = ClassDDL.NewStd(mysql.ErrAutoConvert) + ErrAutoConvert = ClassDDL.NewStd(errno.ErrAutoConvert) // ErrWrongStringLength when UserName or HostName is too long - ErrWrongStringLength = ClassDDL.NewStd(mysql.ErrWrongStringLength) + ErrWrongStringLength = ClassDDL.NewStd(errno.ErrWrongStringLength) // ErrBinlogUnsafeSystemFunction when use a system function that may return a different value on the slave. - ErrBinlogUnsafeSystemFunction = ClassDDL.NewStd(mysql.ErrBinlogUnsafeSystemFunction) + ErrBinlogUnsafeSystemFunction = ClassDDL.NewStd(errno.ErrBinlogUnsafeSystemFunction) // ErrDDLJobNotFound indicates the job id was not found. - ErrDDLJobNotFound = ClassDDL.NewStd(mysql.ErrDDLJobNotFound) + ErrDDLJobNotFound = ClassDDL.NewStd(errno.ErrDDLJobNotFound) // ErrCancelFinishedDDLJob returns when cancel a finished ddl job. - ErrCancelFinishedDDLJob = ClassDDL.NewStd(mysql.ErrCancelFinishedDDLJob) + ErrCancelFinishedDDLJob = ClassDDL.NewStd(errno.ErrCancelFinishedDDLJob) // ErrCannotCancelDDLJob returns when cancel a almost finished ddl job, because cancel in now may cause data inconsistency. - ErrCannotCancelDDLJob = ClassDDL.NewStd(mysql.ErrCannotCancelDDLJob) + ErrCannotCancelDDLJob = ClassDDL.NewStd(errno.ErrCannotCancelDDLJob) // ErrCannotPauseDDLJob returns when the State is not qualified to be paused. - ErrCannotPauseDDLJob = ClassDDL.NewStd(mysql.ErrCannotPauseDDLJob) + ErrCannotPauseDDLJob = ClassDDL.NewStd(errno.ErrCannotPauseDDLJob) // ErrCannotResumeDDLJob returns when the State is not qualified to be resumed. - ErrCannotResumeDDLJob = ClassDDL.NewStd(mysql.ErrCannotResumeDDLJob) + ErrCannotResumeDDLJob = ClassDDL.NewStd(errno.ErrCannotResumeDDLJob) // ErrDDLSetting returns when failing to enable/disable DDL. - ErrDDLSetting = ClassDDL.NewStd(mysql.ErrDDLSetting) + ErrDDLSetting = ClassDDL.NewStd(errno.ErrDDLSetting) // ErrIngestFailed returns when the DDL ingest job is failed. - ErrIngestFailed = ClassDDL.NewStd(mysql.ErrIngestFailed) + ErrIngestFailed = ClassDDL.NewStd(errno.ErrIngestFailed) // ErrIngestCheckEnvFailed returns when the DDL ingest env is failed to init. - ErrIngestCheckEnvFailed = ClassDDL.NewStd(mysql.ErrIngestCheckEnvFailed) + ErrIngestCheckEnvFailed = ClassDDL.NewStd(errno.ErrIngestCheckEnvFailed) // ErrColumnInChange indicates there is modification on the column in parallel. - ErrColumnInChange = ClassDDL.NewStd(mysql.ErrColumnInChange) + ErrColumnInChange = ClassDDL.NewStd(errno.ErrColumnInChange) // ErrAlterTiFlashModeForTableWithoutTiFlashReplica returns when set tiflash mode on table whose tiflash_replica is null or tiflash_replica_count = 0 - ErrAlterTiFlashModeForTableWithoutTiFlashReplica = ClassDDL.NewStdErr(0, parser_mysql.Message("TiFlash mode will take effect after at least one TiFlash replica is set for the table", nil)) + ErrAlterTiFlashModeForTableWithoutTiFlashReplica = ClassDDL.NewStdErr(0, errno.Message("TiFlash mode will take effect after at least one TiFlash replica is set for the table", nil)) // ErrUnsupportedTiFlashOperationForSysOrMemTable means we don't support the alter tiflash related action(e.g. set tiflash mode, set tiflash replica) for system table. - ErrUnsupportedTiFlashOperationForSysOrMemTable = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "`set TiFlash replica` settings for system table and memory table"), nil)) + ErrUnsupportedTiFlashOperationForSysOrMemTable = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "`set TiFlash replica` settings for system table and memory table"), nil)) // ErrUnsupportedTiFlashOperationForUnsupportedCharsetTable is used when alter alter tiflash related action(e.g. set tiflash mode, set tiflash replica) with unsupported charset. - ErrUnsupportedTiFlashOperationForUnsupportedCharsetTable = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, "`set TiFlash replica` settings for table contains %s charset"), nil)) + ErrUnsupportedTiFlashOperationForUnsupportedCharsetTable = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "`set TiFlash replica` settings for table contains %s charset"), nil)) // ErrTiFlashBackfillIndex is the error that tiflash backfill the index failed. - ErrTiFlashBackfillIndex = ClassDDL.NewStdErr(mysql.ErrTiFlashBackfillIndex, - parser_mysql.Message(mysql.MySQLErrName[mysql.ErrTiFlashBackfillIndex].Raw, nil)) + ErrTiFlashBackfillIndex = ClassDDL.NewStdErr(errno.ErrTiFlashBackfillIndex, + errno.Message(errno.MySQLErrName[errno.ErrTiFlashBackfillIndex].Raw, nil)) // ErrDropIndexNeededInForeignKey returns when drop index which is needed in foreign key. - ErrDropIndexNeededInForeignKey = ClassDDL.NewStd(mysql.ErrDropIndexNeededInForeignKey) + ErrDropIndexNeededInForeignKey = ClassDDL.NewStd(errno.ErrDropIndexNeededInForeignKey) // ErrForeignKeyCannotDropParent returns when drop table which has foreign key referred. - ErrForeignKeyCannotDropParent = ClassDDL.NewStd(mysql.ErrForeignKeyCannotDropParent) + ErrForeignKeyCannotDropParent = ClassDDL.NewStd(errno.ErrForeignKeyCannotDropParent) // ErrTruncateIllegalForeignKey returns when truncate table which has foreign key referred. - ErrTruncateIllegalForeignKey = ClassDDL.NewStd(mysql.ErrTruncateIllegalForeignKey) + ErrTruncateIllegalForeignKey = ClassDDL.NewStd(errno.ErrTruncateIllegalForeignKey) // ErrForeignKeyColumnCannotChange returns when change column which used by foreign key. - ErrForeignKeyColumnCannotChange = ClassDDL.NewStd(mysql.ErrForeignKeyColumnCannotChange) + ErrForeignKeyColumnCannotChange = ClassDDL.NewStd(errno.ErrForeignKeyColumnCannotChange) // ErrForeignKeyColumnCannotChangeChild returns when change child table's column which used by foreign key. - ErrForeignKeyColumnCannotChangeChild = ClassDDL.NewStd(mysql.ErrForeignKeyColumnCannotChangeChild) + ErrForeignKeyColumnCannotChangeChild = ClassDDL.NewStd(errno.ErrForeignKeyColumnCannotChangeChild) // ErrNoReferencedRow2 returns when there are rows in child table don't have related foreign key value in refer table. - ErrNoReferencedRow2 = ClassDDL.NewStd(mysql.ErrNoReferencedRow2) + ErrNoReferencedRow2 = ClassDDL.NewStd(errno.ErrNoReferencedRow2) // ErrUnsupportedColumnInTTLConfig returns when a column type is not expected in TTL config - ErrUnsupportedColumnInTTLConfig = ClassDDL.NewStd(mysql.ErrUnsupportedColumnInTTLConfig) + ErrUnsupportedColumnInTTLConfig = ClassDDL.NewStd(errno.ErrUnsupportedColumnInTTLConfig) // ErrTTLColumnCannotDrop returns when a column is dropped while referenced by TTL config - ErrTTLColumnCannotDrop = ClassDDL.NewStd(mysql.ErrTTLColumnCannotDrop) + ErrTTLColumnCannotDrop = ClassDDL.NewStd(errno.ErrTTLColumnCannotDrop) // ErrSetTTLOptionForNonTTLTable returns when the `TTL_ENABLE` or `TTL_JOB_INTERVAL` option is set on a non-TTL table - ErrSetTTLOptionForNonTTLTable = ClassDDL.NewStd(mysql.ErrSetTTLOptionForNonTTLTable) + ErrSetTTLOptionForNonTTLTable = ClassDDL.NewStd(errno.ErrSetTTLOptionForNonTTLTable) // ErrTempTableNotAllowedWithTTL returns when setting TTL config for a temp table - ErrTempTableNotAllowedWithTTL = ClassDDL.NewStd(mysql.ErrTempTableNotAllowedWithTTL) + ErrTempTableNotAllowedWithTTL = ClassDDL.NewStd(errno.ErrTempTableNotAllowedWithTTL) // ErrUnsupportedTTLReferencedByFK returns when the TTL config is set for a table referenced by foreign key - ErrUnsupportedTTLReferencedByFK = ClassDDL.NewStd(mysql.ErrUnsupportedTTLReferencedByFK) + ErrUnsupportedTTLReferencedByFK = ClassDDL.NewStd(errno.ErrUnsupportedTTLReferencedByFK) // ErrUnsupportedPrimaryKeyTypeWithTTL returns when create or alter a table with TTL options but the primary key is not supported - ErrUnsupportedPrimaryKeyTypeWithTTL = ClassDDL.NewStd(mysql.ErrUnsupportedPrimaryKeyTypeWithTTL) + ErrUnsupportedPrimaryKeyTypeWithTTL = ClassDDL.NewStd(errno.ErrUnsupportedPrimaryKeyTypeWithTTL) // ErrNotSupportedYet returns when tidb does not support this feature. - ErrNotSupportedYet = ClassDDL.NewStd(mysql.ErrNotSupportedYet) + ErrNotSupportedYet = ClassDDL.NewStd(errno.ErrNotSupportedYet) // ErrColumnCheckConstraintReferOther is returned when create column check constraint referring other column. - ErrColumnCheckConstraintReferOther = ClassDDL.NewStd(mysql.ErrColumnCheckConstraintReferencesOtherColumn) + ErrColumnCheckConstraintReferOther = ClassDDL.NewStd(errno.ErrColumnCheckConstraintReferencesOtherColumn) // ErrTableCheckConstraintReferUnknown is returned when create table check constraint referring non-existing column. - ErrTableCheckConstraintReferUnknown = ClassDDL.NewStd(mysql.ErrTableCheckConstraintReferUnknown) + ErrTableCheckConstraintReferUnknown = ClassDDL.NewStd(errno.ErrTableCheckConstraintReferUnknown) // ErrConstraintNotFound is returned for dropping a non-existent constraint. - ErrConstraintNotFound = ClassDDL.NewStd(mysql.ErrConstraintNotFound) + ErrConstraintNotFound = ClassDDL.NewStd(errno.ErrConstraintNotFound) // ErrCheckConstraintIsViolated is returned for violating an existent check constraint. - ErrCheckConstraintIsViolated = ClassDDL.NewStd(mysql.ErrCheckConstraintViolated) + ErrCheckConstraintIsViolated = ClassDDL.NewStd(errno.ErrCheckConstraintViolated) // ErrCheckConstraintNamedFuncIsNotAllowed is returned for not allowed function with name. - ErrCheckConstraintNamedFuncIsNotAllowed = ClassDDL.NewStd(mysql.ErrCheckConstraintNamedFunctionIsNotAllowed) + ErrCheckConstraintNamedFuncIsNotAllowed = ClassDDL.NewStd(errno.ErrCheckConstraintNamedFunctionIsNotAllowed) // ErrCheckConstraintFuncIsNotAllowed is returned for not allowed function. - ErrCheckConstraintFuncIsNotAllowed = ClassDDL.NewStd(mysql.ErrCheckConstraintFunctionIsNotAllowed) + ErrCheckConstraintFuncIsNotAllowed = ClassDDL.NewStd(errno.ErrCheckConstraintFunctionIsNotAllowed) // ErrCheckConstraintVariables is returned for referring user or system variables. - ErrCheckConstraintVariables = ClassDDL.NewStd(mysql.ErrCheckConstraintVariables) + ErrCheckConstraintVariables = ClassDDL.NewStd(errno.ErrCheckConstraintVariables) // ErrCheckConstraintRefersAutoIncrementColumn is returned for referring auto-increment columns. - ErrCheckConstraintRefersAutoIncrementColumn = ClassDDL.NewStd(mysql.ErrCheckConstraintRefersAutoIncrementColumn) + ErrCheckConstraintRefersAutoIncrementColumn = ClassDDL.NewStd(errno.ErrCheckConstraintRefersAutoIncrementColumn) // ErrCheckConstraintUsingFKReferActionColumn is returned for referring foreign key columns. - ErrCheckConstraintUsingFKReferActionColumn = ClassDDL.NewStd(mysql.ErrCheckConstraintClauseUsingFKReferActionColumn) + ErrCheckConstraintUsingFKReferActionColumn = ClassDDL.NewStd(errno.ErrCheckConstraintClauseUsingFKReferActionColumn) // ErrNonBooleanExprForCheckConstraint is returned for non bool expression. - ErrNonBooleanExprForCheckConstraint = ClassDDL.NewStd(mysql.ErrNonBooleanExprForCheckConstraint) + ErrNonBooleanExprForCheckConstraint = ClassDDL.NewStd(errno.ErrNonBooleanExprForCheckConstraint) // ErrWarnDeprecatedIntegerDisplayWidth share the same code 1681, and it will be returned when length is specified in integer. ErrWarnDeprecatedIntegerDisplayWidth = ClassDDL.NewStdErr( - mysql.ErrWarnDeprecatedSyntaxNoReplacement, - parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrWarnDeprecatedSyntaxNoReplacement].Raw, + errno.ErrWarnDeprecatedSyntaxNoReplacement, + errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrWarnDeprecatedSyntaxNoReplacement].Raw, "Integer display width", "", ), nil), ) // ErrWarnDeprecatedZerofill is for when the deprectated zerofill attribute is used ErrWarnDeprecatedZerofill = ClassDDL.NewStdErr( - mysql.ErrWarnDeprecatedSyntaxNoReplacement, - parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrWarnDeprecatedSyntaxNoReplacement].Raw, + errno.ErrWarnDeprecatedSyntaxNoReplacement, + errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrWarnDeprecatedSyntaxNoReplacement].Raw, "The ZEROFILL attribute", " Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column.", ), nil), ) // ErrCheckConstraintDupName is for duplicate check constraint names - ErrCheckConstraintDupName = ClassDDL.NewStd(mysql.ErrCheckConstraintDupName) + ErrCheckConstraintDupName = ClassDDL.NewStd(errno.ErrCheckConstraintDupName) // ErrUnsupportedDistTask is for `tidb_enable_dist_task enabled` but `tidb_ddl_enable_fast_reorg` disabled. - ErrUnsupportedDistTask = ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, - parser_mysql.Message(fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation].Raw, + ErrUnsupportedDistTask = ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, + errno.Message(fmt.Sprintf(errno.MySQLErrName[errno.ErrUnsupportedDDLOperation].Raw, "tidb_enable_dist_task setting. To utilize distributed task execution, please enable tidb_ddl_enable_fast_reorg first."), nil)) // ErrGlobalIndexNotExplicitlySet is for Global index when not explicitly said GLOBAL, including UPDATE INDEXES - ErrGlobalIndexNotExplicitlySet = ClassDDL.NewStd(mysql.ErrGlobalIndexNotExplicitlySet) + ErrGlobalIndexNotExplicitlySet = ClassDDL.NewStd(errno.ErrGlobalIndexNotExplicitlySet) // ErrWarnGlobalIndexNeedManuallyAnalyze is used for global indexes, // which cannot trigger automatic analysis when it contains prefix columns or virtual generated columns. - ErrWarnGlobalIndexNeedManuallyAnalyze = ClassDDL.NewStd(mysql.ErrWarnGlobalIndexNeedManuallyAnalyze) + ErrWarnGlobalIndexNeedManuallyAnalyze = ClassDDL.NewStd(errno.ErrWarnGlobalIndexNeedManuallyAnalyze) ) // ReorgRetryableErrCodes are the error codes that are retryable for reorganization. var ReorgRetryableErrCodes = map[uint16]struct{}{ - mysql.ErrPDServerTimeout: {}, - mysql.ErrTiKVServerTimeout: {}, - mysql.ErrTiKVServerBusy: {}, - mysql.ErrResolveLockTimeout: {}, - mysql.ErrRegionUnavailable: {}, - mysql.ErrGCTooEarly: {}, - mysql.ErrWriteConflict: {}, - mysql.ErrTiKVStoreLimit: {}, - mysql.ErrTiKVStaleCommand: {}, - mysql.ErrTiKVMaxTimestampNotSynced: {}, - mysql.ErrTiFlashServerTimeout: {}, - mysql.ErrTiFlashServerBusy: {}, - mysql.ErrInfoSchemaExpired: {}, - mysql.ErrInfoSchemaChanged: {}, - mysql.ErrWriteConflictInTiDB: {}, - mysql.ErrTxnRetryable: {}, - mysql.ErrNotOwner: {}, + errno.ErrPDServerTimeout: {}, + errno.ErrTiKVServerTimeout: {}, + errno.ErrTiKVServerBusy: {}, + errno.ErrResolveLockTimeout: {}, + errno.ErrRegionUnavailable: {}, + errno.ErrGCTooEarly: {}, + errno.ErrWriteConflict: {}, + errno.ErrTiKVStoreLimit: {}, + errno.ErrTiKVStaleCommand: {}, + errno.ErrTiKVMaxTimestampNotSynced: {}, + errno.ErrTiFlashServerTimeout: {}, + errno.ErrTiFlashServerBusy: {}, + errno.ErrInfoSchemaExpired: {}, + errno.ErrInfoSchemaChanged: {}, + errno.ErrWriteConflictInTiDB: {}, + errno.ErrTxnRetryable: {}, + errno.ErrNotOwner: {}, // Temporary network partitioning may cause pk commit failure. uint16(terror.CodeResultUndetermined): {}, diff --git a/pkg/util/dbterror/exeerrors/BUILD.bazel b/pkg/util/dbterror/exeerrors/BUILD.bazel index cd9bd87a6d1dd..70755e44c128d 100644 --- a/pkg/util/dbterror/exeerrors/BUILD.bazel +++ b/pkg/util/dbterror/exeerrors/BUILD.bazel @@ -7,7 +7,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/errno", - "//pkg/parser/mysql", "//pkg/util/dbterror", ], ) diff --git a/pkg/util/dbterror/exeerrors/errors.go b/pkg/util/dbterror/exeerrors/errors.go index 86bfe0a8ef83e..fd000144d6789 100644 --- a/pkg/util/dbterror/exeerrors/errors.go +++ b/pkg/util/dbterror/exeerrors/errors.go @@ -15,90 +15,89 @@ package exeerrors import ( - mysql "github.com/pingcap/tidb/pkg/errno" - parser_mysql "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // Error instances. var ( - ErrGetStartTS = dbterror.ClassExecutor.NewStd(mysql.ErrGetStartTS) - ErrUnknownPlan = dbterror.ClassExecutor.NewStd(mysql.ErrUnknownPlan) - ErrPrepareMulti = dbterror.ClassExecutor.NewStd(mysql.ErrPrepareMulti) - ErrPrepareDDL = dbterror.ClassExecutor.NewStd(mysql.ErrPrepareDDL) - ErrResultIsEmpty = dbterror.ClassExecutor.NewStd(mysql.ErrResultIsEmpty) - ErrBuildExecutor = dbterror.ClassExecutor.NewStd(mysql.ErrBuildExecutor) - ErrBatchInsertFail = dbterror.ClassExecutor.NewStd(mysql.ErrBatchInsertFail) - ErrUnsupportedPs = dbterror.ClassExecutor.NewStd(mysql.ErrUnsupportedPs) - ErrSubqueryMoreThan1Row = dbterror.ClassExecutor.NewStd(mysql.ErrSubqueryNo1Row) - ErrIllegalGrantForTable = dbterror.ClassExecutor.NewStd(mysql.ErrIllegalGrantForTable) - ErrColumnsNotMatched = dbterror.ClassExecutor.NewStd(mysql.ErrColumnNotMatched) + ErrGetStartTS = dbterror.ClassExecutor.NewStd(errno.ErrGetStartTS) + ErrUnknownPlan = dbterror.ClassExecutor.NewStd(errno.ErrUnknownPlan) + ErrPrepareMulti = dbterror.ClassExecutor.NewStd(errno.ErrPrepareMulti) + ErrPrepareDDL = dbterror.ClassExecutor.NewStd(errno.ErrPrepareDDL) + ErrResultIsEmpty = dbterror.ClassExecutor.NewStd(errno.ErrResultIsEmpty) + ErrBuildExecutor = dbterror.ClassExecutor.NewStd(errno.ErrBuildExecutor) + ErrBatchInsertFail = dbterror.ClassExecutor.NewStd(errno.ErrBatchInsertFail) + ErrUnsupportedPs = dbterror.ClassExecutor.NewStd(errno.ErrUnsupportedPs) + ErrSubqueryMoreThan1Row = dbterror.ClassExecutor.NewStd(errno.ErrSubqueryNo1Row) + ErrIllegalGrantForTable = dbterror.ClassExecutor.NewStd(errno.ErrIllegalGrantForTable) + ErrColumnsNotMatched = dbterror.ClassExecutor.NewStd(errno.ErrColumnNotMatched) - ErrCantCreateUserWithGrant = dbterror.ClassExecutor.NewStd(mysql.ErrCantCreateUserWithGrant) - ErrPasswordNoMatch = dbterror.ClassExecutor.NewStd(mysql.ErrPasswordNoMatch) - ErrCannotUser = dbterror.ClassExecutor.NewStd(mysql.ErrCannotUser) - ErrGrantRole = dbterror.ClassExecutor.NewStd(mysql.ErrGrantRole) - ErrPasswordFormat = dbterror.ClassExecutor.NewStd(mysql.ErrPasswordFormat) - ErrCantChangeTxCharacteristics = dbterror.ClassExecutor.NewStd(mysql.ErrCantChangeTxCharacteristics) - ErrPsManyParam = dbterror.ClassExecutor.NewStd(mysql.ErrPsManyParam) - ErrAdminCheckTable = dbterror.ClassExecutor.NewStd(mysql.ErrAdminCheckTable) - ErrDBaccessDenied = dbterror.ClassExecutor.NewStd(mysql.ErrDBaccessDenied) - ErrTableaccessDenied = dbterror.ClassExecutor.NewStd(mysql.ErrTableaccessDenied) - ErrBadDB = dbterror.ClassExecutor.NewStd(mysql.ErrBadDB) - ErrWrongObject = dbterror.ClassExecutor.NewStd(mysql.ErrWrongObject) - ErrWrongUsage = dbterror.ClassExecutor.NewStd(mysql.ErrWrongUsage) - ErrRoleNotGranted = dbterror.ClassPrivilege.NewStd(mysql.ErrRoleNotGranted) - ErrDeadlock = dbterror.ClassExecutor.NewStd(mysql.ErrLockDeadlock) - ErrQueryInterrupted = dbterror.ClassExecutor.NewStd(mysql.ErrQueryInterrupted) - ErrMaxExecTimeExceeded = dbterror.ClassExecutor.NewStd(mysql.ErrMaxExecTimeExceeded) - ErrResourceGroupQueryRunawayInterrupted = dbterror.ClassExecutor.NewStd(mysql.ErrResourceGroupQueryRunawayInterrupted) - ErrResourceGroupQueryRunawayQuarantine = dbterror.ClassExecutor.NewStd(mysql.ErrResourceGroupQueryRunawayQuarantine) - ErrDynamicPrivilegeNotRegistered = dbterror.ClassExecutor.NewStd(mysql.ErrDynamicPrivilegeNotRegistered) - ErrIllegalPrivilegeLevel = dbterror.ClassExecutor.NewStd(mysql.ErrIllegalPrivilegeLevel) - ErrInvalidSplitRegionRanges = dbterror.ClassExecutor.NewStd(mysql.ErrInvalidSplitRegionRanges) - ErrViewInvalid = dbterror.ClassExecutor.NewStd(mysql.ErrViewInvalid) - ErrInstanceScope = dbterror.ClassExecutor.NewStd(mysql.ErrInstanceScope) - ErrSettingNoopVariable = dbterror.ClassExecutor.NewStd(mysql.ErrSettingNoopVariable) - ErrLazyUniquenessCheckFailure = dbterror.ClassExecutor.NewStd(mysql.ErrLazyUniquenessCheckFailure) - ErrMemoryExceedForQuery = dbterror.ClassExecutor.NewStd(mysql.ErrMemoryExceedForQuery) - ErrMemoryExceedForInstance = dbterror.ClassExecutor.NewStd(mysql.ErrMemoryExceedForInstance) - ErrDeleteNotFoundColumn = dbterror.ClassExecutor.NewStd(mysql.ErrDeleteNotFoundColumn) + ErrCantCreateUserWithGrant = dbterror.ClassExecutor.NewStd(errno.ErrCantCreateUserWithGrant) + ErrPasswordNoMatch = dbterror.ClassExecutor.NewStd(errno.ErrPasswordNoMatch) + ErrCannotUser = dbterror.ClassExecutor.NewStd(errno.ErrCannotUser) + ErrGrantRole = dbterror.ClassExecutor.NewStd(errno.ErrGrantRole) + ErrPasswordFormat = dbterror.ClassExecutor.NewStd(errno.ErrPasswordFormat) + ErrCantChangeTxCharacteristics = dbterror.ClassExecutor.NewStd(errno.ErrCantChangeTxCharacteristics) + ErrPsManyParam = dbterror.ClassExecutor.NewStd(errno.ErrPsManyParam) + ErrAdminCheckTable = dbterror.ClassExecutor.NewStd(errno.ErrAdminCheckTable) + ErrDBaccessDenied = dbterror.ClassExecutor.NewStd(errno.ErrDBaccessDenied) + ErrTableaccessDenied = dbterror.ClassExecutor.NewStd(errno.ErrTableaccessDenied) + ErrBadDB = dbterror.ClassExecutor.NewStd(errno.ErrBadDB) + ErrWrongObject = dbterror.ClassExecutor.NewStd(errno.ErrWrongObject) + ErrWrongUsage = dbterror.ClassExecutor.NewStd(errno.ErrWrongUsage) + ErrRoleNotGranted = dbterror.ClassPrivilege.NewStd(errno.ErrRoleNotGranted) + ErrDeadlock = dbterror.ClassExecutor.NewStd(errno.ErrLockDeadlock) + ErrQueryInterrupted = dbterror.ClassExecutor.NewStd(errno.ErrQueryInterrupted) + ErrMaxExecTimeExceeded = dbterror.ClassExecutor.NewStd(errno.ErrMaxExecTimeExceeded) + ErrResourceGroupQueryRunawayInterrupted = dbterror.ClassExecutor.NewStd(errno.ErrResourceGroupQueryRunawayInterrupted) + ErrResourceGroupQueryRunawayQuarantine = dbterror.ClassExecutor.NewStd(errno.ErrResourceGroupQueryRunawayQuarantine) + ErrDynamicPrivilegeNotRegistered = dbterror.ClassExecutor.NewStd(errno.ErrDynamicPrivilegeNotRegistered) + ErrIllegalPrivilegeLevel = dbterror.ClassExecutor.NewStd(errno.ErrIllegalPrivilegeLevel) + ErrInvalidSplitRegionRanges = dbterror.ClassExecutor.NewStd(errno.ErrInvalidSplitRegionRanges) + ErrViewInvalid = dbterror.ClassExecutor.NewStd(errno.ErrViewInvalid) + ErrInstanceScope = dbterror.ClassExecutor.NewStd(errno.ErrInstanceScope) + ErrSettingNoopVariable = dbterror.ClassExecutor.NewStd(errno.ErrSettingNoopVariable) + ErrLazyUniquenessCheckFailure = dbterror.ClassExecutor.NewStd(errno.ErrLazyUniquenessCheckFailure) + ErrMemoryExceedForQuery = dbterror.ClassExecutor.NewStd(errno.ErrMemoryExceedForQuery) + ErrMemoryExceedForInstance = dbterror.ClassExecutor.NewStd(errno.ErrMemoryExceedForInstance) + ErrDeleteNotFoundColumn = dbterror.ClassExecutor.NewStd(errno.ErrDeleteNotFoundColumn) - ErrBRIEBackupFailed = dbterror.ClassExecutor.NewStd(mysql.ErrBRIEBackupFailed) - ErrBRIERestoreFailed = dbterror.ClassExecutor.NewStd(mysql.ErrBRIERestoreFailed) - ErrBRIEImportFailed = dbterror.ClassExecutor.NewStd(mysql.ErrBRIEImportFailed) - ErrBRIEExportFailed = dbterror.ClassExecutor.NewStd(mysql.ErrBRIEExportFailed) - ErrBRJobNotFound = dbterror.ClassExecutor.NewStd(mysql.ErrBRJobNotFound) - ErrCTEMaxRecursionDepth = dbterror.ClassExecutor.NewStd(mysql.ErrCTEMaxRecursionDepth) - ErrPluginIsNotLoaded = dbterror.ClassExecutor.NewStd(mysql.ErrPluginIsNotLoaded) - ErrSetPasswordAuthPlugin = dbterror.ClassExecutor.NewStd(mysql.ErrSetPasswordAuthPlugin) - ErrFuncNotEnabled = dbterror.ClassExecutor.NewStdErr(mysql.ErrNotSupportedYet, parser_mysql.Message("%-.32s is not supported. To enable this experimental feature, set '%-.32s' in the configuration file.", nil)) - ErrSavepointNotExists = dbterror.ClassExecutor.NewStd(mysql.ErrSpDoesNotExist) - ErrForeignKeyCascadeDepthExceeded = dbterror.ClassExecutor.NewStd(mysql.ErrForeignKeyCascadeDepthExceeded) - ErrPasswordExpireAnonymousUser = dbterror.ClassExecutor.NewStd(mysql.ErrPasswordExpireAnonymousUser) - ErrMustChangePassword = dbterror.ClassExecutor.NewStd(mysql.ErrMustChangePassword) + ErrBRIEBackupFailed = dbterror.ClassExecutor.NewStd(errno.ErrBRIEBackupFailed) + ErrBRIERestoreFailed = dbterror.ClassExecutor.NewStd(errno.ErrBRIERestoreFailed) + ErrBRIEImportFailed = dbterror.ClassExecutor.NewStd(errno.ErrBRIEImportFailed) + ErrBRIEExportFailed = dbterror.ClassExecutor.NewStd(errno.ErrBRIEExportFailed) + ErrBRJobNotFound = dbterror.ClassExecutor.NewStd(errno.ErrBRJobNotFound) + ErrCTEMaxRecursionDepth = dbterror.ClassExecutor.NewStd(errno.ErrCTEMaxRecursionDepth) + ErrPluginIsNotLoaded = dbterror.ClassExecutor.NewStd(errno.ErrPluginIsNotLoaded) + ErrSetPasswordAuthPlugin = dbterror.ClassExecutor.NewStd(errno.ErrSetPasswordAuthPlugin) + ErrFuncNotEnabled = dbterror.ClassExecutor.NewStdErr(errno.ErrNotSupportedYet, errno.Message("%-.32s is not supported. To enable this experimental feature, set '%-.32s' in the configuration file.", nil)) + ErrSavepointNotExists = dbterror.ClassExecutor.NewStd(errno.ErrSpDoesNotExist) + ErrForeignKeyCascadeDepthExceeded = dbterror.ClassExecutor.NewStd(errno.ErrForeignKeyCascadeDepthExceeded) + ErrPasswordExpireAnonymousUser = dbterror.ClassExecutor.NewStd(errno.ErrPasswordExpireAnonymousUser) + ErrMustChangePassword = dbterror.ClassExecutor.NewStd(errno.ErrMustChangePassword) - ErrWrongStringLength = dbterror.ClassDDL.NewStd(mysql.ErrWrongStringLength) - ErrUnsupportedFlashbackTmpTable = dbterror.ClassDDL.NewStdErr(mysql.ErrUnsupportedDDLOperation, parser_mysql.Message("Recover/flashback table is not supported on temporary tables", nil)) - ErrTruncateWrongInsertValue = dbterror.ClassTable.NewStdErr(mysql.ErrTruncatedWrongValue, parser_mysql.Message("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %d", nil)) - ErrExistsInHistoryPassword = dbterror.ClassExecutor.NewStd(mysql.ErrExistsInHistoryPassword) + ErrWrongStringLength = dbterror.ClassDDL.NewStd(errno.ErrWrongStringLength) + ErrUnsupportedFlashbackTmpTable = dbterror.ClassDDL.NewStdErr(errno.ErrUnsupportedDDLOperation, errno.Message("Recover/flashback table is not supported on temporary tables", nil)) + ErrTruncateWrongInsertValue = dbterror.ClassTable.NewStdErr(errno.ErrTruncatedWrongValue, errno.Message("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %d", nil)) + ErrExistsInHistoryPassword = dbterror.ClassExecutor.NewStd(errno.ErrExistsInHistoryPassword) - ErrWarnTooFewRecords = dbterror.ClassExecutor.NewStd(mysql.ErrWarnTooFewRecords) - ErrWarnTooManyRecords = dbterror.ClassExecutor.NewStd(mysql.ErrWarnTooManyRecords) - ErrLoadDataFromServerDisk = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataFromServerDisk) - ErrLoadParquetFromLocal = dbterror.ClassExecutor.NewStd(mysql.ErrLoadParquetFromLocal) - ErrLoadDataEmptyPath = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataEmptyPath) - ErrLoadDataUnsupportedFormat = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataUnsupportedFormat) - ErrLoadDataInvalidURI = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataInvalidURI) - ErrLoadDataCantAccess = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataCantAccess) - ErrLoadDataCantRead = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataCantRead) - ErrLoadDataWrongFormatConfig = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataWrongFormatConfig) - ErrUnknownOption = dbterror.ClassExecutor.NewStd(mysql.ErrUnknownOption) - ErrInvalidOptionVal = dbterror.ClassExecutor.NewStd(mysql.ErrInvalidOptionVal) - ErrDuplicateOption = dbterror.ClassExecutor.NewStd(mysql.ErrDuplicateOption) - ErrLoadDataUnsupportedOption = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataUnsupportedOption) - ErrLoadDataJobNotFound = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataJobNotFound) - ErrLoadDataInvalidOperation = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataInvalidOperation) - ErrLoadDataLocalUnsupportedOption = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataLocalUnsupportedOption) - ErrLoadDataPreCheckFailed = dbterror.ClassExecutor.NewStd(mysql.ErrLoadDataPreCheckFailed) + ErrWarnTooFewRecords = dbterror.ClassExecutor.NewStd(errno.ErrWarnTooFewRecords) + ErrWarnTooManyRecords = dbterror.ClassExecutor.NewStd(errno.ErrWarnTooManyRecords) + ErrLoadDataFromServerDisk = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataFromServerDisk) + ErrLoadParquetFromLocal = dbterror.ClassExecutor.NewStd(errno.ErrLoadParquetFromLocal) + ErrLoadDataEmptyPath = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataEmptyPath) + ErrLoadDataUnsupportedFormat = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataUnsupportedFormat) + ErrLoadDataInvalidURI = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataInvalidURI) + ErrLoadDataCantAccess = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataCantAccess) + ErrLoadDataCantRead = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataCantRead) + ErrLoadDataWrongFormatConfig = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataWrongFormatConfig) + ErrUnknownOption = dbterror.ClassExecutor.NewStd(errno.ErrUnknownOption) + ErrInvalidOptionVal = dbterror.ClassExecutor.NewStd(errno.ErrInvalidOptionVal) + ErrDuplicateOption = dbterror.ClassExecutor.NewStd(errno.ErrDuplicateOption) + ErrLoadDataUnsupportedOption = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataUnsupportedOption) + ErrLoadDataJobNotFound = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataJobNotFound) + ErrLoadDataInvalidOperation = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataInvalidOperation) + ErrLoadDataLocalUnsupportedOption = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataLocalUnsupportedOption) + ErrLoadDataPreCheckFailed = dbterror.ClassExecutor.NewStd(errno.ErrLoadDataPreCheckFailed) ) diff --git a/pkg/util/dbterror/plannererrors/errors_test.go b/pkg/util/dbterror/plannererrors/errors_test.go index 1124b2af22a5b..57ccd46849cd9 100644 --- a/pkg/util/dbterror/plannererrors/errors_test.go +++ b/pkg/util/dbterror/plannererrors/errors_test.go @@ -17,7 +17,7 @@ package plannererrors import ( "testing" - "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/stretchr/testify/require" ) @@ -86,6 +86,6 @@ func TestError(t *testing.T) { } for _, err := range kvErrs { code := terror.ToSQLError(err).Code - require.Truef(t, code != mysql.ErrUnknown && code == uint16(err.Code()), "err: %v", err) + require.Truef(t, code != errno.ErrUnknown && code == uint16(err.Code()), "err: %v", err) } } diff --git a/pkg/util/dbterror/plannererrors/planner_terror.go b/pkg/util/dbterror/plannererrors/planner_terror.go index 8bfb79be777da..b75a82bd02bbe 100644 --- a/pkg/util/dbterror/plannererrors/planner_terror.go +++ b/pkg/util/dbterror/plannererrors/planner_terror.go @@ -15,109 +15,109 @@ package plannererrors import ( - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // error definitions. var ( - ErrUnsupportedType = dbterror.ClassOptimizer.NewStd(mysql.ErrUnsupportedType) - ErrAnalyzeMissIndex = dbterror.ClassOptimizer.NewStd(mysql.ErrAnalyzeMissIndex) - ErrAnalyzeMissColumn = dbterror.ClassOptimizer.NewStd(mysql.ErrAnalyzeMissColumn) - ErrWrongParamCount = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongParamCount) - ErrSchemaChanged = dbterror.ClassOptimizer.NewStd(mysql.ErrSchemaChanged) - ErrTablenameNotAllowedHere = dbterror.ClassOptimizer.NewStd(mysql.ErrTablenameNotAllowedHere) - ErrNotSupportedYet = dbterror.ClassOptimizer.NewStd(mysql.ErrNotSupportedYet) - ErrWrongUsage = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongUsage) - ErrUnknown = dbterror.ClassOptimizer.NewStd(mysql.ErrUnknown) - ErrUnknownTable = dbterror.ClassOptimizer.NewStd(mysql.ErrUnknownTable) - ErrNoSuchTable = dbterror.ClassOptimizer.NewStd(mysql.ErrNoSuchTable) - ErrViewRecursive = dbterror.ClassOptimizer.NewStd(mysql.ErrViewRecursive) - ErrWrongArguments = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongArguments) - ErrWrongNumberOfColumnsInSelect = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongNumberOfColumnsInSelect) - ErrBadGeneratedColumn = dbterror.ClassOptimizer.NewStd(mysql.ErrBadGeneratedColumn) - ErrFieldNotInGroupBy = dbterror.ClassOptimizer.NewStd(mysql.ErrFieldNotInGroupBy) - ErrAggregateOrderNonAggQuery = dbterror.ClassOptimizer.NewStd(mysql.ErrAggregateOrderNonAggQuery) - ErrFieldInOrderNotSelect = dbterror.ClassOptimizer.NewStd(mysql.ErrFieldInOrderNotSelect) - ErrAggregateInOrderNotSelect = dbterror.ClassOptimizer.NewStd(mysql.ErrAggregateInOrderNotSelect) - ErrBadTable = dbterror.ClassOptimizer.NewStd(mysql.ErrBadTable) - ErrKeyDoesNotExist = dbterror.ClassOptimizer.NewStd(mysql.ErrKeyDoesNotExist) - ErrOperandColumns = dbterror.ClassOptimizer.NewStd(mysql.ErrOperandColumns) - ErrInvalidGroupFuncUse = dbterror.ClassOptimizer.NewStd(mysql.ErrInvalidGroupFuncUse) - ErrIllegalReference = dbterror.ClassOptimizer.NewStd(mysql.ErrIllegalReference) - ErrNoDB = dbterror.ClassOptimizer.NewStd(mysql.ErrNoDB) - ErrUnknownExplainFormat = dbterror.ClassOptimizer.NewStd(mysql.ErrUnknownExplainFormat) - ErrWrongGroupField = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongGroupField) - ErrDupFieldName = dbterror.ClassOptimizer.NewStd(mysql.ErrDupFieldName) - ErrNonUpdatableTable = dbterror.ClassOptimizer.NewStd(mysql.ErrNonUpdatableTable) - ErrMultiUpdateKeyConflict = dbterror.ClassOptimizer.NewStd(mysql.ErrMultiUpdateKeyConflict) - ErrInternal = dbterror.ClassOptimizer.NewStd(mysql.ErrInternal) - ErrNonUniqTable = dbterror.ClassOptimizer.NewStd(mysql.ErrNonuniqTable) - ErrWindowInvalidWindowFuncUse = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowInvalidWindowFuncUse) - ErrWindowInvalidWindowFuncAliasUse = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowInvalidWindowFuncAliasUse) - ErrWindowNoSuchWindow = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowNoSuchWindow) - ErrWindowCircularityInWindowGraph = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowCircularityInWindowGraph) - ErrWindowNoChildPartitioning = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowNoChildPartitioning) - ErrWindowNoInherentFrame = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowNoInherentFrame) - ErrWindowNoRedefineOrderBy = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowNoRedefineOrderBy) - ErrWindowDuplicateName = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowDuplicateName) - ErrPartitionClauseOnNonpartitioned = dbterror.ClassOptimizer.NewStd(mysql.ErrPartitionClauseOnNonpartitioned) - ErrWindowFrameStartIllegal = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowFrameStartIllegal) - ErrWindowFrameEndIllegal = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowFrameEndIllegal) - ErrWindowFrameIllegal = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowFrameIllegal) - ErrWindowRangeFrameOrderType = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowRangeFrameOrderType) - ErrWindowRangeFrameTemporalType = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowRangeFrameTemporalType) - ErrWindowRangeFrameNumericType = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowRangeFrameNumericType) - ErrWindowRangeBoundNotConstant = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowRangeBoundNotConstant) - ErrWindowRowsIntervalUse = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowRowsIntervalUse) - ErrWindowFunctionIgnoresFrame = dbterror.ClassOptimizer.NewStd(mysql.ErrWindowFunctionIgnoresFrame) - ErrInvalidNumberOfArgs = dbterror.ClassOptimizer.NewStd(mysql.ErrInvalidNumberOfArgs) - ErrFieldInGroupingNotGroupBy = dbterror.ClassOptimizer.NewStd(mysql.ErrFieldInGroupingNotGroupBy) - ErrUnsupportedOnGeneratedColumn = dbterror.ClassOptimizer.NewStd(mysql.ErrUnsupportedOnGeneratedColumn) - ErrPrivilegeCheckFail = dbterror.ClassOptimizer.NewStd(mysql.ErrPrivilegeCheckFail) - ErrInvalidWildCard = dbterror.ClassOptimizer.NewStd(mysql.ErrInvalidWildCard) - ErrMixOfGroupFuncAndFields = dbterror.ClassOptimizer.NewStd(mysql.ErrMixOfGroupFuncAndFieldsIncompatible) - ErrTooBigPrecision = dbterror.ClassExpression.NewStd(mysql.ErrTooBigPrecision) - ErrDBaccessDenied = dbterror.ClassOptimizer.NewStd(mysql.ErrDBaccessDenied) - ErrTableaccessDenied = dbterror.ClassOptimizer.NewStd(mysql.ErrTableaccessDenied) - ErrSpecificAccessDenied = dbterror.ClassOptimizer.NewStd(mysql.ErrSpecificAccessDenied) - ErrViewNoExplain = dbterror.ClassOptimizer.NewStd(mysql.ErrViewNoExplain) - ErrWrongValueCountOnRow = dbterror.ClassOptimizer.NewStd(mysql.ErrWrongValueCountOnRow) - ErrViewInvalid = dbterror.ClassOptimizer.NewStd(mysql.ErrViewInvalid) - ErrNoSuchThread = dbterror.ClassOptimizer.NewStd(mysql.ErrNoSuchThread) - ErrUnknownColumn = dbterror.ClassOptimizer.NewStd(mysql.ErrBadField) - ErrCartesianProductUnsupported = dbterror.ClassOptimizer.NewStd(mysql.ErrCartesianProductUnsupported) - ErrStmtNotFound = dbterror.ClassOptimizer.NewStd(mysql.ErrPreparedStmtNotFound) - ErrAmbiguous = dbterror.ClassOptimizer.NewStd(mysql.ErrNonUniq) - ErrUnresolvedHintName = dbterror.ClassOptimizer.NewStd(mysql.ErrUnresolvedHintName) - ErrNotHintUpdatable = dbterror.ClassOptimizer.NewStd(mysql.ErrNotHintUpdatable) - ErrWarnConflictingHint = dbterror.ClassOptimizer.NewStd(mysql.ErrWarnConflictingHint) - ErrCTERecursiveRequiresUnion = dbterror.ClassOptimizer.NewStd(mysql.ErrCTERecursiveRequiresUnion) - ErrCTERecursiveRequiresNonRecursiveFirst = dbterror.ClassOptimizer.NewStd(mysql.ErrCTERecursiveRequiresNonRecursiveFirst) - ErrCTERecursiveForbidsAggregation = dbterror.ClassOptimizer.NewStd(mysql.ErrCTERecursiveForbidsAggregation) - ErrCTERecursiveForbiddenJoinOrder = dbterror.ClassOptimizer.NewStd(mysql.ErrCTERecursiveForbiddenJoinOrder) - ErrInvalidRequiresSingleReference = dbterror.ClassOptimizer.NewStd(mysql.ErrInvalidRequiresSingleReference) - ErrSQLInReadOnlyMode = dbterror.ClassOptimizer.NewStd(mysql.ErrReadOnlyMode) - ErrDeleteNotFoundColumn = dbterror.ClassOptimizer.NewStd(mysql.ErrDeleteNotFoundColumn) + ErrUnsupportedType = dbterror.ClassOptimizer.NewStd(errno.ErrUnsupportedType) + ErrAnalyzeMissIndex = dbterror.ClassOptimizer.NewStd(errno.ErrAnalyzeMissIndex) + ErrAnalyzeMissColumn = dbterror.ClassOptimizer.NewStd(errno.ErrAnalyzeMissColumn) + ErrWrongParamCount = dbterror.ClassOptimizer.NewStd(errno.ErrWrongParamCount) + ErrSchemaChanged = dbterror.ClassOptimizer.NewStd(errno.ErrSchemaChanged) + ErrTablenameNotAllowedHere = dbterror.ClassOptimizer.NewStd(errno.ErrTablenameNotAllowedHere) + ErrNotSupportedYet = dbterror.ClassOptimizer.NewStd(errno.ErrNotSupportedYet) + ErrWrongUsage = dbterror.ClassOptimizer.NewStd(errno.ErrWrongUsage) + ErrUnknown = dbterror.ClassOptimizer.NewStd(errno.ErrUnknown) + ErrUnknownTable = dbterror.ClassOptimizer.NewStd(errno.ErrUnknownTable) + ErrNoSuchTable = dbterror.ClassOptimizer.NewStd(errno.ErrNoSuchTable) + ErrViewRecursive = dbterror.ClassOptimizer.NewStd(errno.ErrViewRecursive) + ErrWrongArguments = dbterror.ClassOptimizer.NewStd(errno.ErrWrongArguments) + ErrWrongNumberOfColumnsInSelect = dbterror.ClassOptimizer.NewStd(errno.ErrWrongNumberOfColumnsInSelect) + ErrBadGeneratedColumn = dbterror.ClassOptimizer.NewStd(errno.ErrBadGeneratedColumn) + ErrFieldNotInGroupBy = dbterror.ClassOptimizer.NewStd(errno.ErrFieldNotInGroupBy) + ErrAggregateOrderNonAggQuery = dbterror.ClassOptimizer.NewStd(errno.ErrAggregateOrderNonAggQuery) + ErrFieldInOrderNotSelect = dbterror.ClassOptimizer.NewStd(errno.ErrFieldInOrderNotSelect) + ErrAggregateInOrderNotSelect = dbterror.ClassOptimizer.NewStd(errno.ErrAggregateInOrderNotSelect) + ErrBadTable = dbterror.ClassOptimizer.NewStd(errno.ErrBadTable) + ErrKeyDoesNotExist = dbterror.ClassOptimizer.NewStd(errno.ErrKeyDoesNotExist) + ErrOperandColumns = dbterror.ClassOptimizer.NewStd(errno.ErrOperandColumns) + ErrInvalidGroupFuncUse = dbterror.ClassOptimizer.NewStd(errno.ErrInvalidGroupFuncUse) + ErrIllegalReference = dbterror.ClassOptimizer.NewStd(errno.ErrIllegalReference) + ErrNoDB = dbterror.ClassOptimizer.NewStd(errno.ErrNoDB) + ErrUnknownExplainFormat = dbterror.ClassOptimizer.NewStd(errno.ErrUnknownExplainFormat) + ErrWrongGroupField = dbterror.ClassOptimizer.NewStd(errno.ErrWrongGroupField) + ErrDupFieldName = dbterror.ClassOptimizer.NewStd(errno.ErrDupFieldName) + ErrNonUpdatableTable = dbterror.ClassOptimizer.NewStd(errno.ErrNonUpdatableTable) + ErrMultiUpdateKeyConflict = dbterror.ClassOptimizer.NewStd(errno.ErrMultiUpdateKeyConflict) + ErrInternal = dbterror.ClassOptimizer.NewStd(errno.ErrInternal) + ErrNonUniqTable = dbterror.ClassOptimizer.NewStd(errno.ErrNonuniqTable) + ErrWindowInvalidWindowFuncUse = dbterror.ClassOptimizer.NewStd(errno.ErrWindowInvalidWindowFuncUse) + ErrWindowInvalidWindowFuncAliasUse = dbterror.ClassOptimizer.NewStd(errno.ErrWindowInvalidWindowFuncAliasUse) + ErrWindowNoSuchWindow = dbterror.ClassOptimizer.NewStd(errno.ErrWindowNoSuchWindow) + ErrWindowCircularityInWindowGraph = dbterror.ClassOptimizer.NewStd(errno.ErrWindowCircularityInWindowGraph) + ErrWindowNoChildPartitioning = dbterror.ClassOptimizer.NewStd(errno.ErrWindowNoChildPartitioning) + ErrWindowNoInherentFrame = dbterror.ClassOptimizer.NewStd(errno.ErrWindowNoInherentFrame) + ErrWindowNoRedefineOrderBy = dbterror.ClassOptimizer.NewStd(errno.ErrWindowNoRedefineOrderBy) + ErrWindowDuplicateName = dbterror.ClassOptimizer.NewStd(errno.ErrWindowDuplicateName) + ErrPartitionClauseOnNonpartitioned = dbterror.ClassOptimizer.NewStd(errno.ErrPartitionClauseOnNonpartitioned) + ErrWindowFrameStartIllegal = dbterror.ClassOptimizer.NewStd(errno.ErrWindowFrameStartIllegal) + ErrWindowFrameEndIllegal = dbterror.ClassOptimizer.NewStd(errno.ErrWindowFrameEndIllegal) + ErrWindowFrameIllegal = dbterror.ClassOptimizer.NewStd(errno.ErrWindowFrameIllegal) + ErrWindowRangeFrameOrderType = dbterror.ClassOptimizer.NewStd(errno.ErrWindowRangeFrameOrderType) + ErrWindowRangeFrameTemporalType = dbterror.ClassOptimizer.NewStd(errno.ErrWindowRangeFrameTemporalType) + ErrWindowRangeFrameNumericType = dbterror.ClassOptimizer.NewStd(errno.ErrWindowRangeFrameNumericType) + ErrWindowRangeBoundNotConstant = dbterror.ClassOptimizer.NewStd(errno.ErrWindowRangeBoundNotConstant) + ErrWindowRowsIntervalUse = dbterror.ClassOptimizer.NewStd(errno.ErrWindowRowsIntervalUse) + ErrWindowFunctionIgnoresFrame = dbterror.ClassOptimizer.NewStd(errno.ErrWindowFunctionIgnoresFrame) + ErrInvalidNumberOfArgs = dbterror.ClassOptimizer.NewStd(errno.ErrInvalidNumberOfArgs) + ErrFieldInGroupingNotGroupBy = dbterror.ClassOptimizer.NewStd(errno.ErrFieldInGroupingNotGroupBy) + ErrUnsupportedOnGeneratedColumn = dbterror.ClassOptimizer.NewStd(errno.ErrUnsupportedOnGeneratedColumn) + ErrPrivilegeCheckFail = dbterror.ClassOptimizer.NewStd(errno.ErrPrivilegeCheckFail) + ErrInvalidWildCard = dbterror.ClassOptimizer.NewStd(errno.ErrInvalidWildCard) + ErrMixOfGroupFuncAndFields = dbterror.ClassOptimizer.NewStd(errno.ErrMixOfGroupFuncAndFieldsIncompatible) + ErrTooBigPrecision = dbterror.ClassExpression.NewStd(errno.ErrTooBigPrecision) + ErrDBaccessDenied = dbterror.ClassOptimizer.NewStd(errno.ErrDBaccessDenied) + ErrTableaccessDenied = dbterror.ClassOptimizer.NewStd(errno.ErrTableaccessDenied) + ErrSpecificAccessDenied = dbterror.ClassOptimizer.NewStd(errno.ErrSpecificAccessDenied) + ErrViewNoExplain = dbterror.ClassOptimizer.NewStd(errno.ErrViewNoExplain) + ErrWrongValueCountOnRow = dbterror.ClassOptimizer.NewStd(errno.ErrWrongValueCountOnRow) + ErrViewInvalid = dbterror.ClassOptimizer.NewStd(errno.ErrViewInvalid) + ErrNoSuchThread = dbterror.ClassOptimizer.NewStd(errno.ErrNoSuchThread) + ErrUnknownColumn = dbterror.ClassOptimizer.NewStd(errno.ErrBadField) + ErrCartesianProductUnsupported = dbterror.ClassOptimizer.NewStd(errno.ErrCartesianProductUnsupported) + ErrStmtNotFound = dbterror.ClassOptimizer.NewStd(errno.ErrPreparedStmtNotFound) + ErrAmbiguous = dbterror.ClassOptimizer.NewStd(errno.ErrNonUniq) + ErrUnresolvedHintName = dbterror.ClassOptimizer.NewStd(errno.ErrUnresolvedHintName) + ErrNotHintUpdatable = dbterror.ClassOptimizer.NewStd(errno.ErrNotHintUpdatable) + ErrWarnConflictingHint = dbterror.ClassOptimizer.NewStd(errno.ErrWarnConflictingHint) + ErrCTERecursiveRequiresUnion = dbterror.ClassOptimizer.NewStd(errno.ErrCTERecursiveRequiresUnion) + ErrCTERecursiveRequiresNonRecursiveFirst = dbterror.ClassOptimizer.NewStd(errno.ErrCTERecursiveRequiresNonRecursiveFirst) + ErrCTERecursiveForbidsAggregation = dbterror.ClassOptimizer.NewStd(errno.ErrCTERecursiveForbidsAggregation) + ErrCTERecursiveForbiddenJoinOrder = dbterror.ClassOptimizer.NewStd(errno.ErrCTERecursiveForbiddenJoinOrder) + ErrInvalidRequiresSingleReference = dbterror.ClassOptimizer.NewStd(errno.ErrInvalidRequiresSingleReference) + ErrSQLInReadOnlyMode = dbterror.ClassOptimizer.NewStd(errno.ErrReadOnlyMode) + ErrDeleteNotFoundColumn = dbterror.ClassOptimizer.NewStd(errno.ErrDeleteNotFoundColumn) // Since we cannot know if user logged in with a password, use message of ErrAccessDeniedNoPassword instead - ErrAccessDenied = dbterror.ClassOptimizer.NewStdErr(mysql.ErrAccessDenied, mysql.MySQLErrName[mysql.ErrAccessDeniedNoPassword]) - ErrBadNull = dbterror.ClassOptimizer.NewStd(mysql.ErrBadNull) - ErrNotSupportedWithSem = dbterror.ClassOptimizer.NewStd(mysql.ErrNotSupportedWithSem) - ErrAsOf = dbterror.ClassOptimizer.NewStd(mysql.ErrAsOf) - ErrOptOnTemporaryTable = dbterror.ClassOptimizer.NewStd(mysql.ErrOptOnTemporaryTable) - ErrOptOnCacheTable = dbterror.ClassOptimizer.NewStd(mysql.ErrOptOnCacheTable) - ErrDropTableOnTemporaryTable = dbterror.ClassOptimizer.NewStd(mysql.ErrDropTableOnTemporaryTable) + ErrAccessDenied = dbterror.ClassOptimizer.NewStdErr(errno.ErrAccessDenied, errno.MySQLErrName[errno.ErrAccessDeniedNoPassword]) + ErrBadNull = dbterror.ClassOptimizer.NewStd(errno.ErrBadNull) + ErrNotSupportedWithSem = dbterror.ClassOptimizer.NewStd(errno.ErrNotSupportedWithSem) + ErrAsOf = dbterror.ClassOptimizer.NewStd(errno.ErrAsOf) + ErrOptOnTemporaryTable = dbterror.ClassOptimizer.NewStd(errno.ErrOptOnTemporaryTable) + ErrOptOnCacheTable = dbterror.ClassOptimizer.NewStd(errno.ErrOptOnCacheTable) + ErrDropTableOnTemporaryTable = dbterror.ClassOptimizer.NewStd(errno.ErrDropTableOnTemporaryTable) // ErrPartitionNoTemporary returns when partition at temporary mode - ErrPartitionNoTemporary = dbterror.ClassOptimizer.NewStd(mysql.ErrPartitionNoTemporary) - ErrViewSelectTemporaryTable = dbterror.ClassOptimizer.NewStd(mysql.ErrViewSelectTmptable) - ErrSubqueryMoreThan1Row = dbterror.ClassOptimizer.NewStd(mysql.ErrSubqueryNo1Row) - ErrKeyPart0 = dbterror.ClassOptimizer.NewStd(mysql.ErrKeyPart0) - ErrGettingNoopVariable = dbterror.ClassOptimizer.NewStd(mysql.ErrGettingNoopVariable) + ErrPartitionNoTemporary = dbterror.ClassOptimizer.NewStd(errno.ErrPartitionNoTemporary) + ErrViewSelectTemporaryTable = dbterror.ClassOptimizer.NewStd(errno.ErrViewSelectTmptable) + ErrSubqueryMoreThan1Row = dbterror.ClassOptimizer.NewStd(errno.ErrSubqueryNo1Row) + ErrKeyPart0 = dbterror.ClassOptimizer.NewStd(errno.ErrKeyPart0) + ErrGettingNoopVariable = dbterror.ClassOptimizer.NewStd(errno.ErrGettingNoopVariable) - ErrPrepareMulti = dbterror.ClassExecutor.NewStd(mysql.ErrPrepareMulti) - ErrUnsupportedPs = dbterror.ClassExecutor.NewStd(mysql.ErrUnsupportedPs) - ErrPsManyParam = dbterror.ClassExecutor.NewStd(mysql.ErrPsManyParam) - ErrPrepareDDL = dbterror.ClassExecutor.NewStd(mysql.ErrPrepareDDL) - ErrRowIsReferenced2 = dbterror.ClassOptimizer.NewStd(mysql.ErrRowIsReferenced2) - ErrNoReferencedRow2 = dbterror.ClassOptimizer.NewStd(mysql.ErrNoReferencedRow2) + ErrPrepareMulti = dbterror.ClassExecutor.NewStd(errno.ErrPrepareMulti) + ErrUnsupportedPs = dbterror.ClassExecutor.NewStd(errno.ErrUnsupportedPs) + ErrPsManyParam = dbterror.ClassExecutor.NewStd(errno.ErrPsManyParam) + ErrPrepareDDL = dbterror.ClassExecutor.NewStd(errno.ErrPrepareDDL) + ErrRowIsReferenced2 = dbterror.ClassOptimizer.NewStd(errno.ErrRowIsReferenced2) + ErrNoReferencedRow2 = dbterror.ClassOptimizer.NewStd(errno.ErrNoReferencedRow2) ) diff --git a/pkg/util/hint/hint.go b/pkg/util/hint/hint.go index 88c40c7042b6c..495eacb17e13e 100644 --- a/pkg/util/hint/hint.go +++ b/pkg/util/hint/hint.go @@ -21,7 +21,7 @@ import ( "strings" "github.com/pingcap/errors" - mysql "github.com/pingcap/tidb/pkg/errno" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/meta/model" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/format" @@ -1130,4 +1130,4 @@ func collectUnmatchedStorageHintWarning(tiflashTables, tikvTables []HintedTable) } // ErrWarnConflictingHint is a warning error. -var ErrWarnConflictingHint = dbterror.ClassOptimizer.NewStd(mysql.ErrWarnConflictingHint) +var ErrWarnConflictingHint = dbterror.ClassOptimizer.NewStd(errno.ErrWarnConflictingHint) diff --git a/pkg/util/timeutil/BUILD.bazel b/pkg/util/timeutil/BUILD.bazel index a0f51bea94e03..1d7bb149677f8 100644 --- a/pkg/util/timeutil/BUILD.bazel +++ b/pkg/util/timeutil/BUILD.bazel @@ -10,7 +10,7 @@ go_library( importpath = "github.com/pingcap/tidb/pkg/util/timeutil", visibility = ["//visibility:public"], deps = [ - "//pkg/parser/mysql", + "//pkg/errno", "//pkg/types", "//pkg/util/dbterror", "//pkg/util/logutil", diff --git a/pkg/util/timeutil/errors.go b/pkg/util/timeutil/errors.go index 7d3f2a86f8a95..06234358cf523 100644 --- a/pkg/util/timeutil/errors.go +++ b/pkg/util/timeutil/errors.go @@ -15,9 +15,9 @@ package timeutil import ( - "github.com/pingcap/tidb/pkg/parser/mysql" + "github.com/pingcap/tidb/pkg/errno" "github.com/pingcap/tidb/pkg/util/dbterror" ) // ErrUnknownTimeZone indicates timezone is unknown. -var ErrUnknownTimeZone = dbterror.ClassVariable.NewStd(mysql.ErrUnknownTimeZone) +var ErrUnknownTimeZone = dbterror.ClassVariable.NewStd(errno.ErrUnknownTimeZone) diff --git a/tests/realtikvtest/pessimistictest/pessimistic_test.go b/tests/realtikvtest/pessimistictest/pessimistic_test.go index d4bb4bcb94b0a..e11ee4fd60e51 100644 --- a/tests/realtikvtest/pessimistictest/pessimistic_test.go +++ b/tests/realtikvtest/pessimistictest/pessimistic_test.go @@ -34,7 +34,6 @@ import ( "github.com/pingcap/tidb/pkg/parser" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/parser/auth" - "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/parser/terror" "github.com/pingcap/tidb/pkg/session" "github.com/pingcap/tidb/pkg/sessionctx/variable" @@ -243,7 +242,7 @@ func TestDeadlock(t *testing.T) { } e, ok := errors.Cause(err).(*terror.Error) require.True(t, ok) - require.Equal(t, mysql.ErrLockDeadlock, int(e.Code())) + require.Equal(t, errno.ErrLockDeadlock, int(e.Code())) _, digest := parser.NormalizeDigest("update deadlock set v = v + 1 where k = 1") @@ -3326,7 +3325,7 @@ func TestIssue40114(t *testing.T) { // tk2 block tk on row 2. tk2.MustExec("update t set v = v + 1 where id = 2") // tk wait until timeout. - tk.MustGetErrCode("delete from t where id = 1 or id = 2", mysql.ErrLockWaitTimeout) + tk.MustGetErrCode("delete from t where id = 1 or id = 2", errno.ErrLockWaitTimeout) tk2.MustExec("commit") // Now, row 1 should have been successfully locked since it's not in the same batch with row 2 (controlled by // failpoint `twoPCRequestBatchSizeLimit`); then it's not pessimisticRollback-ed (controlled by failpoint @@ -3334,13 +3333,13 @@ func TestIssue40114(t *testing.T) { // Ensure the row is still locked. time.Sleep(time.Millisecond * 50) tk2.MustExec("begin pessimistic") - tk2.MustGetErrCode("select * from t where id = 1 for update nowait", mysql.ErrLockAcquireFailAndNoWaitSet) + tk2.MustGetErrCode("select * from t where id = 1 for update nowait", errno.ErrLockAcquireFailAndNoWaitSet) tk2.MustExec("rollback") // tk is still in transaction. tk.MustQuery("select @@tidb_current_ts = 0").Check(testkit.Rows("0")) // This will unexpectedly succeed in issue 40114. - tk.MustGetErrCode("insert into t values (1, 2)", mysql.ErrDupEntry) + tk.MustGetErrCode("insert into t values (1, 2)", errno.ErrDupEntry) tk.MustExec("commit") tk.MustExec("admin check table t") tk.MustQuery("select * from t").Check(testkit.Rows("1 1", "2 3"))