Error Code

MatrixOne reports a numeric error number and a five-character SQLSTATE to SQL clients. It also uses internal error identifiers to classify failures. These values serve different purposes and should not be treated as interchangeable.

During actual use, check the client-visible error number, SQLSTATE, message, and failed statement together. A MatrixOne error number is not a promise of MySQL error-number compatibility or of identical behavior across versions.

Note

The SQL standard defines SQLSTATE classes. MatrixOne’s numeric error numbers can differ from MySQL’s for the same statement.

MySQL client error-number comparison

The following 25 cases were observed with MatrixOne v4.2.5 and MySQL 8.0.46 in MatrixOne issue #30470. These are the numeric values shown as ERROR NNNN by a MySQL client. They are not the internal MatrixOne error identifiers listed later on this page. Check the result on your own build and query path before using it in retry, idempotency, or alerting logic.

Scenario

MatrixOne

MySQL

Duplicate unique key

1062

1062

Duplicate primary key

1062

1062

Data too long for a column

1406

1406

Table already exists

1050

1050

Duplicate index name

1061

1061

Database does not exist

1049

1049

SQL syntax error

1064

1064

Missing table in INSERT

1146

1146

Missing table in SELECT

1064

1146

Unknown column in SELECT list

20301

1054

Unknown column in WHERE

20301

1054

Duplicate column name

3819

1060

Insert NULL into a NOT NULL column

3819

1048

Unknown function

20105

1305

Invalid integer string

20203

1366

Invalid date value

20203

1292

Wrong function argument count

20203

1582

Integer out of range

1690

1264

Insert a foreign-key orphan row

20101

1452

Delete a referenced parent row

20101

1451

Unknown system variable

20101

1193

Duplicate table alias

20301

1066

Unknown column in ORDER BY

20301

1054

Missing table in DROP TABLE

1146

1051

Create a foreign key referencing a missing table

1146

1824

Some MatrixOne numbers cover several MySQL errors. The message fragments below are diagnostic examples, not a stable or exhaustive matching API. A fragment can vary by version or query path, and the same fragment can appear in more than one scenario. Use the failed statement and object or constraint metadata to decide what happened:

MatrixOne number

Example message fragments to inspect

Required statement context

1064

syntax suggests a syntax error; table with does not exist suggests a missing table.

Check whether the failing statement is a SELECT, then verify the referenced table.

1146

table with does not exist indicates a missing object, but does not distinguish these cases.

Distinguish INSERT, DROP TABLE, and a foreign-key CREATE TABLE by the operation and referenced object.

20301

column with does not exist suggests an unresolved column. Other alias or ORDER BY errors may use different wording.

Check whether the invalid name is a column reference, repeated table alias, or ORDER BY reference.

20101

foreign key constraint suggests a constraint failure; the system variable does not exist suggests an unknown variable.

For a foreign-key failure, distinguish child INSERT from parent DELETE and inspect the constraint.

For application logic, reproduce the exact statement on the target version and use the operation and constraint metadata as well as the error number. Error-number compatibility is not guaranteed for the differing cases above; do not make retry, idempotency, or alerting decisions from a fragment alone.

Internal MatrixOne error identifiers

The tables below classify MatrixOne internal error identifiers. An identical numeral in these tables and in a client ERROR NNNN response does not necessarily represent the same error condition.

Error encoding head

Type

201

Internal Error

202

Number and function error

203

Invalid Operation

204

Unknown Error or IO Error

205

RPC Timeout

206

Transaction Error or Storage Engine Error

207

Lock Error

For more information on the details of these errors, please refer to the following table:

Error code

Error number

Description

Error type

20100

ErrStart

internal error code start

Internal error

20101

ErrInternal

Internal error

Internal error

20103

ErrNYI

not yet implemented

Internal error

20104

ErrOOM

out of memory

Internal error

20105

ErrQueryInterrupted

query interrupted

Internal error

20106

ErrNotSupported

not supported

Internal error

20200

ErrDivByZero

division by zero

Numbers and functions

20201

ErrOutOfRange

data out of range

Numbers and functions

20202

ErrDataTruncated

data truncated

Numbers and functions

20203

ErrInvalidArg

invalid argument

Numbers and functions

20204

ErrTruncatedWrongValueForField

truncated wrong value for column

Numbers and functions

20300

ErrBadConfig

invalid configuration

Invalid operation

20301

ErrInvalidInput

invalid input

Invalid operation

20302

ErrSyntaxError

SQL syntax error

Invalid operation

20303

ErrParseError

SQL parser error

Invalid operation

20304

ErrConstraintViolation

constraint violation

Invalid operation

20305

ErrDuplicate

tae data duplicated

Invalid operation

20306

ErrRoleGrantedToSelf

cannot grant role

Invalid operation

20307

ErrDuplicateEntry

duplicate entry for key

Invalid operation

20400

ErrInvalidState

invalid state

Unknown status or I/O error

20401

ErrLogServiceNotReady

log service not ready

Unknown status or I/O error

20402

ErrBadDB

invalid database

Unknown status or I/O error

20403

ErrNoSuchTable

no such table

Unknown status or I/O error

20404

ErrEmptyVector

empty vector

Unknown status or I/O error

20405

ErrFileNotFound

file is not found

Unknown status or I/O error

20406

ErrFileAlreadyExists

file alread exists

Unknown status or I/O error

20407

ErrUnexpectedEOF

unexpteded end of file

Unknown status or I/O error

20408

ErrEmptyRange

empty range of file

Unknown status or I/O error

20409

ErrSizeNotMatch

file size does not match

Unknown status or I/O error

20410

ErrNoProgress

file has no io progress

Unknown status or I/O error

20411

ErrInvalidPath

invalid file path

Unknown status or I/O error

20412

ErrShortWrite

file io short write

Unknown status or I/O error

20413

ErrInvalidWrite

file io invalid write

Unknown status or I/O error

20414

ErrShortBuffer

file io short buffer

Unknown status or I/O error

20415

ErrNoDB

not connect to a database

Unknown status or I/O error

20416

ErrNoWorkingStore

no working store

Unknown status or I/O error

20417

ErrNoHAKeeper

cannot locate ha keeper

Unknown status or I/O error

20418

ErrInvalidTruncateLsn

invalid truncate lsn, shard already truncated

Unknown status or I/O error

20419

ErrNotLeaseHolder

not lease holder, current lease holder ID xxx

Unknown status or I/O error

20420

ErrDBAlreadyExists

database already exists

Unknown status or I/O error

20421

ErrTableAlreadyExists

table already exists

Unknown status or I/O error

20422

ErrNoService

service not found

Unknown status or I/O error

20423

ErrDupServiceName

duplicate service name

Unknown status or I/O error

20424

ErrWrongService

wrong service, expecting A, got B

Unknown status or I/O error

20425

ErrBadS3Config

bad s3 config

Unknown status or I/O error

20426

ErrBadView

invalid view

Unknown status or I/O error

20427

ErrInvalidTask

invalid task

Unknown status or I/O error

20428

ErrInvalidServiceIndex

invalid service idx

Unknown status or I/O error

20429

ErrDragonboatTimeout

Dragonboat timeout

Unknown status or I/O error

20430

ErrDragonboatTimeoutTooSmall

Dragonboat timeout too small

Unknown status or I/O error

20431

ErrDragonboatInvalidDeadline

Dragonboat invalid deadline

Unknown status or I/O error

20432

ErrDragonboatRejected

Dragonboat rejected

Unknown status or I/O error

20433

ErrDragonboatInvalidPayloadSize

invalid payload size

Unknown status or I/O error

20434

ErrDragonboatShardNotReady

shard not ready

Unknown status or I/O error

20435

ErrDragonboatSystemClosed

Dragonboat system closed

Unknown status or I/O error

20436

ErrDragonboatInvalidRange

Dragonboat invalid range

Unknown status or I/O error

20437

ErrDragonboatShardNotFound

shard not found

Unknown status or I/O error

20438

ErrDragonboatOtherSystemError

other system error

Unknown status or I/O error

20439

ErrDropNonExistsDB

Can’t drop database ; database doesn’t exist

Unknown status or I/O error

20500

ErrRPCTimeout

rpc timeout

RPC Timeout

20501

ErrClientClosed

client closed

RPC Timeout

20502

ErrBackendClosed

backend closed

RPC Timeout

20503

ErrStreamClosed

stream closed

RPC Timeout

20504

ErrNoAvailableBackend

no available backend

RPC Timeout

20600

ErrTxnClosed

the transaction has been committed or aborted

Transaction

20601

ErrTxnWriteConflict

transaction write conflict

Transaction

20602

ErrMissingTxn

missing transaction

Transaction

20603

ErrUnresolvedConflict

unresolved conflict

Transaction

20604

ErrTxnError

transaction error

Transaction

20605

ErrDNShardNotFound

TN shard not found

Transaction

20606

ErrShardNotReported

TN shard not reported

Transaction

20607

ErrTAEError

tae error

TAE Error

20608

ErrTAERead

tae read error

TAE Error

20609

ErrRpcError

rpc error

TAE Error

20610

ErrWaitTxn

transaction wait error

TAE Error

20611

ErrTxnNotFound

transaction not found

TAE Error

20612

ErrTxnNotActive

transaction not active

TAE Error

20613

ErrTAEWrite

tae write error

TAE Error

20614

ErrTAECommit

tae commit error

TAE Error

20615

ErrTAERollback

tae rollback error

TAE Error

20616

ErrTAEPrepare

tae prepare error

TAE Error

20617

ErrTAEPossibleDuplicate

tae possible duplicate

TAE Error

20618

ErrTxnRWConflict

r-w conflict

TAE Error

20619

ErrTxnWWConflict

w-w conflict

TAE Error

20620

ErrNotFound

transaction not found

TAE Error

20621

ErrTxnInternal

transaction internal error

TAE Error

20622

ErrTxnReadConflict

transaction read conflict

TAE Error

20623

ErrPrimaryKeyDuplicated

duplicated primary key

TAE Error

20624

ErrAppendableSegmentNotFound

appendable segment not found

TAE Error

20625

ErrAppendableBlockNotFound

appendable block not found

TAE Error

20626

ErrTAEDebug

TAE debug

TAE Error

20709

ErrRemoteLockWaitTimeout

remote lock wait timeout

Lock Error