SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,在 SQL 执行错误时返回给客户端。

目前内容为草稿,错误码仍可能调整。

内核异常

元数据

Vendor CodeSQL State错误信息
1000042S02Database is required.
1000142S02Schema ‘%s’ does not exist.
1000242S02Table or view ‘%s’ does not exist.
1000342S02Unknown column ‘%s’ in ‘%s’.
10010HY000Rule and storage meta data mismatched, reason is: %s.
10100HY000Can not %s storage units ‘%s’.
1010142S02There is no storage unit in database ‘%s’.
1010244000Storage units ‘%s’ do not exist in database ‘%s’.
1010344000Storage unit ‘%s’ still used by ‘%s’.
1010442S01Duplicate storage unit names ‘%s’.
1011008000Storage units can not connect, error messages are: %s.
101110A000Can not alter connection info in storage units: ‘%s’.
1012044000Invalid storage unit status, error message is: %s.
1020044000Invalid ‘%s’ rule ‘%s’, error message is: %s
1020142S02There is no rule in database ‘%s’.
1020242S02%s rules ‘%s’ do not exist in database ‘%s’.
1020344000%s rules ‘%s’ in database ‘%s’ are still in used.
1020442S01Duplicate %s rule names ‘%s’ in database ‘%s’.
1021042S02%s strategies ‘%s’ do not exist.
10300HY000Invalid format for actual data node ‘%s’.
103010A000Can not support 3-tier structure for actual data node ‘%s’ with JDBC ‘%s’.
1040044000Algorithm ‘%s.’%s’ initialization failed, reason is: %s.
1040142S02‘%s’ algorithm on %s is required.
1040242S02‘%s’ algorithm ‘%s’ on %s is unregistered.
1040344000%s algorithms ‘%s’ in database ‘%s’ are still in used.
1040444000Invalid %s algorithm configuration ‘%s’.
104100A000Unsupported %s.%s with database type ‘%s’.
10440HY000Algorithm ‘%s.%s’ execute failed, reason is: %s.
1050044000Invalid single rule configuration, reason is: %s.
1050142S02Single table ‘%s’ does not exist.
10502HY000Can not load table with database name ‘%s’ and data source name ‘%s’, reason is: %s
105030A000Can not drop schema ‘%s’ because of contains tables.

数据

Vendor CodeSQL State错误信息
11000HY004Unsupported conversion data type ‘%s’ for value ‘%s’.
11001HY004Unsupported conversion stream charset ‘%s’.

语法

Vendor CodeSQL State错误信息
1200042000SQL String can not be NULL or empty.
1201044000Can not support variable ‘%s’.
12011HY004Invalid variable value ‘%s’.
12020HV008Column index ‘%d’ is out of range.
1202142S02Can not find column label ‘%s’.
12022HY000Column ‘%s’ in %s is ambiguous.
1210042000You have an error in your SQL syntax: %s
1210142000Can not accept SQL type ‘%s’.
1220042000Hint data source ‘%s’ does not exist.
123000A000DROP TABLE … CASCADE is not supported.

连接

Vendor CodeSQL State错误信息
1300008000Can not get %d connections one time, partition succeed connection(%d) have released. Please consider increasing the ‘maxPoolSize’ of the data sources or decreasing the ‘max-connections-size-per-query’ in properties.
1300108000SQL execution has been interrupted.
1301001000Circuit break open, the request has been ignored.
131000A000Unsupported storage type of URL ‘%s’.
1310108000The URL ‘%s’ is not recognized, please refer to the pattern ‘%s’.
1320008000Can not register driver.
1320108000Connection has been closed.
1320208000Result set has been closed.
13400HY000Load datetime from database failed, reason: %s

事务

Vendor CodeSQL State错误信息
1400025000Switch transaction type failed, please terminate the current transaction.
1400142S02Can not find transaction manager of ‘%s’.
1400244000Max length of unique resource name ‘%s’ exceeded, should be less than 45.
1400325000Transaction timeout should more than 0.
1400425000Close transaction manager failed.
1420025000Failed to create ‘%s’ XA data source.
1420125000Can not start new XA transaction in a active transaction.
1420225000Check XA transaction privileges failed on data source, please grant ‘%s’ to current user.
1440044000No application id within ‘seata.conf’ file.
1440125000Seata-AT transaction has been disabled.

集群

Vendor CodeSQL State错误信息
1700044000Mode must be ‘cluster’.
17001HY000Work ID assigned failed, which can not exceed 1024.
17010HY000Cluster persist repository error, reason is: %s
17020HY000The cluster status is %s, can not support SQL statement ‘%s’.

数据管道

Vendor CodeSQL State错误信息
1800022023There is invalid parameter value ‘%s’.
1810042S02Target database ‘%s’ does not exist.
1810142S02Can not find pipeline job ‘%s’.
1810244000Sharding count of job ‘%s’ is 0.
1810342S02Can not get meta data for table ‘%s’ when split by range.
18104HY000Can not split by unique key ‘%s’ for table ‘%s’.
18105HY000Target table ‘%s’ is not empty.
1810601007Source data source lacks ‘%s’ privilege(s).
18107HY000Source data source required ‘%s = %s’, now is ‘%s’.
1810842S02User ‘%s’ does exist.
1810908000Check privileges failed on source data source.
18110HY000Importer job write data failed.
1811108000Get binlog position failed by job ‘%s’.
18112HY000Can not find consistency check job of ‘%s’.
18113HY000Uncompleted consistency check job ‘%s’ exists, progress ‘%s’.
18114HY000Failed to get DDL for table ‘%s’.
18200HY000Before data record is ‘%s’, after data record is ‘%s’.
1820108000Data check table ‘%s’ failed.
182020A000Unsupported pipeline database type ‘%s’.
1840042S02Can not find stream data source table.
1840142S02Database ‘%s’ does not exist.
1841042S02CDC Login request body is empty.
1841108004Illegal username or password.

功能异常

数据分片

Vendor CodeSQL State错误信息
2000042S02%s configuration does not exist in database ‘%s’.
2000142S02Can not find table rule with logic tables ‘%s’.
2000242S02Can not find data source in sharding rule, invalid actual data node ‘%s’.
2000342S02Data nodes is required for sharding table ‘%s’.
2000442S02Actual table ‘%s.%s’ is not in table rule configuration.
2000542S02Can not find binding actual table, data source is ‘%s’, logic table is ‘%s’, other actual table is ‘%s’.
2000644000Actual tables ‘%s’ are in use.
2000742S01Index ‘%s’ already exists.
2000842S02Index ‘%s’ does not exist.
2000942S01View name has to bind to %s tables.
2001044000Invalid binding table configuration.
2001144000Only allowed 0 or 1 sharding strategy configuration.
2001242S01Same actual data node cannot be configured in multiple logic tables in same database, logical table ‘%s’, actual data node ‘%s.%s’.
2002044000Sharding value can not be null in SQL statement.
20021HY004Found different types for sharding value ‘%s’.
20022HY004Invalid %s, datetime pattern should be ‘%s’, value is ‘%s’.
2002344000Sharding value %s subtract stop offset %d can not be less than start offset %d.
2002444000%s value ‘%s’ must implements Comparable.
200300A000Can not support operation ‘%s’ with sharding table ‘%s’.
2003144000Can not update sharding value for table ‘%s’.
200320A000The CREATE VIEW statement contains unsupported query statement.
2003344000PREPARE statement can not support sharding tables route to same data sources.
2003444000The table inserted and the table selected must be the same or bind tables.
200350A000Can not support DML operation with multiple tables ‘%s’.
2003642000%s … LIMIT can not support route to multiple data nodes.
2003744000Can not find actual data source intersection for logic tables ‘%s’.
2003842000INSERT INTO … SELECT can not support applying key generator with absent generate key column.
200390A000Alter view rename .. to .. statement should have same config for ‘%s’ and ‘%s’.
20040HY000‘%s %s’ can not route correctly for %s ‘%s’.
2004142S02Can not get route result, please check your sharding rule configuration.
2004234000Can not get cursor name from fetch statement.
20050HY000Sharding algorithm class ‘%s’ should be implement ‘%s’.
20051HY000Routed target ‘%s’ does not exist, available targets are ‘%s’.
2005244000Inline sharding algorithms expression ‘%s’ and sharding column ‘%s’ do not match.
2005344000Complex inline algorithm need %d sharing columns, but only found %d.
2005444000No sharding database route info.
2005544000Some routed data sources do not belong to configured data sources. routed data sources ‘%s’, configured data sources ‘%s’.
2005644000Please check your sharding conditions ‘%s’ to avoid same record in table ‘%s’ routing to multiple data nodes.
2005744000Can not find routing table factor, data source ‘%s’, actual table ‘%s’.
20060HY000Invalid %s strategy ‘%s’, strategy does not match data nodes.
2009042000Not allow DML operation without sharding conditions.

联邦查询

Vendor CodeSQL State错误信息
2010042000Unsupported SQL node conversion for SQL statement ‘%s’.
2010142000SQL federation does not support SQL ‘%s’.

读写分离

Vendor CodeSQL State错误信息
2020042S02Readwrite-splitting data source rule name is required in database ‘%s’.
2020142S02Readwrite-splitting [READ/WRITE] data source is required in %s.
2020242S02Can not find readwrite-splitting [READ/WRITE] data source ‘%s’ in %s.
2020342S01Readwrite-splitting [READ/WRITE] data source ‘%s’ is duplicated in %s.
2020444000Readwrite-splitting [READ/WRITE] data source inline expression error in %s.

SQL 方言转换

Vendor CodeSQL State错误信息
204000A000Can not support database ‘%s’ in SQL translation.

流量治理

Vendor CodeSQL State错误信息
2050042S02Can not get traffic execution unit.

数据加密

Vendor CodeSQL State错误信息
2100042S02%s column is required in %s.
2100142S02Can not find encrypt table ‘%s’.
2100242S02Can not find logic encrypt column by ‘%s’.
2100342S02Can not find encrypt column ‘%s’ from table ‘%s’.
21004HY000‘%s’ column’s encrypt algorithm ‘%s’ should support %s in database ‘%s’.
2101044000Altered column ‘%s’ must use same encrypt algorithm with previous column ‘%s’ in table ‘%s’.
210200A000The SQL clause ‘%s’ is unsupported in encrypt feature.

影子库

Vendor CodeSQL State错误信息
2200042S02Production data source configuration does not exist in database ‘%s’.
2200142S02Shadow data source configuration does not exist in database ‘%s’.
2200242S02No available shadow data sources mappings in shadow table ‘%s’.
2200344000Default shadow algorithm class should be implement HintShadowAlgorithm.
22010HY004Shadow column ‘%s’ of table ‘%s’ does not support ‘%s’ type.
2202042000Insert value of index ‘%d’ can not support for shadow.

其他异常

Vendor CodeSQL State错误信息
30000HY000Unknown exception: %s
300010A000Unsupported SQL operation: %s
30002HY000Database protocol exception: %s
300030A000Unsupported command: %s
30004HY000Server exception: %s
30010HY000Can not find plugin class ‘%s’.
30020HY000File access failed, file is: %s