Session 1:

mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> update ClientActionTrack20151125 set ip='2.2.2.2'; Warning: Using a password on the command line interface can be insecure.
+-----+------+-----------+------+---------+------+----------+---------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+------+---------+------+----------+---------------------------------------------------+
| 447 | root | localhost | zjzc | Query | 5 | updating | update ClientActionTrack20151125 set ip='2.2.2.2' | 2016-11-25 17:40:26,39,447,root,localhost,zjzc
mysql[192.168.11.187] processid[447] root@localhost in db[zjzc] hold transaction time 39 mysql> select * from information_schema.innodb_trx\G;
*************************** 1. row ***************************
trx_id: 112075119
trx_state: RUNNING
trx_started: 2016-11-25 17:39:47
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 6115055
trx_mysql_thread_id: 447 my $hostSql = qq{SELECT
NOW(), (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.trx_started)) diff_sec,
b.id,
b.user,
b.host,
b.db
FROM
information_schema.innodb_trx a
INNER JOIN
information_schema.PROCESSLIST b ON a.TRX_MYSQL_THREAD_ID = b.id}; show processlist 看到的ID 447 就是 a.TRX_MYSQL_THREAD_ID = b.id 开启session 2: Database changed
mysql> update ClientActionTrack20151125 set ip='9.9.9.9'; Vsftp:/root# mysql -uroot -p1234567 -e"show processlist"
Warning: Using a password on the command line interface can be insecure.
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+
| 447 | root | localhost | zjzc | Query | 197 | updating | update ClientActionTrack20151125 set ip='2.2.2.2' |
| 454 | root | localhost | zjzc | Query | 3 | updating | update ClientActionTrack20151125 set ip='9.9.9.9' |
| 457 | root | 192.168.11.186:47208 | information_schema | Sleep | 1 | | NULL |
| 458 | root | localhost | NULL | Query | 0 | init | show processlist |
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+ 2016-11-25 17:43:39,232,447,root,localhost,zjzc
mysql[192.168.11.187] processid[447] root@localhost in db[zjzc] hold transaction time 232
2016-11-25 17:43:39,38,454,root,localhost,zjzc
mysql[192.168.11.187] processid[454] root@localhost in db[zjzc] hold transaction time 38
112075120,454,update ClientActionTrack20151125 set ip='9.9.9.9',112075119,447,update ClientActionTrack20151125 set ip='2.2.2.2'
mysql[192.168.11.187] blocking_thread[447] blocking_query[update ClientActionTrack20151125 set ip='2.2.2.2'] blocking waiting_thread[454]'s update ClientActionTrack20151125 set ip='9.9.9.9' 取的是 information_schema.innodb_trx:
r.trx_mysql_thread_id waiting_thread, b.trx_mysql_thread_id blocking_thread, mysql> select * from information_schema.innodb_trx\G;
*************************** 1. row ***************************
trx_id: 112075121
trx_state: LOCK WAIT
trx_started: 2016-11-25 17:45:27
trx_requested_lock_id: 112075121:442:4:149
trx_wait_started: 2016-11-25 17:45:27
trx_weight: 2
trx_mysql_thread_id: 454
trx_query: update ClientActionTrack20151125 set ip='9.9.9.9'
trx_operation_state: starting index read
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 2
trx_lock_memory_bytes: 360
trx_rows_locked: 1
trx_rows_modified: 0
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
*************************** 2. row ***************************
trx_id: 112075119
trx_state: RUNNING
trx_started: 2016-11-25 17:39:47
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 19816885
trx_mysql_thread_id: 447
trx_query: update ClientActionTrack20151125 set ip='2.2.2.2'
trx_operation_state: updating or deleting
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 638128
trx_lock_memory_bytes: 56555048
trx_rows_locked: 19816884
trx_rows_modified: 19178758
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
2 rows in set (0.13 sec) ERROR:
No query specified

show processlist 输出ID 和 information_schema.PROCESSLIST 的id,information_schema.innodb_trx的TRX_MYSQL_T的更多相关文章

  1. Andriod学习笔记2:“Your content must have a ListView whose id attribute is 'android.R.id.list'”问题的解决办法

    问题描述 activity_main.xml代码如下: <?xml version="1.0" encoding="utf-8"?> <Lin ...

  2. [BUG集] android 安卓项目中ORMLITE框架 Must specify one of id, generatedId, and generatedIdSequence with Id

    使用ORM框架ORMLITE有一段时间,今天在操作一个对象的时候,重新运行报错如下: Must specify one of id, generatedId, and generatedIdSeque ...

  3. 免费开发者证书真机调试App ID失效问题:"Unable to add App ID because the '10' App ID limit in '7' days has been exceeded."解决方案(5月5号)

    免费开发者证书真机调试App ID失效问题:"Unable to add App ID because the '10' App ID limit in '7' days has been ...

  4. Android Your content must have a ListView whose id attribute is 'android.R.id.list'错误的解决办法

    在Android开发中,ListView有着很重要的地位,使用的场合也非常的多 错误提示:Your content must have a ListView whose id attribute is ...

  5. Unable to add App ID because the '10' App ID limit in '7' days has been exceeded.

    Unable to add App ID because the '10' App ID limit in '7' days has been exceeded. 官方的原因是对bundle iden ...

  6. 获取json对象的id或者根据name获取id

    --用json的时候,知道id获取对应的name或者相反根据name获取id --内核代码 <script> var products=[{ID:1,Name:"a", ...

  7. linux系统学习笔记:无死角理解保存的设置用户ID,设置用户ID位,有效用户ID,实际用户ID

    一.基本概念 实际用户ID(RUID):用于标识一个系统中用户是谁,一般是在登录之后,就被唯一的确定,就是登录的用户的uid. 有效用户ID(EUID):用于系统决定用户对系统资源的权限,也就是说当用 ...

  8. hibernate利用mysql的自增张id属性实现自增长id和手动赋值id并存

    我们知道在mysql中如果设置了表id为自增长属性的话,insert语句中如果对id赋值(值没有被用到过)了,则插入的数据的id会为用户设置的值,并且该表的id的最大值会重新计算,以插入后表的id最大 ...

  9. 初学时遇到的小问题Your content must have a ListView whose id attribute is 'android.R.id.list'

    问题提出 错误提示:Your content must have a ListView whose id attribute is 'android.R.id.list' 关于解决Your conte ...

随机推荐

  1. MVC中的统一验证机制

    using MvcApplication2.Models;using System;using System.Collections.Generic;using System.ComponentMod ...

  2. 利用SQL语句给字段加注释

    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色Id',--注释名称 @level0type=N'SCHEMA' ...

  3. js一些算法实现

    1.约瑟夫环实现 //附有调试 function joseph(n,p){ var arr=[]; for(var i=0;i<n;i++){ arr.push(i); } debugger; ...

  4. SQL Server调优系列基础篇 - 并行运算总结(二)

    前言 上一篇文章我们介绍了查看查询计划的并行运行方式. 本篇我们接着分析SQL Server的并行运算. 闲言少叙,直接进入本篇的正题. 技术准备 同前几篇一样,基于SQL Server2008R2版 ...

  5. 产品原型设计5:移动App原型设计神器 - POP(Prototyping on Paper)

    一般来说,苦逼的互联网产品经理们都知道 Axure 这个原型设计工具,一方面是因为它提供了足够简单的拖拽操作,易上手,且有很多模板方便复用:另一方是因为它可直接输出html,直接在浏览器里给团队成员和 ...

  6. 常见错误总结_1_对java类进行修改后,无法按修改的类型加载

    1.这是因为没有run的原因,对类进行修改一定要run一遍 2.至于要不要重新tomcat部署,取决于你是修改了变量还是方法,拿不定的时候都重新加载一遍看看.

  7. jquery杂记之checkbox控制select置灰

    jquery: $(function(){ $("#avg_day_live").bind("click",function(){   //点击 if($(&q ...

  8. JS获取日期和时间

    //获取日期和时间 function showDate(){ var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFul ...

  9. 浅谈break 、continue、return,goto四种语句的区别。

    浅谈break .continue.return三种语句的区别: break,continue,return这三个具有跳转功能的语句在c语言中经常被用到,近期身边有些小伙伴总是把它们的用法搞乱,在这里 ...

  10. javascript 内置对象 第17节

    <html> <head> <title>内置对象</title> </head> <body> <div>内置对象 ...