-
Notifications
You must be signed in to change notification settings - Fork 46k
MySQL SELECT ... FOR SHARE 会不会分配事务id ? #2682
kaiser20106
started this conversation in
General
-
已知
A transaction ID is only needed for a transaction that might perform write operations or locking reads such as SELECT ... FOR UPDATE.
START TRANSACTION;
SELECT * FROM table -- trx_id 283911508463232
SELECT * FROM table for share -- 283911508463232
SELECT * FROM table for update -- 93004
-- 查询当前会话是否存在活跃事务
SELECT * FROM information_schema.innodb_trx WHERE trx_mysql_thread_id = CONNECTION_ID();
加了for share 跟普通select trx_id一样,如果说不分配事务id,那上面的mysql原文怎么理解,locking reads包括for share和 FOR UPDATE啊
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment