Commit 573c7322 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru Committed by Sergei Golubchik

open_grant_tables now also opens roles_mapping table

parent 071c4ce8
...@@ -6023,7 +6023,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc) ...@@ -6023,7 +6023,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc)
SYNOPSIS SYNOPSIS
open_grant_tables() open_grant_tables()
thd The current thread. thd The current thread.
tables (out) The 4 elements array for the opened tables. tables (out) The 7 elements array for the opened tables.
DESCRIPTION DESCRIPTION
Tables are numbered as follows: Tables are numbered as follows:
...@@ -6031,6 +6031,9 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc) ...@@ -6031,6 +6031,9 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc)
1 db 1 db
2 tables_priv 2 tables_priv
3 columns_priv 3 columns_priv
4 columns_priv
5 proxies_priv
6 roles_mapping
RETURN RETURN
1 Skip GRANT handling during replication. 1 Skip GRANT handling during replication.
...@@ -6038,7 +6041,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc) ...@@ -6038,7 +6041,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc)
< 0 Error. < 0 Error.
*/ */
#define GRANT_TABLES 6 #define GRANT_TABLES 7
int open_grant_tables(THD *thd, TABLE_LIST *tables) int open_grant_tables(THD *thd, TABLE_LIST *tables)
{ {
Rpl_filter *rpl_filter= thd->rpl_filter; Rpl_filter *rpl_filter= thd->rpl_filter;
...@@ -6066,13 +6069,19 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables) ...@@ -6066,13 +6069,19 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
(tables+5)->init_one_table(C_STRING_WITH_LEN("mysql"), (tables+5)->init_one_table(C_STRING_WITH_LEN("mysql"),
C_STRING_WITH_LEN("proxies_priv"), C_STRING_WITH_LEN("proxies_priv"),
"proxies_priv", TL_WRITE); "proxies_priv", TL_WRITE);
tables[5].open_strategy= TABLE_LIST::OPEN_IF_EXISTS; (tables+5)->open_strategy= TABLE_LIST::OPEN_IF_EXISTS;
(tables+6)->init_one_table(C_STRING_WITH_LEN("mysql"),
C_STRING_WITH_LEN("roles_mapping"),
"roles_mapping", TL_WRITE);
(tables+6)->open_strategy= TABLE_LIST::OPEN_IF_EXISTS;
tables->next_local= tables->next_global= tables + 1; tables->next_local= tables->next_global= tables + 1;
(tables+1)->next_local= (tables+1)->next_global= tables + 2; (tables+1)->next_local= (tables+1)->next_global= tables + 2;
(tables+2)->next_local= (tables+2)->next_global= tables + 3; (tables+2)->next_local= (tables+2)->next_global= tables + 3;
(tables+3)->next_local= (tables+3)->next_global= tables + 4; (tables+3)->next_local= (tables+3)->next_global= tables + 4;
(tables+4)->next_local= (tables+4)->next_global= tables + 5; (tables+4)->next_local= (tables+4)->next_global= tables + 5;
(tables+5)->next_local= (tables+5)->next_global= tables + 6;
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment