From fc3e6cce7f785b6ad3ace480b52190869c16629a Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Mon, 22 Jun 2026 14:35:14 +0900 Subject: [PATCH 1/3] pessimistic-transaction: clarify Point Get lock behavior under RC and RR --- pessimistic-transaction.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pessimistic-transaction.md b/pessimistic-transaction.md index 0e70754e59a61..c71b7d249e9f3 100644 --- a/pessimistic-transaction.md +++ b/pessimistic-transaction.md @@ -79,6 +79,10 @@ Pessimistic transactions in TiDB behave similarly to those in MySQL. See the min - If the `Point Get` and `Batch Point Get` operators do not read data, they still lock the given primary key or unique key, which blocks other transactions from locking or writing data to the same primary key or unique key. + > **Note:** + > + > This behavior applies only to the `REPEATABLE READ` isolation level. Under the `READ COMMITTED` isolation level, `Point Get` and `Batch Point Get` operators do not lock non-existent keys. + - TiDB supports the `FOR UPDATE OF TABLES` syntax. For a statement that joins multiple tables, TiDB only applies pessimistic locks on the rows that are associated with the tables in `OF TABLES`. ## Differences from MySQL InnoDB From 2d97cde358bb064ae86537bc87f49d725ece6ee4 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 24 Jun 2026 10:18:59 +0900 Subject: [PATCH 2/3] Update pessimistic-transaction.md Co-authored-by: Grace Cai --- pessimistic-transaction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pessimistic-transaction.md b/pessimistic-transaction.md index c71b7d249e9f3..814dd2fe9c011 100644 --- a/pessimistic-transaction.md +++ b/pessimistic-transaction.md @@ -81,7 +81,7 @@ Pessimistic transactions in TiDB behave similarly to those in MySQL. See the min > **Note:** > - > This behavior applies only to the `REPEATABLE READ` isolation level. Under the `READ COMMITTED` isolation level, `Point Get` and `Batch Point Get` operators do not lock non-existent keys. + > This behavior applies only to the [Repeatable Read](/transaction-isolation-levels.md#repeatable-read-isolation-level) isolation level. Under the `READ COMMITTED` isolation level, `Point Get` and `Batch Point Get` operators do not lock non-existent keys. - TiDB supports the `FOR UPDATE OF TABLES` syntax. For a statement that joins multiple tables, TiDB only applies pessimistic locks on the rows that are associated with the tables in `OF TABLES`. From 2cea15c869cc643c6d39b30905aa6169278c0aa5 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 24 Jun 2026 18:10:04 +0800 Subject: [PATCH 3/3] Update pessimistic-transaction.md --- pessimistic-transaction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pessimistic-transaction.md b/pessimistic-transaction.md index 814dd2fe9c011..0f561676891a8 100644 --- a/pessimistic-transaction.md +++ b/pessimistic-transaction.md @@ -81,7 +81,7 @@ Pessimistic transactions in TiDB behave similarly to those in MySQL. See the min > **Note:** > - > This behavior applies only to the [Repeatable Read](/transaction-isolation-levels.md#repeatable-read-isolation-level) isolation level. Under the `READ COMMITTED` isolation level, `Point Get` and `Batch Point Get` operators do not lock non-existent keys. + > This behavior applies only to the [Repeatable Read](/transaction-isolation-levels.md#repeatable-read-isolation-level) isolation level. Under the [Read Committed](/transaction-isolation-levels.md#read-committed-isolation-level) isolation level, `Point Get` and `Batch Point Get` operators do not lock non-existent keys. - TiDB supports the `FOR UPDATE OF TABLES` syntax. For a statement that joins multiple tables, TiDB only applies pessimistic locks on the rows that are associated with the tables in `OF TABLES`.