Skip to content

MERGE INTO fails with an error "Timeout trying to lock table" #2834

@mrigger

Description

@mrigger

Consider the following statements:

CREATE TABLE T0(c0 BOOL, PRIMARY KEY(c0));
MERGE INTO T0(C0) VALUES (TRUE);
MERGE INTO T0(C0) VALUES (2); -- Timeout trying to lock table {0};

Unexpectedly, the second MERGE INTO results in the following error:

Caused by: org.h2.message.DbException: Concurrent update in table "T0": another transaction has updated or deleted the same row [90131-201]
    at org.h2.message.DbException.get(DbException.java:200)
    at org.h2.message.DbException.get(DbException.java:176)
    at org.h2.command.dml.Merge.merge(Merge.java:224)
    at org.h2.command.dml.Merge.update(Merge.java:110)
    at org.h2.command.dml.DataChangeStatement.update(DataChangeStatement.java:45)
    at org.h2.command.CommandContainer.update(CommandContainer.java:173)
    at org.h2.command.Command.executeUpdate(Command.java:250)

I found this based on commit 073bbb8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions