Skip to content

Unistore TiDB cannot handle foreign key in transaction #56663

@YangKeao

Description

@YangKeao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare:

create table parent (id int primary key);
create table child(id int primary key, ref int, foreign key (ref) references parent(id));

insert into parent values (1);

Execute:

Transaction 1 Transaction 2
BEGIN; BEGIN;
INSERT INTO child VALUES (1, 1);
UPDATE parent SET id = 2 WHERE id = 1
COMMIT;
COMMIT;

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

UPDATE in transaction 2 failed.

3. What did you see instead (Required)

UPDATE in transaction 2 success.

4. What is your TiDB version? (Required)

master fa723c, with unistore.

This issue cannot be reproduced in TiKV store.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions