• Nuno Carvalho's avatar
    BUG#12669186: AUTOINC VALUE PERSISTENCY BREAKS CERTAIN REPLICATION SCENARIOS · 16c9c144
    Nuno Carvalho authored
    When master and slave have different schemas, in particular different
    AUTO_INCREMENT columns, INSERT_ID events logged for a given table on
    master may be applied to a different table on slave on SBR, e.g.:
      master has one table (t1) with one auto-inc column and another table
      (t2) without auto-inc column, on slave t1 does not have auto-inc
      column (despite having the same columns) and t2 has a auto-inc
      column. The INSERT_ID that is intended for t1, since t1 on slave
      doesn't have auto-inc column is used on t2, causing consistency
      problems.
    
    To fix this incorrect behaviour, auto-inc interval allocation via
    INSERT_ID is made effectively terminated at the end of top-level
    statements on slave and binlog replay.
    16c9c144
sql_class.cc 149 KB