summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-12-08 16:10:44 +0400
committerAlexander Barkov <bar@mariadb.com>2018-12-08 19:17:29 +0400
commita25ce5ab4b38f0557abba8c5eb71b0839dc1ec4b (patch)
treed316c68e99f3443f091f9a70eacbe83a7b9642ac /sql/field.h
parentfac997feef048de877e39d1366871d5872c61710 (diff)
downloadmariadb-git-a25ce5ab4b38f0557abba8c5eb71b0839dc1ec4b.tar.gz
MDEV-17928 Conversion from TIMESTAMP to VARCHAR SP variables does not work well on fractional digits
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/field.h b/sql/field.h
index 6c0a981fc0a..19ab24bc2cb 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -784,7 +784,12 @@ public:
virtual int store(longlong nr, bool unsigned_val)=0;
virtual int store_decimal(const my_decimal *d)=0;
virtual int store_time_dec(const MYSQL_TIME *ltime, uint dec);
- virtual int store_timestamp(my_time_t timestamp, ulong sec_part);
+ virtual int store_timestamp_dec(const timeval &ts, uint dec);
+ int store_timestamp(my_time_t timestamp, ulong sec_part)
+ {
+ return store_timestamp_dec(Timeval(timestamp, sec_part),
+ TIME_SECOND_PART_DIGITS);
+ }
int store_time(const MYSQL_TIME *ltime)
{ return store_time_dec(ltime, TIME_SECOND_PART_DIGITS); }
int store(const char *to, size_t length, CHARSET_INFO *cs,
@@ -2744,7 +2749,7 @@ public:
int store(longlong nr, bool unsigned_val);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
int store_decimal(const my_decimal *);
- int store_timestamp(my_time_t timestamp, ulong sec_part);
+ int store_timestamp_dec(const timeval &ts, uint dec);
int save_in_field(Field *to);
double val_real(void);
longlong val_int(void);