mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge
configure.in: Auto merged mysql-test/mysql-test-run.sh: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged Docs/manual.texi: SCCS merged
This commit is contained in:
@ -119,6 +119,7 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
|
||||
|
||||
SYNOPSIS
|
||||
acl_init()
|
||||
thd Thread handler
|
||||
dont_read_acl_tables Set to 1 if run with --skip-grant
|
||||
|
||||
RETURN VALUES
|
||||
@ -127,9 +128,9 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
|
||||
*/
|
||||
|
||||
|
||||
my_bool acl_init(bool dont_read_acl_tables)
|
||||
my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
||||
{
|
||||
THD *thd, *org_thd;
|
||||
THD *thd;
|
||||
TABLE_LIST tables[3];
|
||||
TABLE *table;
|
||||
READ_RECORD read_record_info;
|
||||
@ -147,7 +148,6 @@ my_bool acl_init(bool dont_read_acl_tables)
|
||||
/*
|
||||
To be able to run this from boot, we allocate a temporary THD
|
||||
*/
|
||||
org_thd=current_thd; // Save for restore
|
||||
if (!(thd=new THD))
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
thd->store_globals();
|
||||
@ -339,6 +339,11 @@ end:
|
||||
delete thd;
|
||||
if (org_thd)
|
||||
org_thd->store_globals(); /* purecov: inspected */
|
||||
else
|
||||
{
|
||||
/* Remember that we don't have a THD */
|
||||
my_pthread_setspecific_ptr(THR_THD, 0);
|
||||
}
|
||||
DBUG_RETURN(return_val);
|
||||
}
|
||||
|
||||
@ -385,7 +390,7 @@ void acl_reload(THD *thd)
|
||||
delete_dynamic(&acl_wild_hosts);
|
||||
hash_free(&acl_check_hosts);
|
||||
|
||||
if (acl_init(0))
|
||||
if (acl_init(thd, 0))
|
||||
{ // Error. Revert to old list
|
||||
acl_free(); /* purecov: inspected */
|
||||
acl_hosts=old_acl_hosts;
|
||||
@ -2273,9 +2278,9 @@ void grant_free(void)
|
||||
|
||||
/* Init grant array if possible */
|
||||
|
||||
my_bool grant_init(void)
|
||||
my_bool grant_init(THD *org_thd)
|
||||
{
|
||||
THD *thd, *org_thd;
|
||||
THD *thd;
|
||||
TABLE_LIST tables[2];
|
||||
MYSQL_LOCK *lock;
|
||||
my_bool return_val= 1;
|
||||
@ -2291,7 +2296,6 @@ my_bool grant_init(void)
|
||||
if (!initialized)
|
||||
DBUG_RETURN(0); /* purecov: tested */
|
||||
|
||||
org_thd=current_thd;
|
||||
if (!(thd=new THD))
|
||||
DBUG_RETURN(1); /* purecov: deadcode */
|
||||
thd->store_globals();
|
||||
@ -2349,13 +2353,18 @@ end:
|
||||
delete thd;
|
||||
if (org_thd)
|
||||
org_thd->store_globals();
|
||||
else
|
||||
{
|
||||
/* Remember that we don't have a THD */
|
||||
my_pthread_setspecific_ptr(THR_THD, 0);
|
||||
}
|
||||
DBUG_RETURN(return_val);
|
||||
}
|
||||
|
||||
|
||||
/* Reload grant array if possible */
|
||||
|
||||
void grant_reload(void)
|
||||
void grant_reload(THD *thd)
|
||||
{
|
||||
HASH old_hash_tables;bool old_grant_option;
|
||||
MEM_ROOT old_mem;
|
||||
@ -2369,7 +2378,7 @@ void grant_reload(void)
|
||||
old_grant_option = grant_option;
|
||||
old_mem = memex;
|
||||
|
||||
if (grant_init())
|
||||
if (grant_init(thd))
|
||||
{ // Error. Revert to old hash
|
||||
grant_free(); /* purecov: deadcode */
|
||||
hash_tables=old_hash_tables; /* purecov: deadcode */
|
||||
|
Reference in New Issue
Block a user