• Chad MILLER's avatar
    Bug#38272: timestamps fields incorrectly defaulted on \ · 35c8b4c5
    Chad MILLER authored
    	update accross partitions.
          
    It's not Innodb-specific bug.
    ha_partition::update_row() didn't set
    table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET when
    orig_timestamp_type == TIMESTAMP_AUTO_SET_ON_INSERT.
    
    So that a partition sets the timestamp field when a record
    is moved to a different partition.
    
    Fixed by doing '= TIMESTAMP_NO_AUTO_SET' unconditionally.
    Also ha_partition::write_row() is fixed in same way as now
    Field_timestamp::set() is called twice in SET_ON_INSERT case.
    
    (Chad queues this patch on demand by Trudy/Davi.)
    
    mysql-test/r/partition.result:
      Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
      test result
    mysql-test/t/partition.test:
      Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
      test case
    sql/ha_partition.cc:
      Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
      Do table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET unconditionally
      in ha_partition::update_row and ::write_row()
    35c8b4c5
partition.test 46.5 KB