1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-7288 USER/ROLE: CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS

This commit is contained in:
Alexander Barkov
2015-01-13 11:50:33 +04:00
parent a68ad5d50f
commit 1f0ad6c6b3
17 changed files with 586 additions and 27 deletions

View File

@ -4498,7 +4498,9 @@ end_with_restore_list:
case SQLCOM_CREATE_USER:
case SQLCOM_CREATE_ROLE:
{
if (check_access(thd, INSERT_ACL, "mysql", NULL, NULL, 1, 1) &&
if (check_access(thd, lex->create_info.or_replace() ?
INSERT_ACL | DELETE_ACL : INSERT_ACL,
"mysql", NULL, NULL, 1, 1) &&
check_global_access(thd,CREATE_USER_ACL))
break;
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)