InnoDB SELECT … FOR UPDATE statement locking all rows in a table

前端 未结 3 2020
無奈伤痛
無奈伤痛 2021-02-04 14:24

MySQL Server version 5.1.41 with InnoDB plugin enabled. I have the following three tables for invoices: invoices, invoice_components and invoice_expenses. Table invoices has inv

3条回答
  •  花落未央
    2021-02-04 15:02

    "For index records the search encounters, SELECT ... FROM ... FOR UPDATE blocks other sessions from doing SELECT ... FROM ... LOCK IN SHARE MODE or from reading in certain transaction isolation levels. Consistent reads will ignore any locks set on the records that exist in the read view"

    What are those certain locks which can be applied with select for update so that other sessions cannot read locked record?

提交回复
热议问题