mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Bug#27127, Incorrect behaviour of timestamp column with DEFAULT CURRENT_TIMESTAMP
correct the bitmap_set_bit when a field is timestamp and described with default CURRENT_TIMESTAMP or on update CURRENT_TIMESTAMP, then it will reduce a little time cost when the field doesnot need to write. sql/sql_update.cc: here table->timestamp_field represent only the timestamp field related to CURRENT_TIMESTAMP, when the timestamp_field_type is 0 or 1, it need not to write the field data further.
This commit is contained in:
parent
7af5a3e977
commit
774a19554b
1 changed files with 4 additions and 2 deletions
|
|
@ -201,8 +201,10 @@ int mysql_update(THD *thd,
|
|||
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
|
||||
else
|
||||
{
|
||||
bitmap_set_bit(table->write_set,
|
||||
table->timestamp_field->field_index);
|
||||
if (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE ||
|
||||
table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH)
|
||||
bitmap_set_bit(table->write_set,
|
||||
table->timestamp_field->field_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue