mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.5' into 10.6
This commit is contained in:
@ -348,6 +348,12 @@ void thd_clear_errors(THD *thd)
|
||||
}
|
||||
|
||||
|
||||
extern "C" unsigned long long thd_query_id(const MYSQL_THD thd)
|
||||
{
|
||||
return((unsigned long long)thd->query_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get thread attributes for connection threads
|
||||
|
||||
@ -4983,6 +4989,55 @@ extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen)
|
||||
}
|
||||
|
||||
|
||||
extern "C" const char *thd_user_name(MYSQL_THD thd)
|
||||
{
|
||||
if (!thd->security_ctx)
|
||||
return 0;
|
||||
|
||||
return thd->security_ctx->user;
|
||||
}
|
||||
|
||||
|
||||
extern "C" const char *thd_client_host(MYSQL_THD thd)
|
||||
{
|
||||
if (!thd->security_ctx)
|
||||
return 0;
|
||||
|
||||
return thd->security_ctx->host;
|
||||
}
|
||||
|
||||
|
||||
extern "C" const char *thd_client_ip(MYSQL_THD thd)
|
||||
{
|
||||
if (!thd->security_ctx)
|
||||
return 0;
|
||||
|
||||
return thd->security_ctx->ip;
|
||||
}
|
||||
|
||||
|
||||
extern "C" LEX_CSTRING *thd_current_db(MYSQL_THD thd)
|
||||
{
|
||||
return &thd->db;
|
||||
}
|
||||
|
||||
|
||||
extern "C" int thd_current_status(MYSQL_THD thd)
|
||||
{
|
||||
Diagnostics_area *da= thd->get_stmt_da();
|
||||
if (!da)
|
||||
return 0;
|
||||
|
||||
return da->is_error() ? da->sql_errno() : 0;
|
||||
}
|
||||
|
||||
|
||||
extern "C" enum enum_server_command thd_current_command(MYSQL_THD thd)
|
||||
{
|
||||
return thd->get_command();
|
||||
}
|
||||
|
||||
|
||||
extern "C" int thd_slave_thread(const MYSQL_THD thd)
|
||||
{
|
||||
return(thd->slave_thread);
|
||||
|
Reference in New Issue
Block a user