summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/structs.h')
-rw-r--r--sql/structs.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/structs.h b/sql/structs.h
index c47e4802452..28c0cb6e1a2 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -871,7 +871,13 @@ public:
Timeval(my_time_t sec, ulong usec)
{
tv_sec= sec;
- tv_usec= usec;
+ /*
+ Since tv_usec is not always of type ulong, cast usec parameter
+ explicitly to uint to avoid compiler warnings about losing
+ integer precision.
+ */
+ DBUG_ASSERT(usec < 1000000);
+ tv_usec= (uint)usec;
}
explicit Timeval(const timeval &tv)
:timeval(tv)