1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

System Versioning pre0.12

Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
This commit is contained in:
Aleksey Midenkov
2017-11-07 00:37:49 +03:00
354 changed files with 20615 additions and 1638 deletions

View File

@ -710,6 +710,11 @@ extern "C" void thd_kill_timeout(THD* thd)
mysql_mutex_unlock(&thd->LOCK_thd_data);
}
Time_zone * thd_get_timezone(THD * thd)
{
DBUG_ASSERT(thd && thd->variables.time_zone);
return thd->variables.time_zone;
}
THD::THD(my_thread_id id, bool is_wsrep_applier)
:Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION,
@ -3700,6 +3705,7 @@ void Query_arena::set_query_arena(Query_arena *set)
mem_root= set->mem_root;
free_list= set->free_list;
state= set->state;
is_stored_procedure= set->is_stored_procedure;
}
@ -4772,12 +4778,18 @@ extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
return thd->rgi_slave && thd->rgi_slave->is_parallel_exec;
}
/* Returns high resolution timestamp for the start
of the current query. */
extern "C" time_t thd_start_time(const MYSQL_THD thd)
{
return thd->start_time;
}
/* Returns high resolution timestamp for the start
of the current query. */
extern "C" unsigned long long thd_start_utime(const MYSQL_THD thd)
{
return thd->start_utime;
return thd->start_time * 1000000 + thd->start_time_sec_part;
}
@ -7051,6 +7063,15 @@ static bool protect_against_unsafe_warning_flood(int unsafe_type)
DBUG_RETURN(unsafe_warning_suppression_active[unsafe_type]);
}
MYSQL_TIME THD::query_start_TIME()
{
MYSQL_TIME res;
variables.time_zone->gmt_sec_to_TIME(&res, query_start());
res.second_part= query_start_sec_part();
time_zone_used= 1;
return res;
}
/**
Auxiliary method used by @c binlog_query() to raise warnings.
@ -7670,3 +7691,16 @@ void Database_qualified_name::copy(MEM_ROOT *mem_root,
#endif /* !defined(MYSQL_CLIENT) */
Query_arena_stmt::Query_arena_stmt(THD *_thd) :
thd(_thd)
{
arena= thd->activate_stmt_arena_if_needed(&backup);
}
Query_arena_stmt::~Query_arena_stmt()
{
if (arena)
thd->restore_active_arena(arena, &backup);
}