• unknown's avatar
    Fixed bug #28000. · 36190568
    unknown 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.
    
    
    sql/sql_insert.cc:
      Fixed bug #28000:
      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.
    mysql-test/t/insert_update.test:
      Added test case for bug #28000.
    mysql-test/r/insert_update.result:
      Added test case for bug #28000.
    36190568
insert_update.result 9.33 KB