"Does TiDB support select for update?
Yes. But it differs from MySQL in syntax. As a distributed database, TiDB uses the optimistic lock. select for update does not lock data when the transaction is started, but checks conflicts when the transaction is committed. If the check reveals conflicts, the committing transaction rolls back."
2. What did you expect to see?
With the introduction of pessimistic transactions, this behavior is configuration dependent. The text no longer describes the default behavior.
3. What did you see instead?
Text indicates TiDB only supports optimistic transactions still.
4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)
Bug Report
1. What did you do?
On this page: https://pingcap.com/docs/stable/faq/tidb/#does-tidb-support-select-for-update
"Does TiDB support select for update? Yes. But it differs from MySQL in syntax. As a distributed database, TiDB uses the optimistic lock. select for update does not lock data when the transaction is started, but checks conflicts when the transaction is committed. If the check reveals conflicts, the committing transaction rolls back."
2. What did you expect to see?
With the introduction of pessimistic transactions, this behavior is configuration dependent. The text no longer describes the default behavior.
3. What did you see instead?
Text indicates TiDB only supports optimistic transactions still.
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)Docs bug.