• Mattias Jonsson's avatar
    Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails · 2737a722
    Mattias Jonsson authored
               but the statement is written to binlog
    
    TRUNCATE PARTITION was written to the binlog
    even if it failed before calling any partition's
    truncate function.
    
    Solved by adding an argument to truncate_partition,
    to flag if it should be written to the binlog or not.
    
    It should be written to the binlog when a call to any
    partitions truncate function is done.
    
    mysql-test/r/partition_binlog.result:
      New result file
    mysql-test/t/partition_binlog.test:
      New test file, including DROP PARTITION binlog test
    sql/ha_partition.cc:
      Added argument to avoid binlogging failed truncate_partition that
      have not yet changed any data.
    sql/ha_partition.h:
      Added argument to avoid excessive binlogging
    sql/sql_partition_admin.cc:
      Avoid to binlog TRUNCATE PARTITION if it fails before
      any partition has tried to truncate.
    2737a722
sql_partition_admin.cc 5.91 KB