Skip to content

NOWAIT does not have effect in pessimistic locking #32754

@sticnarf

Description

@sticnarf

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t (id BIGINT PRIMARY KEY);
INSERT INTO t VALUES (1);
BEGIN;
SELECT * FROM t WHERE id = 1 FOR UPDATE;

In another session:

BEGIN;
SELECT * FROM t WHERE id = 1 FOR UPDATE NOWAIT;

2. What did you expect to see? (Required)

In the second session, it should return error immediately.

3. What did you see instead (Required)

One second passed before an error is returned.

4. What is your TiDB version? (Required)

TiDB 5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions