1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Cleanup: moving timestamp_to_TIME() as a method to THD

This commit is contained in:
Alexander Barkov
2018-03-30 14:29:23 +04:00
parent 17bbab5fb0
commit 556a9202ce
3 changed files with 23 additions and 21 deletions

View File

@ -7788,3 +7788,22 @@ Query_arena_stmt::~Query_arena_stmt()
if (arena)
thd->restore_active_arena(arena, &backup);
}
bool THD::timestamp_to_TIME(MYSQL_TIME *ltime, my_time_t ts,
ulong sec_part, ulonglong fuzzydate)
{
time_zone_used= 1;
if (ts == 0 && sec_part == 0)
{
if (fuzzydate & TIME_NO_ZERO_DATE)
return 1;
set_zero_time(ltime, MYSQL_TIMESTAMP_DATETIME);
}
else
{
variables.time_zone->gmt_sec_to_TIME(ltime, ts);
ltime->second_part= sec_part;
}
return 0;
}