Commit 1d8b5524 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove THD::query_start_timeval()

Too easy to abuse. One tends to use it even when
microseconds are not needed and will be ignored.
parent c568e253
...@@ -6796,7 +6796,12 @@ int Field_datetime::set_time() ...@@ -6796,7 +6796,12 @@ int Field_datetime::set_time()
THD *thd= table->in_use; THD *thd= table->in_use;
set_notnull(); set_notnull();
// Here we always truncate (not round), no matter what sql_mode is // Here we always truncate (not round), no matter what sql_mode is
store_datetime(Datetime(thd, thd->query_start_timeval()).trunc(decimals())); if (decimals())
store_datetime(Datetime(thd, Timeval(thd->query_start(),
thd->query_start_sec_part())
).trunc(decimals()));
else
store_datetime(Datetime(thd, Timeval(thd->query_start(), 0)));
return 0; return 0;
} }
......
...@@ -3455,10 +3455,6 @@ class THD: public THD_count, /* this must be first */ ...@@ -3455,10 +3455,6 @@ class THD: public THD_count, /* this must be first */
inline ulong query_start_sec_part() inline ulong query_start_sec_part()
{ query_start_sec_part_used=1; return start_time_sec_part; } { query_start_sec_part_used=1; return start_time_sec_part; }
MYSQL_TIME query_start_TIME(); MYSQL_TIME query_start_TIME();
Timeval query_start_timeval()
{
return Timeval(query_start(), query_start_sec_part());
}
time_round_mode_t temporal_round_mode() const time_round_mode_t temporal_round_mode() const
{ {
return variables.sql_mode & MODE_TIME_ROUND_FRACTIONAL ? return variables.sql_mode & MODE_TIME_ROUND_FRACTIONAL ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment