Skip to content

Commit

Permalink
Add category for sql error code document (apache#20919)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Sep 11, 2022
1 parent fd6de92 commit 89e45c5
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 0 deletions.
81 changes: 81 additions & 0 deletions docs/document/content/user-manual/error-code/sql-error-code.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,

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

## 内核异常

### 元数据

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 08000 | 10001 | The URL \`%s\` is not recognized, please refer to the pattern \`%s\` |
Expand All @@ -20,33 +24,80 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42S02 | 10021 | Schema \`%s\` does not exist |
| HY000 | 10022 | Can not load table with database name \`%s\` and data source name \`%s\` |
| 0A000 | 10023 | Can not drop schema \`%s\` because of contains tables |

### 数据

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY004 | 11001 | Invalid value \`%s\` |
| HY004 | 11005 | Unsupported conversion stream charset \`%s\` |
| HY004 | 11006 | Unsupported conversion data type \`%s\` for value \`%s\` |

### 语法

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 42000 | 12000 | You have an error in your SQL syntax: %s |
| 42000 | 12001 | SQL String can not be NULL or empty |
| 42000 | 12002 | Could not support variable \`%s\` |
| 0A000 | 12003 | DROP TABLE ... CASCADE is not supported |
| 42S02 | 12004 | Can not find column label \`%s\` |
| HV008 | 12005 | Column index \`%d\` is out of range |

### 连接

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 01000 | 13000 | Circuit break open, the request has been ignored |
| 08000 | 13001 | Can 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 |
| 08000 | 13002 | Connection has been closed |
| 08000 | 13003 | Result set has been closed |
| HY000 | 13004 | Load datetime from database failed, reason: %s |
| HY004 | 13010 | Can not register driver, reason is: %s |

### 事务

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 25000 | 14000 | Switch transaction type failed, please terminate the current transaction |
| 25000 | 14001 | Can not start new XA transaction in a active transaction |
| 25000 | 14002 | Failed to create \`%s\` XA data source |
| 25000 | 14003 | JDBC does not support operations across multiple logical databases in transaction |

###

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY000 | 15000 | The table \`%s\` of schema \`%s\` is locked |
| HY000 | 15001 | The table \`%s\` of schema \`%s\` lock wait timeout of \`%s\` milliseconds exceeded |

### 审计

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 44000 | 16000 | SQL check failed, error message: %s |

### 集群

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY000 | 17000 | Work ID assigned failed, which can not exceed 1024 |
| HY000 | 17001 | Can not find \`%s\` file for datetime initialize |
| HY000 | 17002 | File access failed, reason is: %s |

### 迁移

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY000 | 18000 | Can not find pipeline job \`%s\` |
| HY000 | 18001 | Failed to get DDL for table \`%s\` |

## 功能异常

### 数据分片

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY000 | 20000 | Sharding algorithm class \`%s\` should be implement \`%s\` |
| 44000 | 20001 | Can not get uniformed table structure for logic table \`%s\`, it has different meta data of actual tables are as follows: %s |
| 42S02 | 20002 | Can not get route result, please check your sharding rule configuration |
Expand Down Expand Up @@ -77,21 +128,51 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| HY000 | 20051 | \`%s %s\` can not route correctly for %s \`%s\` |
| 42S02 | 20052 | Can not find data source in sharding rule, invalid actual data node \`%s\` |
| 34000 | 20053 | Can not get cursor name from fetch statement |

### 数据库高可用

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY000 | 23000 | MGR plugin is not active in database \`%s\` |
| 44000 | 23001 | MGR is not in single primary mode in database \`%s\` |
| 44000 | 23002 | \`%s\` is not in MGR replication group member in database \`%s\` |
| 44000 | 23003 | Group name in MGR is not same with configured one \`%s\` in database \`%s\` |

### SQL 方言转换

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 42000 | 24000 | Can not support database \`%s\` in SQL translation |
| 42000 | 24001 | Translation error, SQL is: %s |

### 流量治理

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| 42S02 | 25000 | Can not get traffic execution unit |

### 数据加密

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY004 | 27000 | Encrypt algorithm \`%s\` initialize failed, reason is: %s |
| 0A000 | 27001 | The SQL clause \`%s\` is unsupported in encrypt rule |
| 44000 | 27002 | Altered column \`%s\` must use same encrypt algorithm with previous column \`%s\` in table \`%s\` |
| 42000 | 27003 | Insert value of index \`%s\` can not support for encrypt |
| 44000 | 27004 | Can not find logic encrypt column by \`%s\` |
| 44000 | 27005 | Fail to find encrypt column \`%s\` from table \`%s\` |

### 影子库

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY004 | 28000 | Shadow column \`%s\` of table \`%s\` does not support \`%s\` type |
| 42000 | 28001 | Insert value of index \`%s\` can not support for shadow |

## 其他异常

| SQL State | Vendor Code | 错误信息 |
| --------- | ----------- | ------ |
| HY004 | 30000 | Unknown exception: %s |
| 0A000 | 30001 | Unsupported operation: %s |
| 42000 | 30002 | Unsupported command: %s |
81 changes: 81 additions & 0 deletions docs/document/content/user-manual/error-code/sql-error-code.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi

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

## Kernel Exception

### Meta data

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 08000 | 10001 | The URL \`%s\` is not recognized, please refer to the pattern \`%s\` |
Expand All @@ -20,33 +24,80 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 42S02 | 10021 | Schema \`%s\` does not exist |
| HY000 | 10022 | Can not load table with database name \`%s\` and data source name \`%s\` |
| 0A000 | 10023 | Can not drop schema \`%s\` because of contains tables |

### Data

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY004 | 11001 | Invalid value \`%s\` |
| HY004 | 11005 | Unsupported conversion stream charset \`%s\` |
| HY004 | 11006 | Unsupported conversion data type \`%s\` for value \`%s\` |

### Syntax

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 42000 | 12000 | You have an error in your SQL syntax: %s |
| 42000 | 12001 | SQL String can not be NULL or empty |
| 42000 | 12002 | Could not support variable \`%s\` |
| 0A000 | 12003 | DROP TABLE ... CASCADE is not supported |
| 42S02 | 12004 | Can not find column label \`%s\` |
| HV008 | 12005 | Column index \`%d\` is out of range |

### Connection

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 01000 | 13000 | Circuit break open, the request has been ignored |
| 08000 | 13001 | Can 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 |
| 08000 | 13002 | Connection has been closed |
| 08000 | 13003 | Result set has been closed |
| HY000 | 13004 | Load datetime from database failed, reason: %s |
| HY004 | 13010 | Can not register driver, reason is: %s |

### Transaction

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 25000 | 14000 | Switch transaction type failed, please terminate the current transaction |
| 25000 | 14001 | Can not start new XA transaction in a active transaction |
| 25000 | 14002 | Failed to create \`%s\` XA data source |
| 25000 | 14003 | JDBC does not support operations across multiple logical databases in transaction |

### Lock

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY000 | 15000 | The table \`%s\` of schema \`%s\` is locked |
| HY000 | 15001 | The table \`%s\` of schema \`%s\` lock wait timeout of \`%s\` milliseconds exceeded |

### Audit

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 44000 | 16000 | SQL check failed, error message: %s |

### Cluster

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY000 | 17000 | Work ID assigned failed, which can not exceed 1024 |
| HY000 | 17001 | Can not find \`%s\` file for datetime initialize |
| HY000 | 17002 | File access failed, reason is: %s |

### Migration

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY000 | 18000 | Can not find pipeline job \`%s\` |
| HY000 | 18001 | Failed to get DDL for table \`%s\` |

## Feature Exception

### Data Sharding

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY000 | 20000 | Sharding algorithm class \`%s\` should be implement \`%s\` |
| 44000 | 20001 | Can not get uniformed table structure for logic table \`%s\`, it has different meta data of actual tables are as follows: %s |
| 42S02 | 20002 | Can not get route result, please check your sharding rule configuration |
Expand Down Expand Up @@ -77,21 +128,51 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| HY000 | 20051 | \`%s %s\` can not route correctly for %s \`%s\` |
| 42S02 | 20052 | Can not find data source in sharding rule, invalid actual data node \`%s\` |
| 34000 | 20053 | Can not get cursor name from fetch statement |

### Database HA

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY000 | 23000 | MGR plugin is not active in database \`%s\` |
| 44000 | 23001 | MGR is not in single primary mode in database \`%s\` |
| 44000 | 23002 | \`%s\` is not in MGR replication group member in database \`%s\` |
| 44000 | 23003 | Group name in MGR is not same with configured one \`%s\` in database \`%s\` |

### SQL Dialect Translator

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 42000 | 24000 | Can not support database \`%s\` in SQL translation |
| 42000 | 24001 | Translation error, SQL is: %s |

### Traffic Management

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| 42S02 | 25000 | Can not get traffic execution unit |

### Data Encrypt

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY004 | 27000 | Encrypt algorithm \`%s\` initialize failed, reason is: %s |
| 0A000 | 27001 | The SQL clause \`%s\` is unsupported in encrypt rule |
| 44000 | 27002 | Altered column \`%s\` must use same encrypt algorithm with previous column \`%s\` in table \`%s\` |
| 42000 | 27003 | Insert value of index \`%s\` can not support for encrypt |
| 44000 | 27004 | Can not find logic encrypt column by \`%s\` |
| 44000 | 27005 | Fail to find encrypt column \`%s\` from table \`%s\` |

### Shadow Database

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY004 | 28000 | Shadow column \`%s\` of table \`%s\` does not support \`%s\` type |
| 42000 | 28001 | Insert value of index \`%s\` can not support for shadow |

## Other Exception

| SQL State | Vendor Code | Reason |
| --------- | ----------- | ------ |
| HY004 | 30000 | Unknown exception: %s |
| 0A000 | 30001 | Unsupported operation: %s |
| 42000 | 30002 | Unsupported command: %s |

0 comments on commit 89e45c5

Please sign in to comment.