• Rohit Kalhans's avatar
    BUG#11765650 - 58637: MARK UPDATES THAT DEPEND ON ORDER OF TWO KEYS UNSAFE · 1a02c266
    Rohit Kalhans authored
          
     Description: When the table has more than one unique or primary key, 
     INSERT... ON DUP KEY UPDATE statement is sensitive to the order in which
     the storage engines checks the keys. Depending on this order, the storage
     engine may determine different rows to mysql, and hence mysql can update
     different rows on master and slave.
          
     Solution: We mark INSERT...ON DUP KEY UPDATE on a table with more than on unique
     key as unsafe therefore the event will be logged in row format if it is available
     (ROW/MIXED). If only STATEMENT format is available, a warning will be thrown. 
    
    mysql-test/suite/binlog/r/binlog_unsafe.result:
      Updated result file
    mysql-test/suite/binlog/t/binlog_unsafe.test:
      Added test to check  for warning being thrown when the unsafe statement is executed
    mysql-test/suite/rpl/r/rpl_known_bugs_detection.result:
      Updated result file
    sql/share/errmsg-utf8.txt:
      Added new warning message
    sql/sql_base.cc:
      check for tables in the query with more than one UNIQUE KEY and INSERT ON DUPLICATE KEY UPDATE, and mark such statements unsafe.
    1a02c266
sql_base.cc 303 KB