mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Updated error message in case the user table's format is not up to date and can
not support roles
This commit is contained in:
parent
ce4851c3d0
commit
3fa2cb2126
3 changed files with 40 additions and 1 deletions
|
@ -0,0 +1,14 @@
|
|||
use mysql;
|
||||
alter table user drop column is_role;
|
||||
flush privileges;
|
||||
create role test_role;
|
||||
ERROR HY000: Column count of mysql.user is wrong. Expected 43, found 42. Created with MariaDB 100003, now running 100003. Please use mysql_upgrade to fix this error.
|
||||
drop role test_role;
|
||||
ERROR HY000: Operation DROP ROLE failed for 'test_role'
|
||||
alter table user add column is_role enum('N', 'Y') default 'N' not null
|
||||
COLLATE utf8_general_ci
|
||||
after authentication_string;
|
||||
update user set is_role='N';
|
||||
flush privileges;
|
||||
create role test_role;
|
||||
drop role test_role;
|
|
@ -0,0 +1,23 @@
|
|||
connect (mysql, localhost, root,,);
|
||||
use mysql;
|
||||
|
||||
alter table user drop column is_role;
|
||||
|
||||
flush privileges;
|
||||
|
||||
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
|
||||
create role test_role;
|
||||
--error ER_CANNOT_USER
|
||||
drop role test_role;
|
||||
alter table user add column is_role enum('N', 'Y') default 'N' not null
|
||||
COLLATE utf8_general_ci
|
||||
after authentication_string;
|
||||
|
||||
update user set is_role='N';
|
||||
|
||||
flush privileges;
|
||||
create role test_role;
|
||||
drop role test_role;
|
||||
|
||||
|
||||
|
|
@ -3128,7 +3128,9 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo,
|
|||
/* if the user table is not up to date, we can't handle role updates */
|
||||
if (table->s->fields <= 42 && handle_as_role)
|
||||
{
|
||||
my_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, MYF(0));
|
||||
my_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, MYF(0), table->alias.c_ptr(),
|
||||
43, table->s->fields,
|
||||
static_cast<int>(table->s->mysql_version), MYSQL_VERSION_ID);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue