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.
This commit is contained in:
Sergei Golubchik 2019-02-13 14:26:02 +01:00
parent c568e25379
commit 1d8b5524f4
2 changed files with 6 additions and 5 deletions

View File

@ -6796,7 +6796,12 @@ int Field_datetime::set_time()
THD *thd= table->in_use;
set_notnull();
// 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;
}

View File

@ -3455,10 +3455,6 @@ public:
inline ulong query_start_sec_part()
{ query_start_sec_part_used=1; return start_time_sec_part; }
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
{
return variables.sql_mode & MODE_TIME_ROUND_FRACTIONAL ?