SQL error codes provide by standard SQL State, Vendor Code and Reason, which return to client when SQL execute error.

the error codes are draft, still need to be adjusted.

Kernel Exception

Meta data

SQL StateVendor CodeReason
4200010000There is no storage unit in database %s.
0800010001The URL %s is not recognized, please refer to the pattern %s.
4200010002Can not support 3-tier structure for actual data node %s with JDBC %s.
HY00410003Invalid format for actual data node %s.
4200010004Unsupported SQL node conversion for SQL statement %s.
4200010010Rule does not exist.
42S0210020Schema %s does not exist.
42S0210021Single table %s does not exist.
HY00010022Can not load table with database name %s and data source name %s.
0A00010030Can not drop schema %s because of contains tables.

Data

SQL StateVendor CodeReason
HY00411000Invalid value %s.
HY00411001Unsupported conversion data type %s for value %s.
HY00411010Unsupported conversion stream charset %s.

Syntax

SQL StateVendor CodeReason
4200012000You have an error in your SQL syntax: %s
4200012001Can not accept SQL type %s.
4200012002SQL String can not be NULL or empty.
4200012010Can not support variable %s.
42S0212011Can not find column label %s.
42S0212012Can not find driver url provider for %s. |
HV00812020Column index %d is out of range.
0A00012100DROP TABLE … CASCADE is not supported.

Connection

SQL StateVendor CodeReason
0800013000Can not register driver, reason is: %s
0100013010Circuit break open, the request has been ignored.
0100013011The cluster status is read-only.
0100013012The cluster status is unavailable.
0800013020Can 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.
0800013030Connection has been closed.
0800013031Result set has been closed.
HY00013090Load datetime from database failed, reason: %s

Transaction

SQL StateVendor CodeReason
2500014000Switch transaction type failed, please terminate the current transaction.
2500014001Can not find transaction manager of %s.
2500014002Transaction timeout should more than 0s.
2500014100JDBC does not support operations across multiple logical databases in transaction.
2500014200Can not start new XA transaction in a active transaction.
2500014201Failed to create %s XA data source.
2500014202Max length of xa unique resource name %s exceeded: should be less than 45.
2500014301ShardingSphere Seata-AT transaction has been disabled.
2500014302Please config application id within seata.conf file.

Lock

SQL StateVendor CodeReason
HY00015000The table %s of schema %s is locked.
HY00015001The table %s of schema %s lock wait timeout of %s milliseconds exceeded.

Audit

SQL StateVendor CodeReason
4400016000SQL audit failed, error message: %s.
4400016001Hint datasource: %s is not exist.

Authority

SQL StateVendor CodeReason
4400016500Access denied for operation %s.

Cluster

SQL StateVendor CodeReason
HY00017000Work ID assigned failed, which can not exceed 1024.
HY00017002File access failed, reason is: %s
HY00017010Cluster persist repository error, reason is: %s

Migration

SQL StateVendor CodeReason
42S0218002There is no rule in database %s.
4400018003Mode configuration does not exist.
4400018004Target database name is null. You could define it in DistSQL or select a database.
2202318005There is invalid parameter value: %s.
HY00018020Failed to get DDL for table %s.
42S0118030Duplicate storage unit names %s.
42S0218031Storage units names %s do not exist.
HY00018050Before data record is %s, after data record is %s.
0800018051Data check table %s failed.
0A00018052Unsupported pipeline database type %s.
0A00018053Unsupported CRC32 data consistency calculate algorithm with database type %s.
0A00018054Unsupported mode type %s.
HY00018080Can not find pipeline job %s.
HY00018081Job has already started.
HY00018082Sharding count of job %s is 0.
HY00018083Can not split by range for table %s, reason is: %s
HY00018084Can not split by unique key %s for table %s, reason is: %s
HY00018085Target table %s is not empty.
0100718086Source data source lacks %s privilege(s).
HY00018087Source data source required %s = %s, now is %s.
HY00018088User %s does exist.
0800018089Check privileges failed on source data source, reason is: %s
0800018090Data sources can not connect, reason is: %s
HY00018091Importer job write data failed.
0800018092Get binlog position failed by job %s, reason is: %s
HY00018093Can not poll event because of binlog sync channel already closed.
HY00018095Can not find consistency check job of %s.
HY00018096Uncompleted consistency check job %s exists.
HY00018200Not find stream data source table.

DistSQL

SQL StateVendor CodeReason
4400019000Can not process invalid storage units, error message is: %s
4400019001Storage units %s do not exist in database %s.
4400019002There is no storage unit in the database %s.
4400019003Storage units %s is still used by %s.
4400019004Duplicate storage unit names %s.
4400019100Invalid %s rule %s, error message is: %s
4400019101%s rules %s do not exist in database %s.
4400019102%s rules %s in database %s are still in used.
4400019103%s rule %s has been enabled in database %s.
4400019104%s rule %s has been disabled in database %s.
4400019105Duplicate %s rule names %s in database %s.
4400019150Invalid %s algorithm(s) %s.
4400019151%s algorithm(s) %s do not exist in database %s.
4400019152%s algorithms %s in database %s are still in used.
4400019153Duplicate %s algorithms %s in database %s.

Feature Exception

Data Sharding

SQL StateVendor CodeReason
4400020000Can not find table rule with logic tables %s.
4400020001Can not get uniformed table structure for logic table %s, it has different meta data of actual tables are as follows: %s
42S0220002Can not find data source in sharding rule, invalid actual data node %s.
4400020003Data nodes must be configured for sharding table %s.
4400020004Actual table %s.%s is not in table rule configuration.
4400020005Can not find binding actual table, data source is %s, logic table is %s, other actual table is %s.
4400020006Actual tables %s are in use.
42S0120007Index %s already exists.
42S0220008Index %s does not exist.
42S0120009View name has to bind to %s tables.
4400020010%s algorithm does not exist in database %s.
4400020011%s configuration does not exist in database %s.
4400020012Invalid binding table configuration in ShardingRuleConfiguration.
4400020013Can not find sharding rule.
4400020014Only allowed 0 or 1 sharding strategy configuration.
4400020020Sharding value can’t be null in insert statement.
HY00420021Found different types for sharding value %s.
HY00420022Invalid %s, datetime pattern should be %s, value is %s.
4400020023Sharding value %s subtract stop offset %d can not be less than start offset %d.
4400020024%s value %s must implements Comparable.
0A00020040Can not support operation %s with sharding table %s.
4400020041Can not update sharding value for table %s.
0A00020042The CREATE VIEW statement contains unsupported query statement.
4400020043PREPARE statement can not support sharding tables route to same data sources.
4400020044The table inserted and the table selected must be the same or bind tables.
0A00020045Can not support DML operation with multiple tables %s.
4200020046%s … LIMIT can not support route to multiple data nodes.
4400020047Can not find actual data source intersection for logic tables %s.
4200020048INSERT INTO … SELECT can not support applying key generator with absent generate key column.
0A00020049Alter view rename .. to .. statement should have same config for %s and %s.
HY00020060%s %s can not route correctly for %s %s.
42S0220061Can not get route result, please check your sharding rule configuration.
3400020062Can not get cursor name from fetch statement.
HY00020080Sharding algorithm class %s should be implement %s.
HY00020081Routed target %s does not exist, available targets are %s.
4400020082Inline sharding algorithms expression %s and sharding column %s do not match.
HY00020083Sharding algorithm %s initialization failed, reason is: %s.
4400020084Complex inline algorithm need %d sharing columns, but only found %d.
4400020085No sharding database route info.
4400020086Some routed data sources do not belong to configured data sources. routed data sources: %s, configured data sources: %s.
4400020087Please check your sharding conditions %s to avoid same record in table %s routing to multiple data nodes.
4400020088Cannot found routing table factor, data source: %s, actual table: %s.
4400020090Can not find strategy for generate keys with table %s.
HY00020091Key generate algorithm %s initialization failed, reason is: %s.
HY00020092Clock is moving backwards, last time is %d milliseconds, current time is %d milliseconds.
HY00020099Sharding plugin error, reason is: %s

Readwrite Splitting

SQL StateVendor CodeReason
4400020270Inline expression %s names size error.
HY00420280Invalid read database weight %s.
4400020281Load balancer algorithm %s initialization failed, reason is: %s. |
4400020290Data source name is required in database %s. |
4400020291Write data source name is required in database \%s.|</td></tr><tr><td>44000</td><td>20292</td><td>Read data source names is required in database <code>\</code>%s. |
4400020293Can not config duplicate %s data source %s in database %s. |
42S0220294%s data source name %s not in database %s. |
4400020295Auto aware data source name is required in database %s. |
42S0220296Not found load balance type in database %s. |
4400020297Weight load balancer datasource name config does not match data sources in database %s. |

Database HA

SQL StateVendor CodeReason
4400020300No available database discovery rule configuration in database %s.
4400020301Group name is required.
4400020302Data source names are required.
4400020303Can not found database discovery data source rule in database %s.
HY00020380MGR plugin is not active in database %s.
4400020381MGR is not in single primary mode in database %s.
4400020382%s is not in MGR replication group member in database %s.
4400020383Group name in MGR is not same with configured one %s in database %s.
42S0120390MySQL Duplicate primary data source in database %s.
42S0220391Primary data source not found in database %s.

SQL Dialect Translator

SQL StateVendor CodeReason
4200020440Can not support database %s in SQL translation.
4200020441Translation error, SQL is: %s

Traffic Management

SQL StateVendor CodeReason
42S0220500Can not get traffic execution unit.

Data Encrypt

SQL StateVendor CodeReason
4400020700Can not find logic encrypt column by %s.
4400020701Fail to find encrypt column %s from table %s.
4400020702Altered column %s must use same encrypt algorithm with previous column %s in table %s.
4200020740Insert value of index %s can not support for encrypt.
0A00020741The SQL clause %s is unsupported in encrypt rule.
HY00420780Encrypt algorithm %s initialization failed, reason is: %s.
4400020703Cipher column of %s can not be null in database %s.
4400020704Encrypt column encryptor not found, reason is: %s.
4400020705Assisted query column of %s can not be null in database %s.
4400020706Assisted query encryptor not found, reason is: %s.
4400020707Like query column of %s can not be null in database %s.
4400020708Encrypt like query encryptor not found, reason is: %s.
4400020709Can not find encrypt table: %s.

Shadow Database

SQL StateVendor CodeReason
4400020800%s algorithm does not exist in database %s.
4400020801%s configuration does not exist in database %s.
4400020802No available shadow data sources mappings in shadow table %s.
4400020803Column shadow algorithm %s operation only supports one column mapping in shadow table %s.
HY00420820Shadow column %s of table %s does not support %s type.
4200020840Insert value of index %s can not support for shadow.
HY00020880Shadow algorithm %s initialization failed, reason is: %s.
4400020881Default shadow algorithm class should be implement HintShadowAlgorithm.

Data Masking

SQL StateVendor CodeReason
HY00020980Mask algorithm %s initialization failed, reason is: %s.

Other Exception

SQL StateVendor CodeReason
HY00430000Unknown exception: %s
0A00030001Unsupported SQL operation: %s
0A00030002Database protocol exception: %s
0A00030003Unsupported command: %s