github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/foreign_key/fk_self_refer5.result (about)

     1  drop database if exists fk_self_refer5;
     2  create database fk_self_refer5;
     3  use fk_self_refer5;
     4  create table names(id int PRIMARY KEY,name VARCHAR(255),age int,b int,constraint `c1` foreign key (b) references names(id));
     5  replace into names(id, name, age, b) values(1,"Abby", 24,1);
     6  replace into names(id, name, age, b) values(3,"Abby", 24,2);
     7  Cannot add or update a child row: a foreign key constraint fails
     8  replace into names(id, name, age, b) values(3,"Abby", 24,1);
     9  replace into names(id, name, age) values(1,"Bobby", 25);
    10  internal error: Cannot delete or update a parent row: a foreign key constraint fails
    11  replace into names set id = 2, name = "Ciro";
    12  replace into names set id = 2, name = "Ciro", b = 3;
    13  replace into names set id = 2, name = "Ciro", b = 5;
    14  Cannot add or update a child row: a foreign key constraint fails
    15  replace INTO names values (2, "Bob", 19,NULL);
    16  replace INTO names values (2, "Bobx", 19,4);
    17  Cannot add or update a child row: a foreign key constraint fails
    18  replace INTO names values (1, "Bobx", 19,2);
    19  internal error: Cannot delete or update a parent row: a foreign key constraint fails
    20  replace INTO names values (2, "Bobx", 19,3);
    21  replace INTO names values (2, "Bobx", 19,1);
    22  replace INTO names values (2, "Bobx", 19,3);
    23  replace INTO names values (3, "Jack", 19,2);
    24  internal error: Cannot delete or update a parent row: a foreign key constraint fails
    25  replace INTO names values (1, "Join", 19,2);
    26  internal error: Cannot delete or update a parent row: a foreign key constraint fails
    27  drop table if exists names;
    28  drop database if exists fk_self_refer5;