Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -3289,7 +3289,16 @@ class THD: public THD_count, /* this must be first */
void reset(THD *thd)
{
tv_sec= thd->query_start();
tv_usec= (long) thd->query_start_sec_part();

/*
The type of tv_usec depends on the system and on macOS
it is __darwin_suseconds_t. Using decltype is system
agnostic because its result is whatever the underlying
type of tv_usec is. This should be more portable than
assuming that the left hand side is (long) (the previous
cast value).
*/
tv_usec= static_cast<decltype(tv_usec)>(thd->query_start_sec_part());
}
} start_time;

Expand Down