• Aleksey Midenkov's avatar
    MDEV-20729 Fix REFERENCES constraint in column definition · daabc5cc
    Aleksey Midenkov authored
    Add support of referential constraints directly in column defininions:
    
    create table t1 (id1 int primary key);
    create table t2 (id2 int references t1(id1));
    
    Referenced field name can be omitted if equal to foreign field name:
    
    create table t1 (id int primary key);
    create table t2 (id int references t1);
    
    Until 10.5 this syntax was understood by the parser but was silently
    ignored.
    
    In case of generated columns this syntax is disabled at parser level
    by ER_PARSE_ERROR. Note that separate FOREIGN KEY clause for generated
    columns is disabled at storage engine level.
    daabc5cc
foreign_key.result 17.6 KB