• gshchepa/uchum@gleb.loc's avatar
    Fixed bug #28000. · 848f56b0
    gshchepa/uchum@gleb.loc authored
    Bug occurs in INSERT IGNORE ... SELECT ... ON DUPLICATE KEY UPDATE
    statements, when SELECT returns duplicated values and UPDATE clause
    tries to assign NULL values to NOT NULL fields.
    NOTE: By current design MySQL server treats INSERT IGNORE ... ON
    DUPLICATE statements as INSERT ... ON DUPLICATE with update of
    duplicated records, but MySQL manual lacks this information.
    After this fix such behaviour becomes legalized.
    
    The write_record() function was returning error values even within
    INSERT IGNORE, because ignore_errors parameter of
    the fill_record_n_invoke_before_triggers() function call was
    always set to FALSE. FALSE is replaced by info->ignore.
    848f56b0
insert_update.test 8.47 KB