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

     1  drop database if exists db1;
     2  create database db1;
     3  use db1;
     4  drop table if exists tb_empt6;
     5  drop table if exists tb_dept1;
     6  CREATE TABLE tb_dept1(id INT(11) PRIMARY KEY, name VARCHAR(22) NOT NULL,location VARCHAR(50) );
     7  CREATE TABLE tb_emp6 (id INT(11) PRIMARY KEY,name VARCHAR(25),deptId INT(11),salary FLOAT,CONSTRAINT fk_emp_dept1 FOREIGN KEY(deptId) REFERENCES tb_dept1(id) );
     8  desc tb_emp6;
     9  Field    Type    Null    Key    Default    Extra    Comment
    10  id    INT(32)    NO    PRI    null        
    11  name    VARCHAR(25)    YES        null        
    12  deptid    INT(32)    YES    MUL    null        
    13  salary    FLOAT(0)    YES        null        
    14  show create table tb_emp6;
    15  Table    Create Table
    16  tb_emp6    CREATE TABLE `tb_emp6` (\n`id` INT NOT NULL,\n`name` VARCHAR(25) DEFAULT NULL,\n`deptid` INT DEFAULT NULL,\n`salary` FLOAT DEFAULT NULL,\nPRIMARY KEY (`id`),\nCONSTRAINT `fk_emp_dept1` FOREIGN KEY (`deptid`) REFERENCES `tb_dept1` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n)
    17  drop database if exists db2;
    18  create database db2;
    19  use db2;
    20  drop table if exists t1;
    21  drop table if exists t2;
    22  create table t1(a int primary key, b varchar(5));
    23  create table t2(a int ,b varchar(5), c int, constraint `c1` foreign key(c) references t1(a));
    24  desc t2;
    25  Field    Type    Null    Key    Default    Extra    Comment
    26  a    INT(32)    YES        null        
    27  b    VARCHAR(5)    YES        null        
    28  c    INT(32)    YES    MUL    null        
    29  show create table t2;
    30  Table    Create Table
    31  t2    CREATE TABLE `t2` (\n`a` INT DEFAULT NULL,\n`b` VARCHAR(5) DEFAULT NULL,\n`c` INT DEFAULT NULL,\nCONSTRAINT `c1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON DELETE RESTRICT ON UPDATE RESTRICT\n)