环境:Percona Server for MySQL 5.5.18

模拟三个Terminal,实现当引用锁定表的查询被杀死时,错误日志中出现的Got error -1 when reading table

Terminal A

mysql> set session autocommit=0;
Query OK, 0 rows affected (0.00 sec) mysql> create table t1(i1 int not null primary key, v2 varchar(20)) engine =innodb;
Query OK, 0 rows affected (0.00 sec) mysql> insert into t1 values(1,'a'),(2, 'b'),(3, 'c'),(4,'d');
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0 mysql> commit;
Query OK, 0 rows affected (0.01 sec) mysql> select * from t1 where i1 = 2 for update;
+----+------+
| i1 | v2 |
+----+------+
| 2 | b |
+----+------+
1 row in set (0.00 sec) mysql> select * from t1 where i1 = 4 for update;
+----+------+
| i1 | v2 |
+----+------+
| 4 | d |
+----+------+
1 row in set (0.00 sec)

Terminal B

mysql> set session autocommit=0;
Query OK, 0 rows affected (0.00 sec) mysql> select * from t1 where i1 = 4 for update; 此时的查询会因为 Terminal A未提交而等待

Terminal C

mysql> show processlist;
+----+------+-----------+------+---------+------+------------+------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+------------+------------------------------------------+
| 1 | root | localhost | test | Query | 6 | statistics | select * from t1 where i1 = 4 for update |
| 3 | root | localhost | NULL | Query | 0 | NULL | show processlist |
| 5 | root | localhost | test | Sleep | 328 | | NULL |
+----+------+-----------+------+---------+------+------------+------------------------------------------+
3 rows in set (0.00 sec) mysql> kill query 1;  杀掉Terminal B 的Query
Query OK, 0 rows affected (0.00 sec) 查看日志
171111 0:17:04 [ERROR] Got error -1 when reading table './test/t1'

Got error -1 when reading table的更多相关文章

  1. msyql error: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

    mysql> use mydb Reading table information for completion of table and column names You can turn o ...

  2. MySql Error: Can't update table in stored function/trigger

    MySql Error: Can't update table in stored function/trigger because it is already used by statement w ...

  3. ERROR 1114 (HY000): The table 'adv_date_tmp' is full(Mysql临时表应用)

    场景:需要对现在数据库的数据进行批量的进行is_del=1的操作,但是遇到一个问题,在执行sql的时候发现sql不能在查询特定表的时候再嵌套查询来做update的操作,经过讨论,后续我们想到用临时表的 ...

  4. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -

    mysql -A不预读数据库信息(use dbname 更快)—Reading table information for completion of table and column names Y ...

  5. 解决:Reading table information for completion of table and column names

    mysql -A不预读数据库信息(use dbname 更快)—Reading table information for completion of table and column names Y ...

  6. mysqldump: Got error: 1066: Not unique table/alias

    mysqldump: Got error: 1066: Not unique table/alias myql 导出时提示如下: [root@localhost mysql]# mysqldump  ...

  7. Reading table information for completion of table and column names

    mysql> use ad_detail_page;Reading table information for completion of table and column namesYou c ...

  8. mysql切换数据库提示警告:Reading table information for completion of table and column names

    登录数据库后,选择数据库时发现以下提示, mysql> use testReading table information for completion of table and column ...

  9. MySQL Reading table information for completion of table and column names

    打开数据库是发现提示: mysql> show databases; +--------------------+ | Database | +--------------------+ | b ...

随机推荐

  1. 虚拟机---vmmare15安装centos7.4

    第一步:下载centos7的镜像iso文件:http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Everything- ...

  2. elasticsearch 6.1.1 transport jar

    https://files.cnblogs.com/files/xjyggd/transport6.1.1.rar

  3. HTML中include file的用法

    语法 <!-- #include PathType = "FileName" --> 参数 PathType  路径类型 路径可为以下某种类型: 文件 该文件名是带有  ...

  4. JS开发中常用的小技巧

    1.获取指定范围内的随机数 1 2 3 function getRadomNum(min,max){     return  Math.floor(Math.random() * (max - min ...

  5. J - Printer Queue 优先队列与队列

    来源poj3125 The only printer in the computer science students' union is experiencing an extremely heav ...

  6. 山东省第八届ACM大学生程序设计竞赛

    C 暂时还不对 #include <iostream> #include <cstdio> #include <cmath> using namespace std ...

  7. js模拟发送 FormData数据

    后台express需要connect-multiparty模块接收formData的数据类型 class ourFormData { constructor(data, rs) { return ne ...

  8. 【持续集成】GIT+jenkins+sonar——GIT

    一.GIT基础 1.1 git简介 linus用C语言编写 2005年诞生 分布式管理系统 速度快.适合大规模.跨地区多人协同开发 1.2 本地管理.集中式.分布式 1.3 git安装 #CentOS ...

  9. 微信小程序(微信应用号)组件讲解[申明:来源于网络]

    微信小程序(微信应用号)组件讲解[申明:来源于网络] 地址:http://www.cnblogs.com/muyixiaoguang/p/5902008.html

  10. A股时间窗口

    春节躁动行情:大消费,文娱影视 一号文件:泛农业股 两会行情:两会概念 糖酒会:白酒,糖业 五穷六绝:半年节点,[市场缺钱] 暑期档:文娱影视 国庆行情:军工,文娱影视 年底:阳历年底,[市场缺钱] ...