Commit 8ede9b3a authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-17975 Assertion `! is_set()' or `!is_set() || (m_status == DA_OK_BULK &&...

MDEV-17975 Assertion `! is_set()' or `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon REVOKE under LOCK TABLE

open_grant_tables() returns -1/0/1, where -1 is an error, while 1 is not.
Don't store it's return value in bool
parent dd72d7d5
...@@ -16,3 +16,10 @@ show grants for foo@'%'; ...@@ -16,3 +16,10 @@ show grants for foo@'%';
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql' ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
drop user test, foo; drop user test, foo;
drop role foo; drop role foo;
CREATE TABLE t1 (a INT);
LOCK TABLE t1 WRITE;
REVOKE EXECUTE ON PROCEDURE sp FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
REVOKE PROCESS ON *.* FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
DROP TABLE t1;
...@@ -23,3 +23,13 @@ show grants for foo@'%'; # user ...@@ -23,3 +23,13 @@ show grants for foo@'%'; # user
drop user test, foo; drop user test, foo;
drop role foo; drop role foo;
#
# MDEV-17975 Assertion `! is_set()' or `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon REVOKE under LOCK TABLE
#
CREATE TABLE t1 (a INT);
LOCK TABLE t1 WRITE;
--error ER_TABLE_NOT_LOCKED
REVOKE EXECUTE ON PROCEDURE sp FROM u;
--error ER_TABLE_NOT_LOCKED
REVOKE PROCESS ON *.* FROM u;
DROP TABLE t1;
...@@ -786,8 +786,7 @@ static const int Table_procs_priv= 1 << PROCS_PRIV_TABLE; ...@@ -786,8 +786,7 @@ static const int Table_procs_priv= 1 << PROCS_PRIV_TABLE;
static const int Table_proxies_priv= 1 << PROXIES_PRIV_TABLE; static const int Table_proxies_priv= 1 << PROXIES_PRIV_TABLE;
static const int Table_roles_mapping= 1 << ROLES_MAPPING_TABLE; static const int Table_roles_mapping= 1 << ROLES_MAPPING_TABLE;
static int open_grant_tables(THD *thd, TABLE_LIST *tables, static int open_grant_tables(THD *, TABLE_LIST *, enum thr_lock_type, int);
enum thr_lock_type lock_type, int tables_to_open);
const LEX_STRING acl_table_names[]= // matches enum_acl_tables const LEX_STRING acl_table_names[]= // matches enum_acl_tables
{ {
...@@ -6030,7 +6029,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, ...@@ -6030,7 +6029,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
List_iterator <LEX_USER> str_list (user_list); List_iterator <LEX_USER> str_list (user_list);
LEX_USER *Str, *tmp_Str; LEX_USER *Str, *tmp_Str;
TABLE_LIST tables[TABLES_MAX]; TABLE_LIST tables[TABLES_MAX];
bool create_new_users= 0, result; bool create_new_users= 0;
int result;
char *db_name, *table_name; char *db_name, *table_name;
DBUG_ENTER("mysql_routine_grant"); DBUG_ENTER("mysql_routine_grant");
...@@ -6465,7 +6465,8 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, ...@@ -6465,7 +6465,8 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
List_iterator <LEX_USER> str_list (list); List_iterator <LEX_USER> str_list (list);
LEX_USER *Str, *tmp_Str, *proxied_user= NULL; LEX_USER *Str, *tmp_Str, *proxied_user= NULL;
char tmp_db[SAFE_NAME_LEN+1]; char tmp_db[SAFE_NAME_LEN+1];
bool create_new_users=0, result; bool create_new_users=0;
int result;
TABLE_LIST tables[TABLES_MAX]; TABLE_LIST tables[TABLES_MAX];
DBUG_ENTER("mysql_grant"); DBUG_ENTER("mysql_grant");
......
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