Error Code for SQL Advisor
Error code for Bytebase SQL Advisor.
General
0 - OK
Success
1 - Internal error
Something unexpected happened, you can open a GitHub issue or contact us.
2 - Schema review policy not found
Cannot find the schema review policy in a specific environment. Please follow the doc to create the policy.
Compatibility
101 - DROP DATABASE
Applications usually specifies database in their connection string. Dropping the database will definitely break those applications.
102 - RENAME TABLE
Renaming the table will break the code referring that table.
103 - DROP TABLE
Dropping the table will break the code referring that table.
104 - RENAME COLUMN
Renaming the column will break the code referring that column.
105 - DROP COLUMN
Dropping the column will break the code referring that column.
106 - ADD PRIMARY KEY
Primary key requires the candidate key set has unique value and the chosen candidate key set might not meet this requirement.
107 - ADD UNIQUE KEY
Unique key requires the candidate key set has unique value and the chosen candidate key set might not meet this requirement.
108 - ADD FOREIGN KEY
The existing values on the candidate foreign key and the referenced key might not meet the referential requirements.
109 - ADD CHECK
The existing value might not meet the check requirement.
110 - ALTER CHECK
The existing value might not meet the check requirement.
111 - ALTER COLUMN
Some ALTER COLUMN change is backward incompatible such as changing the data type from VARCHAR to INT. On the other hand, some change is backward compatible such as changing the database type from INT to BIGINT, or adding a comment and etc. User should review the actual statement.
Statement
201 - Statement syntax error
A syntax error in your SQL statement.
202 - Statement missing where
The SQL has no WHERE clause. Check Require WHERE clause for details.
203 - Statement not select all
The SQL has SELECT *
. Check Disallow SELECT * for details.
204 - Statement not allow leading wildcard like
The SQL has leading wildcard LIKE. Check Disallow leading % in LIKE for details.
206 - Statement disallow COMMIT
The SQL has COMMIT
. Check Disallow COMMIT for details.
207 - Statement redundant ALTER TABLE
The SQL has redundant ALTER TABLE
. Check Merge ALTER TABLE for details.
208 - Statement dry run failed
The SQL dry-run failed. Check Dry run DML statements for details.
209 - Statement affected rows exceed limit
The SQL affected rows exceed the limit. Check Limit affected rows for details.
210 - Statement add column with default
The SQL adds column with default value. Check Disallow add column with default for details.
211 - Statement add check with validation
The SQL adds check with validation. Check Add CHECK constraints with NOT VALID option for details.
212 - Statement add NOT NULL
The SQL adds NOT NULL. Check Disallow add NOT NULL constraints to an existing column for details.
Naming
301 - Table naming convention mismatch
Mismatch the table naming convention in your schema review policy. Check Table naming convention for details.
302 - Column naming convention mismatch
Mismatch the column naming convention in your schema review policy. Check Column naming convention for details.
303 - Index naming convention mismatch
Mismatch the index naming convention in your schema review policy. Check Index naming convention for details.
304 - Unique key naming convention mismatch
Mismatch the unique key naming convention in your schema review policy. Check Unique key naming convention for details.
305 - Foreign key naming convention mismatch
Mismatch the foreign key naming convention in your schema review policy. Check Foreign key naming convention for details.
306 - Primary key naming convention mismatch
Mismatch the primary key naming convention in your schema review policy. Check Primary key naming convention for details.
307 - Auto-increment column naming convention mismatch
Mismatch the auto-increment column naming convention in your schema review policy. Check Auto-increment column naming convention for details.
Column
401 - Missing required columns
Cannot find the required columns defined in your schema review policy. Check Enforce the required columns in each table for details.
402 - Column cannot be null
The column cannot be NULL
. Check Columns no NULL value for details.
403 - Change column type
The column type is changed. Check Disallow change column type for details.
404 - NOT NULL column with no default
The NOT NULL column has no default value. Check Set DEFAULT value for NOT NULL columns for details.
405 - Column not exists
The column does not exist. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
406 - Use CHANGE COLUMN statement
The column is changed with CHANGE COLUMN
. Check Disallow ALTER TABLE CHANGE COLUMN statements for details.
407 - change column order
The column order is changed. Check Disallow changing column order for details.
408 - Column has no comment
The column has no comment. Check Column comment convention for details.
409 - Column comment too long
The column comment is too long. Check Column comment convention for details.
410 - Auto-increment column is not integer
The auto-increment column is not an integer. Check Use integer for auto-increment columns for details.
411 - Disabled column type
The column type is disabled. Check Column type disallow list for details.
412 - Column already exists
The column already exists. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
413 - Drop all columns
The column is dropped. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
414 - Set column charset
Set the column charset. Check Disallow set charset for columns for details.
415 - Char length exceeds limit
The char length exceeds the limit. Check Maximum CHAR length for details.
416 - Auto-increment column initial value not match
The auto-increment column initial value does not match. Check Auto-increment initial value for details.
417 - Auto-increment column is signed
The auto-increment column is signed. Check Set unsigned attribute on auto-increment columns for details.
418 - Default current time column count exceeds limit
The default current time column count exceeds the limit. Check Limit the count of current time columns for details.
419 - On update current time column count exceeds limit
The on update current time column count exceeds the limit. Check Limit the count of current time columns for details.
420 - No default value
The column has no default value. Check Require column default value for details.
421 - Column is referenced by view
The column is referenced by view. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
Engine
501 - Use InnoDB engine
Should se InnoDB as MySQL storage engine. Check Require InnoDB for details.
Table
601 - Table missing primary key
The table needs a primary key. Check Require primary key for details.
602 - Table disallow foreign key
The table disallows the foreign key. Check Disallow foreign key for details.
603 - Table drop naming convention mismatch
The table name mismatches with the naming convention for drop table operation. Check Drop table naming convention for details.
604 - Table not exists
The table does not exist. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
605 - Table has no comment
The table has no comment. Check Table comment convention for details.
606 - Table comment too long
The table comment is too long. Check Table comment convention for details.
607 - Table already exists
The table already exists. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
608 - Create table partition
Create table partition. Check Disallow partition table for details.
609 - Table is referenced by views
The table is referenced by views. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
Database
701 - Drop database restriction
Can only drop the database if there's no table in it. Check Drop database restriction for details.
702 - Not current database
The database in your SQL statement mismatches with the database in the catalog. Please check the statement to ensure the database name is correct.
703 - Database is deleted
The database is deleted. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
Index
801 - Not use index
The query does not use any index.
802 - Index key number exceeds limit
The index key number exceeds the limit. Check Limit the count of index keys for details.
803 - Index primary key type
The index primary key type is not allowed. Check Limit key type for primary keys for details.
804 - Index type no blob
The index type is not allowed. Check Disallow BLOB and TEXT for index keys for details.
805 - Index exists
The index already exists. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
806 - Primary key exists
The primary key already exists. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
807 - Index empty keys
The index has no keys. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
808 - Primary key not exists
The primary key does not exist. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
809 - Index not exists
The index does not exist. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
810 - Incorrect index name
The index name is incorrect. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
811 - Spatial index key nullable
The spatial index key is nullable. Found in Bytebase's pre-execution checks, please confirm if there is a problem with the SQL.
812 - Duplicate column in index
The index has duplicate columns. Check Disallow duplicate column in index keys for details.
813 - Index count exceeds limit
The index count exceeds the limit. Check Index count limit for details.
814 - Create index unconcurrently
The index is created without CONCURRENTLY. Check Create index concurrently for details.
Charset
1001 - Disabled charset
The charset is disabled. Check Charset allow list for details.
DML
1101 - Insert too many rows
The number of rows to be inserted exceeds the limit. Check Limit the inserted rows for details.
1102 - Update use limit
The UPDATE statement uses LIMIT. Check Disallow LIMIT for details.
1103 - Insert use limit
The INSERT statement uses LIMIT. Check Disallow LIMIT for details.
1104 - Update use order by
The UPDATE statement uses ORDER BY. Check Disallow ORDER BY for details.
1105 - Delete use order by
The DELETE statement uses ORDER BY. Check Disallow ORDER BY for details.
1106 - Delete use limit
The DELETE statement uses LIMIT. Check Disallow LIMIT for details.
1107 - Insert not specify column
The INSERT statement does not specify columns. Check INSERT statements must specify columns for details.
1108 - Insert use order by rand
The INSERT statement uses ORDER BY RAND. Check Disallow ORDER BY RAND in INSERT statements for details.
Collation
1201 - Disabled collation
The collation is disabled. Check Collation allow list for details.
Comment
1301 - Comment too long
The comment is too long. Check Comment length limit for details.