• Alexander Barkov's avatar
    MDEV-22579 No error when inserting DEFAULT(non_virtual_column) into a virtual column · 3df29727
    Alexander Barkov authored
    The code erroneously allowed both:
    INSERT INTO t1 (vcol) VALUES (DEFAULT);
    INSERT INTO t1 (vcol) VALUES (DEFAULT(non_virtual_column));
    
    The former is OK, but the latter is not.
    Adding a new virtual method in Item:
    
    virtual bool vcol_assignment_allowed_value() const { return false; }
    
    Item_null, Item_param and Item_default_value override it.
    
    Item_default_value overrides it in the way to:
    - allow DEFAULT
    - disallow DEFAULT(col)
    3df29727
vcol_misc.test 9.92 KB