InnoDB
Error Handling
1281
Both deadlocks and lock wait timeouts are normal on busy servers and it is necessary for
applications to be aware that they may happen and handle them by retrying. You can make them
less likely by doing as little work as possible between the first change to data during a transaction
and the commit, so the locks are held for the shortest possible time and for the smallest possible
number of rows. Sometimes splitting work between different transactions may be practical and
helpful.
When a transaction rollback occurs due to a deadlock or lock wait timeout, it cancels the effect of the
statements within the transaction. But if the start-transaction statement was
START TRANSACTION
or
BEGIN
statement, rollback does not cancel that statement. Further SQL statements become part
of the transaction until the occurrence of
COMMIT
,
ROLLBACK
, or some SQL statement that causes
an implicit commit.
• A duplicate-key error rolls back the SQL statement, if you have not specified the
IGNORE
option in
your statement.
• A
row too long error
rolls back the SQL statement.
• Other errors are mostly detected by the MySQL layer of code (above the
InnoDB
storage engine
level), and they roll back the corresponding SQL statement. Locks are not released in a rollback of a
single SQL statement.
During implicit rollbacks, as well as during the execution of an explicit
ROLLBACK
SQL statement,
SHOW
PROCESSLIST
displays
Rolling back
in the
State
column for the relevant connection.
14.2.11.1.
InnoDB
Error Codes
The following is a nonexhaustive list of common
InnoDB
-specific errors that you may encounter, with
information about why each occurs and how to resolve the problem.
•
1005 (ER_CANT_CREATE_TABLE)
Cannot create table. If the error message refers to error 150, table creation failed because a foreign
key constraint was not correctly formed. If the error message refers to error –1, table creation
probably failed because the table includes a column name that matched the name of an internal
InnoDB
table.
•
1016 (ER_CANT_OPEN_FILE)
Cannot find the
InnoDB
table from the
InnoDB
data files, although the
.frm
file for the table exists.
See
Section 14.2.12.4, “Troubleshooting
InnoDB
Data Dictionary Operations”
.
•
1114 (ER_RECORD_FILE_FULL)
InnoDB
has run out of free space in the tablespace. You should reconfigure the tablespace to add a
new data file.
•
1205 (ER_LOCK_WAIT_TIMEOUT)
Lock wait timeout expired. Transaction was rolled back.
•
1213 (ER_LOCK_DEADLOCK)
Transaction deadlock. You should rerun the transaction.
•
1216 (ER_NO_REFERENCED_ROW)
You are trying to add a row but there is no parent row, and a foreign key constraint fails. You should
add the parent row first.
•
1217 (ER_ROW_IS_REFERENCED)
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...