查询:
SELECT
trx_id,
trx_state,
timestampdiff(
SECOND,
trx_started,
now()
) duration,
trx_query
FROM information_schema.INNODB_TRX;
结果:
trx_id trx_state duration trx_query
329182111765896 RUNNING 25043
7511439990 RUNNING 26
7511442157 LOCK WAIT 22 select * from...
7511442102 LOCK WAIT 22 update `xxx` set ...
329182111487256 RUNNING 0 select * from ...
我注意到一个非常有趣的交易:
329182111765896 RUNNING 25043
这是一个运行很长时间的事务,其trx_query为null。怎么会这样该交易的可能原因是什么?