mariadb/mysql-test/suite/roles
Monty cc8aed3eb7 MDEV 4427: query timeouts
Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired.

- Added timer functions based on pthread_cond_timedwait
- Added kill_handlerton() to signal storage engines about kill/timeout
- Added support for GRANT ... MAX_STATEMENT_TIME=#
- Copy max_statement_time to current user, if stored in mysql.user
- Added status variable max_statement_time_exceeded
- Added KILL_TIMEOUT
- Removed digest hash from performance schema tests as they change all the time.
- Updated test results that changed because of the new user variables or new fields in mysql.user

This functionallity is inspired by work done by Davi Arnaut at twitter.
Test case is copied from Davi's work.

Documentation can be found at
https://kb.askmonty.org/en/how-to-limittimeout-queries/

mysql-test/r/mysqld--help.result:
  Updated for new help message
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysql-test/suite/sys_vars/r/max_statement_time_basic.result:
  Added testing of max_statement_time
mysql-test/suite/sys_vars/t/max_statement_time_basic.test:
  Added testing of max_statement_time
mysql-test/t/max_statement_time.test:
  Added testing of max_statement_time
mysys/CMakeLists.txt:
  Added thr_timer
mysys/my_init.c:
mysys/mysys_priv.h:
  Added new mutex and condition variables
  Added new mutex and condition variables
mysys/thr_timer.c:
  Added timer functions based on pthread_cond_timedwait()
  This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime()
sql/lex.h:
  Added MAX_STATEMENT_TIME
sql/log_event.cc:
  Safety fix (timeout should be threated as an interrupted query)
sql/mysqld.cc:
  Added support for timers
  Added status variable max_statement_time_exceeded
sql/share/errmsg-utf8.txt:
  Added ER_QUERY_TIMEOUT
sql/signal_handler.cc:
  Added support for KILL_TIMEOUT
sql/sql_acl.cc:
  Added support for GRANT ... MAX_STATEMENT_TIME=#
  Copy max_statement_time to current user
sql/sql_class.cc:
  Added timer functionality to THD.
  Added thd_kill_timeout()
sql/sql_class.h:
  Added timer functionality to THD.
  Added KILL_TIMEOUT
  Added max_statement_time variable in similar manner as long_query_time was done.
sql/sql_connect.cc:
  Added handling of max_statement_time_exceeded
sql/sql_parse.cc:
  Added starting and stopping timers for queries.
sql/sql_show.cc:
  Added max_statement_time_exceeded for user/connects status in MariaDB 10.0
sql/sql_yacc.yy:
  Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0
sql/structs.h:
  Added max_statement_time user resource
sql/sys_vars.cc:
  Added max_statement_time variables
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
  Removed test as we require all fields in mysql.user table.
scripts/mysql_system_tables.sql
scripts/mysql_system_tables_data.sql
scripts/mysql_system_tables_fix.sql
  Updated mysql.user with new max_statement_time field
2014-10-07 11:37:36 +03:00
..
acl_load_mutex-5170.result MDEV-5170 Assertion `(&(&acl_cache->lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&acl_cache->lock)->m_mutex)->thread)' fails after restarting server with a pre-created role grants 2013-10-23 09:49:47 -07:00
acl_load_mutex-5170.test MDEV-5170 Assertion `(&(&acl_cache->lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&acl_cache->lock)->m_mutex)->thread)' fails after restarting server with a pre-created role grants 2013-10-23 09:49:47 -07:00
admin.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
admin.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
create_and_drop_current.result remove hostname-dependent part of the test 2013-11-03 13:12:40 +01:00
create_and_drop_current.test remove hostname-dependent part of the test 2013-11-03 13:12:40 +01:00
create_and_drop_role.result MDEV-5525 Assertion `status == 0' fails on creating user after granting it role admin option 2014-01-29 11:00:06 +01:00
create_and_drop_role.test MDEV-5525 Assertion `status == 0' fails on creating user after granting it role admin option 2014-01-29 11:00:06 +01:00
create_and_grant_role.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
create_and_grant_role.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
default_create_user_not_role.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
default_create_user_not_role.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
definer.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
definer.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
drop_current_user-5176.result MDEV-5176 Server crashes in fill_schema_applicable_roles on select from APPLICABLE_ROLES after a suicide 2013-10-23 09:54:10 -07:00
drop_current_user-5176.test post-review cleanup 2013-10-27 08:19:21 +01:00
drop_routines.result remove inherited routine grants when a routine is dropped 2013-10-26 15:52:29 +02:00
drop_routines.test remove inherited routine grants when a routine is dropped 2013-10-26 15:52:29 +02:00
grant-5771.result MDEV-5771 Privileges acquired via roles depend on the order of granting 2014-03-19 09:57:45 +01:00
grant-5771.test MDEV-5771 Privileges acquired via roles depend on the order of granting 2014-03-19 09:57:45 +01:00
grant_empty.result MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name 2014-03-01 11:55:31 +01: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 grant/revoke ... to/from current_role 2013-11-02 16:26:35 +01:00
grant_revoke_current.test grant/revoke ... to/from current_role 2013-11-02 16:26:35 +01:00
grant_role_auto_create_user.result minor cleanup 2013-12-25 21:21:47 +01:00
grant_role_auto_create_user.test minor cleanup 2013-12-25 21:21:47 +01:00
none_public.result 10.0-base merge (roles) 2013-10-29 15:08:44 +01:00
none_public.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
password.result MDEV-5526 Assertion `proxied_user->host.length' fails on GRANT PROXY ON <role> 2014-01-29 00:05:24 +01:00
password.test MDEV-5526 Assertion `proxied_user->host.length' fails on GRANT PROXY ON <role> 2014-01-29 00:05:24 +01: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 move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
rebuild_role_grants.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
recursive.inc move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
recursive.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
recursive.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
recursive_dbug.result MDEV-5771 Privileges acquired via roles depend on the order of granting 2014-03-19 09:57:45 +01:00
recursive_dbug.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
rename_user.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
rename_user.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
revoke_all.result Implemented REVOKE ALL FROM for Roles and role grants. 2013-10-26 15:38:48 +02:00
revoke_all.test Implemented REVOKE ALL FROM for Roles and role grants. 2013-10-26 15:38:48 +02:00
rpl_definer.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
rpl_definer.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_and_drop.result reset the db privilege cache when revoking db priviges on DROP ROLE 2013-10-23 05:09:17 -07:00
set_and_drop.test MDEV-5172 safe_mutex: Trying to lock mutex when the mutex was already locked on using a role and I_S role tables 2013-10-23 03:28:41 -07:00
set_default_role_clear.result Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_clear.test Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_for.result cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
set_default_role_for.test cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
set_default_role_invalid.result Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_invalid.test Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_new_connection.result Added default role implementation 2014-07-23 14:48:12 +02:00
set_default_role_new_connection.test Added default role implementation 2014-07-23 14:48:12 +02:00
set_role-5232.result MDEV-5232 SET ROLE checks privileges differently from check_access() 2013-11-04 13:37:39 +01: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-database-recursive.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-database-recursive.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-database-simple.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-database-simple.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-multiple-role.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-multiple-role.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-recursive.result MDEV 4427: query timeouts 2014-10-07 11:37:36 +03:00
set_role-recursive.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-routine-simple.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-routine-simple.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-simple.result MDEV 4427: query timeouts 2014-10-07 11:37:36 +03:00
set_role-simple.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-table-column-priv.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-table-column-priv.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-table-simple.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
set_role-table-simple.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
show_grants.result move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00
show_grants.test move role tests to a dedicated suite 2013-10-21 19:57:25 -07:00