• Marko Mäkelä's avatar
    Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR · 57923469
    Marko Mäkelä authored
    In the ON UPDATE CASCADE clause of FOREIGN KEY constraints, the
    calculated update vector was not fully initialized. This bug was
    introduced in the InnoDB Plugin when implementing support for
    ROW_FORMAT=DYNAMIC.
    
    Additionally, the data type information was not initialized, but
    apparently it has never been needed in this case.  Nevertheless, it is
    not good programming practice to pass uninitialized values around.
    
    calc_row_difference(): Declare the update field uninitialized in
    Valgrind. Copy the data type information as well, except when the
    field is SQL NULL. In the built-in InnoDB, initialize
    ufield->extern_storage = FALSE (an initialization bug that had gone
    unnoticed this far). The InnoDB Plugin and later have this flag to
    dfield_t and have always initialized it properly.
    
    row_ins_cascade_calc_update_vec(): Reduce the scope of some
    pointers. Initialize orig_len. (This caused the bug in InnoDB Plugin
    and later.)
    
    row_ins_foreign_check_on_constraint(): Simplify a condition. Declare
    the update vector uninitialized.
    
    rb:771 approved by Jimmy Yang
    57923469
innodb.result 67.2 KB