Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MySQL SELECT ... FOR SHARE 会不会分配事务id ? #2682

kaiser20106 started this conversation in General
Discussion options

已知
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啊

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /