summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 060dc14be10..887177c0a19 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1141,6 +1141,13 @@ bool Protocol_prep::store_time(TIME *tm)
field_pos++;
pos= buff+1;
pos[0]= tm->neg ? 1 : 0;
+ if (tm->hour >= 24)
+ {
+ /* Fix if we come from Item::send */
+ uint days= tm->hour/24;
+ tm->hour-= days*24;
+ tm->day+= days;
+ }
int4store(pos+1, tm->day);
pos[5]= (uchar) tm->hour;
pos[6]= (uchar) tm->minute;