Commit a701426b authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: refactor grant table classes in sql_acl.cc

move all backward compatibility related code into User_table,
the caller should not know or care anymore.

Other tables (Db_table, etc) are *not* refactored.

For consistency with other updates, setting a default role
no longer errors out when the mysql.user table is too old.
parent 3df7287d
...@@ -15,7 +15,6 @@ create role test_role; ...@@ -15,7 +15,6 @@ create role test_role;
create user test_user@localhost; create user test_user@localhost;
grant test_role to test_user@localhost; grant test_role to test_user@localhost;
set default role test_role for root@localhost; set default role test_role for root@localhost;
ERROR HY000: Column count of mysql.user is wrong. Expected 46, found 45. Created with MariaDB MYSQL_VERSION_ID, now running MYSQL_VERSION_ID. Please use mysql_upgrade to fix this error
drop role test_role; drop role test_role;
drop user test_user@localhost; drop user test_user@localhost;
alter table user add column default_role char(80) binary default '' not null alter table user add column default_role char(80) binary default '' not null
......
...@@ -29,8 +29,8 @@ after password_expired; ...@@ -29,8 +29,8 @@ after password_expired;
create role test_role; create role test_role;
create user test_user@localhost; create user test_user@localhost;
grant test_role to test_user@localhost; grant test_role to test_user@localhost;
--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/ #--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE #--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
set default role test_role for root@localhost; set default role test_role for root@localhost;
drop role test_role; drop role test_role;
drop user test_user@localhost; drop user test_user@localhost;
......
This diff is collapsed.
...@@ -5355,8 +5355,7 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables) ...@@ -5355,8 +5355,7 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
@retval TRUE A lock wait timeout, deadlock or out of memory. @retval TRUE A lock wait timeout, deadlock or out of memory.
*/ */
bool lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool lock_tables(THD *thd, TABLE_LIST *tables, uint count, uint flags)
uint flags)
{ {
TABLE_LIST *table; TABLE_LIST *table;
DBUG_ENTER("lock_tables"); DBUG_ENTER("lock_tables");
......
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