1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
--echo #
--echo # WL#9763: Support option to RESET PERSIST
--echo #
--source include/have_debug_sync.inc
--echo # Syntax check for RESET PERSIST
RESET PERSIST;
--error ER_VAR_DOES_NOT_EXIST
RESET PERSIST max_connections;
RESET PERSIST IF EXISTS max_connections;
--error ER_PARSE_ERROR
RESET PERSIST IF EXISTS;
--error ER_PARSE_ERROR
RESET PERSIST IF EXISTS max_connections, long_query_time;
--error ER_PARSE_ERROR
RESET PERSIST max_connections, long_query_time;
let $MYSQLD_DATADIR= `select @@datadir`;
--echo # check contents of persistent config file
SET PERSIST sort_buffer_size=256000;
SET PERSIST long_query_time= 8.3452;
select * from performance_schema.persisted_variables ORDER BY 1;
RESET PERSIST;
--echo # config file should be empty
select * from performance_schema.persisted_variables ORDER BY 1;
--echo # add few more to config file and reset
SET PERSIST sort_buffer_size=156000,max_connections= 52;
SET PERSIST max_heap_table_size=887808, replica_net_timeout=160;
SET PERSIST long_query_time= 7.8102;
select * from performance_schema.persisted_variables ORDER BY 1;
RESET PERSIST max_heap_table_size;
RESET PERSIST sort_buffer_size;
select * from performance_schema.persisted_variables ORDER BY 1;
RESET PERSIST IF EXISTS replica_net_timeout;
select * from performance_schema.persisted_variables ORDER BY 1;
SET PERSIST join_buffer_size= 262144;
select * from performance_schema.persisted_variables ORDER BY 1;
RESET PERSIST;
select * from performance_schema.persisted_variables ORDER BY 1;
--echo # check for errors and warnings
# should report warning
RESET PERSIST IF EXISTS sort_buffer_size;
# should report error
--error ER_VAR_DOES_NOT_EXIST
RESET PERSIST sort_buffer_size;
# set all variables to default
SET GLOBAL long_query_time= DEFAULT,
max_connections= DEFAULT, max_heap_table_size= DEFAULT,
replica_net_timeout= DEFAULT, sort_buffer_size= DEFAULT,
join_buffer_size= DEFAULT;
#cleanup
--remove_file $MYSQLD_DATADIR/mysqld-auto.cnf
--echo #
--echo # Bug #27264789: CONCURRENT EXECUTION OF SET/RESET PERSIST CALL CRASHES SERVER
--echo #
connect (conn1,localhost,root,,);
connect (conn2,localhost,root,,);
connection conn1;
# Acquiring LOCK_persist_variables
SET DEBUG_SYNC='in_set_persist_variables SIGNAL set WAIT_FOR go';
--send SET PERSIST max_connections= 38;
connection conn2;
SET DEBUG_SYNC='now WAIT_FOR set';
--send RESET PERSIST IF EXISTS max_connections;
connection default;
# reset persist operation will wait until set persist operation is complete.
SET DEBUG_SYNC='now SIGNAL go';
connection conn1;
--reap
connection conn2;
--reap
connection default;
# return 0
SELECT count(*) FROM performance_schema.persisted_variables
WHERE variable_name = 'max_connections';
SET DEBUG_SYNC='RESET';
disconnect conn1;
disconnect conn2;
#cleanup
SET GLOBAL max_connections=DEFAULT;
--remove_file $MYSQLD_DATADIR/mysqld-auto.cnf
|