mariadb/mysql-test/suite/roles
Vicențiu Ciorbaru 9e6c383867 MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action
This happens upon CREATE USER and DROP ROLE.

The underlying problem is that our HASH implementation shuffles elements
around when performing an update or delete. This means that when doing a
scan through the HASH table by index, in search of elements to delete or
update one must restart the scan to make sure nothing is missed if at least
one delete / update happened.

More specifically, what happened in this case:
The hash has 131 element, DROP ROLE removes the element
[119]. Its [119]->next was element [129], so [129] is moved to [119].
Now we need to compact the hash, removing the last element [130]. It
gets one bit off its hash value and becomes element [2]. The existing
element [2] is moved to [129], and old [130] is moved to [2].

We cannot simply move [130] to [129] and make [2]->next=130, it won't
work if [2] is itself in the collision list and doesn't belong in [2].

The handle_grant_struct code assumed that it is safe to continue by only
reexamining the currently modified / deleted element index, but that is
not true.

Missing to delete an element in the hash triggered the assertion in
the test case. DROP ROLE would not clear all necessary role->role or
role->user mappings.

To fix the problem we ensure that the scan is restarted, only if an
element was deleted / updated, similar to how bubble-sort keeps sorting
until it finds no more elements to swap.
2021-10-15 19:19:36 +03:00
..
acl_load_mutex-5170.result Fixed failing test acl_load_mutex-5170 2018-06-19 16:23:34 +03:00
acl_load_mutex-5170.test MDEV-23511 shutdown_server 10 times out, causing server kill at shutdown 2020-08-21 14:48:53 +03:00
acl_statistics.opt Updated mtr files to support different compiled in options 2019-09-01 19:17:35 +03:00
acl_statistics.result MDEV-5214 Status variables for number of global/db/table/column/role grants 2015-03-19 22:41:43 +02:00
acl_statistics.test MDEV-5214 Status variables for number of global/db/table/column/role grants 2015-03-19 22:41:43 +02:00
admin.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
admin.test MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
create_and_drop_current.result MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
create_and_drop_current.test MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
create_and_drop_role.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
create_and_drop_role.test MDEV-11533: Roles with trailing white spaces are not cleared correctly 2016-12-10 22:23:25 +02:00
create_and_drop_role_invalid_user_table.result Remove end . from error messages to get them consistent 2016-10-05 01:11:08 +03:00
create_and_drop_role_invalid_user_table.test followup changes to timeout commit 2014-10-10 22:27:36 +02:00
create_and_grant_role.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
create_and_grant_role.test
current_role_view-12666.result Merge branch '10.1' into 10.2 2017-07-05 19:08:55 +02:00
current_role_view-12666.test MDEV-12666: CURRENT_ROLE() and DATABASE() does not work in a view 2017-06-15 19:20:35 +03:00
default_create_user_not_role.result MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
default_create_user_not_role.test
definer.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
definer.test Updated mtr files to support different compiled in options 2019-09-01 19:17:35 +03:00
drop_current_role.result Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
drop_current_role.test improve the error message for a dropped current role 2020-07-30 23:50:56 +02:00
drop_current_user-5176.result MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
drop_current_user-5176.test MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
drop_routines.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
drop_routines.test
flush_roles-12366.result Merge remote-tracking branch 'origin/10.1' into 10.2 2017-12-22 12:23:39 +02:00
flush_roles-12366.test MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles 2017-12-19 12:33:25 +02:00
flush_roles-17898.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
flush_roles-17898.test Merge 10.1 into 10.2 2019-04-03 10:32:21 +03:00
grant-5771.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
grant-5771.test MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
grant_empty.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
grant_empty.test MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name 2014-03-01 11:55:31 +01:00
grant_proxy-5526.result MDEV-5526 Assertion `proxied_user->host.length' fails on GRANT PROXY ON <role> 2014-01-29 00:05:24 +01:00
grant_proxy-5526.test fixes: 2014-02-02 10:09:05 +01:00
grant_revoke_current.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
grant_revoke_current.test fix mtr warnings after 5f0510225a 2018-06-24 15:18:36 +02:00
grant_role_auto_create_user.result MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
grant_role_auto_create_user.test MDEV-6066: Merge new defaults from 5.6 and 5.7 2015-09-04 10:33:56 +02:00
i_s_applicable_roles_is_default.result MDEV-6918 Create a way to see a user's default role. 2015-02-09 17:16:55 +02:00
i_s_applicable_roles_is_default.test MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
ip-6401.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
ip-6401.test add comment to a test 2015-10-22 10:27:36 +02:00
none_public.result MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
none_public.test MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
password.result MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
password.test MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
prepare_stmt_with_role.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
prepare_stmt_with_role.test MDEV-9443: Add reexecution test cases. 2016-03-22 22:21:04 +02:00
ps.result MDEV-5521 SET ROLE as prepared statement crashes the server 2014-01-28 21:02:17 +01:00
ps.test MDEV-5521 SET ROLE as prepared statement crashes the server 2014-01-28 21:02:17 +01:00
rebuild_role_grants.result MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action 2021-10-15 19:19:36 +03:00
rebuild_role_grants.test MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action 2021-10-15 19:19:36 +03:00
recursive.inc
recursive.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
recursive.test
recursive_dbug.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
recursive_dbug.test
rename_user.result
rename_user.test
revoke_all.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
revoke_all.test
role_case_sensitive-10744.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
role_case_sensitive-10744.test MDEV-10744: Roles are not fully case sensitive 2016-12-01 15:01:33 +01:00
rpl_definer.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
rpl_definer.test MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
rpl_grant_revoke_current_role-8638.result Post-merge: Update test results 2016-06-30 23:56:18 -04:00
rpl_grant_revoke_current_role-8638.test include/master-slave.inc must always be included last 2017-09-20 18:17:50 +02:00
set_and_drop.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_and_drop.test
set_default_role_clear.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_default_role_clear.test Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_for.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_default_role_for.test MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
set_default_role_invalid.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_default_role_invalid.test MDEV-22312: Bad error message for SET DEFAULT ROLE when user account is not granted the role 2020-05-28 17:08:40 +02:00
set_default_role_new_connection.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_default_role_new_connection.test Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_ps-6960.result fix mtr warnings after 5f0510225a 2018-06-24 15:18:36 +02:00
set_default_role_ps-6960.test fix mtr warnings after 5f0510225a 2018-06-24 15:18:36 +02:00
set_role-5232.result Remove end . from error messages to get them consistent 2016-10-05 01:11:08 +03:00
set_role-5232.test MDEV-5232 SET ROLE checks privileges differently from check_access() 2013-11-04 13:37:39 +01:00
set_role-9614.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-9614.test [MDEV-9614] Roles and Users longer than 6 characters 2016-06-22 16:41:38 +03:00
set_role-13655.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-13655.test MDEV-13655: Set role does not properly grant privileges. 2017-12-19 12:33:25 +02:00
set_role-database-recursive.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-database-recursive.test
set_role-database-simple.result
set_role-database-simple.test
set_role-multiple-role.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-multiple-role.test
set_role-recursive.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-recursive.test
set_role-routine-simple.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-routine-simple.test
set_role-simple.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-simple.test MDEV-9898 SET ROLE NONE can crash mysqld. 2016-05-02 12:58:57 +04:00
set_role-table-column-priv.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-table-column-priv.test
set_role-table-simple.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
set_role-table-simple.test
show_create_database-10463.result Merge branch '10.1' into 10.2 2017-07-05 19:08:55 +02:00
show_create_database-10463.test Updated mtr files to support different compiled in options 2019-09-01 19:17:35 +03:00
show_grants.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
show_grants.test MDEV-24289: show grants missing with grant option 2020-11-26 18:10:40 +01:00
show_grants_replicated.result MDEV-26080: SHOW GRANTS does not quote role names properly for DEFAULT ROLE 2021-07-09 08:25:54 +02:00
show_grants_replicated.test MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00