【 Bug 的影响】
union all 结果不对
【可能的问题复现步骤】
事务1:
begin;
select * from t1 where a=2 for update;
事务2:
begin;
select * from t1 where a=2 for update;
事务3:
(select t1.TRX_ID,“WAIT LOCK”,t1.KEY_INFO,t2.INSTANCE,t2.SESSION_ID,t2.STATE,t2.CURRENT_SQL_DIGEST_TEXT from DATA_LOCK_WAITS t1 join CLUSTER_TIDB_TRX t2 on t1.TRX_ID=t2.ID)\G
(select t1.TRX_ID,“WAIT LOCK”,t1.KEY_INFO,t2.INSTANCE,t2.SESSION_ID,t2.STATE,t2.CURRENT_SQL_DIGEST_TEXT from DATA_LOCK_WAITS t1 join CLUSTER_TIDB_TRX t2 on t1.TRX_ID=t2.ID)
union all
(select t1.CURRENT_HOLDING_TRX_ID,“HOLD LOCK”,t1.KEY_INFO,t2.INSTANCE,t2.SESSION_ID,t2.STATE,t2.CURRENT_SQL_DIGEST_TEXT from DATA_LOCK_WAITS t1 join CLUSTER_TIDB_TRX t2 on t1.CURRENT_HOLDING_TRX_ID=t2.ID)\G
【看到的非预期行为】
STATE字段值丢失了:
【期望看到的行为】
【相关组件及具体版本】
5.7.25-TiDB-v5.2.2 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible
Cluster