[MDEV-18435] role is creating succesfully but cant grant any privilege to it and after flush privileges it gives ERROR 1133 (28000) Created: 2019-01-31  Updated: 2019-03-04  Resolved: 2019-03-04

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System, Server
Affects Version/s: 10.3.12
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Shubham Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

linux mint mate 19
Kernel Linux 4.15.0-44-generic x86_64
Intel® Core™ i7-3610QM CPU @ 2.30GHz × 8



 Description   

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 346
Server version: 10.3.12-MariaDB-1:10.3.12+maria~bionic mariadb.org binary distribution
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> create user demo1 identified by '1234';
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> create role r1;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> grant all on *.* to r1;
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]> grant r1 to demo1;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> show grants for r1;
+----------------------------+
| Grants for r1              |
+----------------------------+
| GRANT USAGE ON *.* TO 'r1' |
+----------------------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> set default role r1 for demo1;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> exit
Bye

~$ mysql -u demo1 -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 348
Server version: 10.3.12-MariaDB-1:10.3.12+maria~bionic mariadb.org binary distribution
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.001 sec)
 
MariaDB [(none)]> select current_role();
+----------------+
| current_role() |
+----------------+
| r1             |
+----------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> show grants for demo1;
+------------------------------------------------------------------------------------------------------+
| Grants for demo1@%                                                                                   |
+------------------------------------------------------------------------------------------------------+
| GRANT r1 TO 'demo1'@'%'                                                                              |
| GRANT USAGE ON *.* TO 'demo1'@'%' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' |
+------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)
MariaDB [(none)]> select current_user();
+----------------+
| current_user() |
+----------------+
| demo1@%        |
+----------------+
1 row in set (0.000 sec)



 Comments   
Comment by Elena Stepanova [ 2019-01-31 ]

Please provide the full unabridged server error log, the output of

SHOW CREATE TABLE mysql.user;
SELECT * from mysql.user where user in ('demo1','r1') \G

and also please show how and when FLUSH PRIVILEGES fails.

Generated at Thu Feb 08 08:44:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.