summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <Justin.He/justin.he@dev3-240.dev.cn.tlan>2007-03-22 12:16:52 +0800
committerunknown <Justin.He/justin.he@dev3-240.dev.cn.tlan>2007-03-22 12:16:52 +0800
commit774a19554b10c03adcfc6e7202252c6075ef6c62 (patch)
tree3afe731d875d7fcc1fa752ae555942c162b7edf9 /sql/sql_update.cc
parent7af5a3e977fed2603efd68f898d018a40a77e5a2 (diff)
downloadmariadb-git-774a19554b10c03adcfc6e7202252c6075ef6c62.tar.gz
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.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 5aea05a9d39..bae1f8e9210 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -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);
}
}