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
4200010000Resource does not exist.
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.
HY00011002Can not find %s file for datetime initialize.
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.
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.
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.
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.

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 check failed, error message: %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
4400018002Altered process configuration does not exist.
HY00018020Failed to get DDL for table %s.
42S0118030Duplicate resource names %s.
42S0218031Resource names %s do not exist.
0A00018032Unsupported data type %s of unique key for pipeline job.
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.
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.

DistSQL

SQL StateVendor CodeReason
4400019000Can not process invalid resources, error message is: %s
4400019001Resources %s do not exist in database %s.
4400019002There is no resource in the database %s.
4400019003Resource %s is still used by %s.
4400019004Duplicate resource 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.
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.
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.
4400020090Can not find strategy for generate keys with table %s.
HY00020099Sharding plugin error, reason is: %s

Readwrite Splitting

SQL StateVendor CodeReason
HY00420280Invalid read database weight %s.

Database HA

SQL StateVendor CodeReason
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.

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

Shadow Database

SQL StateVendor CodeReason
HY00420820Shadow column %s of table %s does not support %s type.
4200020840Insert value of index %s can not support for shadow.

Other Exception

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