summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 411f793d613..3d5ba98c609 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5042,7 +5042,8 @@ int Field_timestamp_with_dec::set_time()
{
THD *thd= get_thd();
set_notnull();
- store_TIME(thd->query_start(), thd->query_start_sec_part());
+ // Avoid writing microseconds into binlog for FSP=0
+ store_TIME(thd->query_start(), decimals() ? thd->query_start_sec_part() : 0);
return 0;
}