转 InnoDB Error Handling
14.20.4 InnoDB Error Handling
Error handling in InnoDB
is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause rollback of that statement. InnoDB
sometimes rolls back only part of the statement, or the whole transaction. The following items describe how InnoDB
performs error handling:
If you run out of file space in a tablespace, a MySQL
Table is full
error occurs andInnoDB
rolls back the SQL statement.A transaction deadlock causes
InnoDB
to roll back the entire transaction. Retry the whole transaction when this happens.A lock wait timeout causes
InnoDB
to roll back only the single statement that was waiting for the lock and encountered the timeout. (To have the entire transaction roll back, start the server with the--innodb_rollback_on_timeout
option.) Retry the statement if using the current behavior, or the entire transaction if using--innodb_rollback_on_timeout
.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
orBEGIN
statement, rollback does not cancel that statement. Further SQL statements become part of the transaction until the occurrence ofCOMMIT
,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.
转 InnoDB Error Handling的更多相关文章
- Erlang error handling
Erlang error handling Contents Preface try-catch Process link Erlang-way error handling OTP supervis ...
- mariadb:InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
mariadb 启动中 InnoDB: Error: log file ./ib_logfile0 is of different size 0 起因:线上正在运行的系统,因为需要调整性能,变更了my ...
- MySQL Error Handling in Stored Procedures 2
Summary: this tutorial shows you how to use MySQL handler to handle exceptions or errors encountered ...
- 报错问题:InnoDB: Error: log file ./ib_logfile0 is of different size
InnoDB: Error: log file ./ib_logfile0 is of different size bytesInnoDB: than specified in the .cnf f ...
- setjmp()、longjmp() Linux Exception Handling/Error Handling、no-local goto
目录 . 应用场景 . Use Case Code Analysis . 和setjmp.longjmp有关的glibc and eglibc 2.5, 2.7, 2.13 - Buffer Over ...
- Error Handling
Use Exceptions Rather Than Return Codes Back in the distant past there were many languages that didn ...
- 【MySQL】InnoDB: Error: checksum mismatch in data file 报错
参考:http://www.jb51.net/article/66951.htm 用5.7版本启动原5.5实例后,再用5.5启动出现以下报错 InnoDB: Error: checksum misma ...
- Error Handling and Exception
The default error handling in PHP is very simple.An error message with filename, line number and a m ...
- Clean Code–Chapter 7 Error Handling
Error handling is important, but if it obscures logic, it's wrong. Use Exceptions Rather Than Return ...
随机推荐
- 老男孩Python全栈学习 S9 日常作业 004
1.写代码,有如下列表,按照要求实现每一个功能 li = ["alex", "WuSir", "ritian", "barry&q ...
- 解决 IIS 反向代理ARR URLREWRITE 设置后,不能跨域跳转 return Redirect 问题
1.选择iis根节点,点击ARR 2.选择代理设置 3.去掉reverse rewrite host in response headers的勾选,点击应用即可
- 第三节:深度剖析各类数据结构(Array、List、Queue、Stack)及线程安全问题和yeild关键字
一. 各类数据结构比较及其线程安全问题 1. Array(数组): 分配在连续内存中,不能随意扩展,数组中数值类型必须是一致的.数组的声明有两种形式:直接定义长度,然后赋值:直接赋值. 缺点:插入数据 ...
- [物理学与PDEs]第1章第7节 媒质中的 Maxwell 方程组 7.1 媒质中的 Maxwell 方程组
1.媒质的极化 (1) 束缚电荷: 被束缚在原来位置上的电荷. (2) 在电磁场中, 束缚电荷会有一微小的运动, 而产生电偶极矩. 此即称为媒质的极化. (3) 设电极化强度 (单位体积的电偶极矩) ...
- 求复变函数的 Taylor 展式与 Laurent 展式[华中师范大学2010年复变函数复试试题]
设 $$\bex f(z)=\frac{1}{(z-1)(z-2)}. \eex$$ (1) 求 $f(z)$ 在 $|z|<1$ 内的 Taylor 展式. (2) 求 $f(z)$ 在圆环 ...
- ASP.NET Web API 2 之路由配置
Ø 简介 ASP.NET Web API 路由配置也是必须掌握的技术点之一,要真正的完全掌握和理解它也是需要一定的过程的.不过,在平常的开发过程中,对它有基本的了解就足够了.因为我们主要关注点并不在 ...
- SrpingBoot部署到云服务器
预先准备事项 1.本地主机:安装maven 2.云端主机:安装和配置jdk 一.maven打包 方式一:maven手动版 切换至项目下,cmd:mvn package 查看target目录: 方式二: ...
- Java 多线程总结
昨天熬了个通宵,看了一晚上的视频,把java 的多线程相关技术重新复习了一遍,下面对学习过程中遇到的知识点进行下总结. 首先我们先来了解一下进程.线程.并发执行的概念: 进程是指:一个内存中运行的应用 ...
- safari中input、textarea无法输入的问题
网址:https://www.cnblogs.com/xiayu25/p/6832748.html * { -webkit-box-sizing: border-box; -moz-box-sizin ...
- 什么是DAPP
DAPP(Decentralized Application)去中心化的应用 DAPP可以是网站,也可以是手机app,只要主要逻辑和数据在区块链上就可以 在以太坊平台上,一个DAPP肯定基于一个或多个 ...