| 1 |
# This restarts the server and waits a long time for output. |
| 2 |
--source include/big_test.inc |
| 3 |
|
| 4 |
# Test the deprecation messages and connection to the flags. |
| 5 |
CREATE TABLE innodb_monitor(a SERIAL) ENGINE=InnoDB; |
| 6 |
SHOW VARIABLES LIKE 'innodb_status_output%'; |
| 7 |
DROP TABLE innodb_monitor; |
| 8 |
SHOW VARIABLES LIKE 'innodb_status_output%'; |
| 9 |
CREATE TABLE innodb_lock_monitor(a SERIAL) ENGINE=InnoDB; |
| 10 |
SHOW VARIABLES LIKE 'innodb_status_output%'; |
| 11 |
DROP TABLE innodb_lock_monitor; |
| 12 |
SHOW VARIABLES LIKE 'innodb_status_output%'; |
| 13 |
CREATE TABLE innodb_tablespace_monitor(a SERIAL) ENGINE=InnoDB; |
| 14 |
DROP TABLE innodb_tablespace_monitor; |
| 15 |
CREATE TABLE innodb_table_monitor(a SERIAL) ENGINE=InnoDB; |
| 16 |
DROP TABLE innodb_table_monitor; |
| 17 |
|
| 18 |
CREATE TABLE t(a SERIAL) ENGINE=InnoDB; |
| 19 |
INSERT INTO t VALUES(42); |
| 20 |
|
| 21 |
--source include/shutdown_mysqld.inc |
| 22 |
|
| 23 |
let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/innodb-status-output.err; |
| 24 |
|
| 25 |
--error 0,1 |
| 26 |
--remove_file $SEARCH_FILE |
| 27 |
|
| 28 |
# Test that the output appears. |
| 29 |
--exec echo "restart: --no-console --log-error=$SEARCH_FILE">$_expect_file_name |
| 30 |
--enable_reconnect |
| 31 |
--source include/wait_until_connected_again.inc |
| 32 |
--disable_reconnect |
| 33 |
|
| 34 |
BEGIN; |
| 35 |
SELECT * FROM t FOR UPDATE; |
| 36 |
# Enable full output. |
| 37 |
SET GLOBAL innodb_status_output_locks=ON; |
| 38 |
SET GLOBAL innodb_status_output=ON; |
| 39 |
SELECT SLEEP(30); |
| 40 |
COMMIT; |
| 41 |
|
| 42 |
--source include/shutdown_mysqld.inc |
| 43 |
|
| 44 |
let SEARCH_PATTERN= INNODB MONITOR OUTPUT; |
| 45 |
--source include/search_pattern.inc |
| 46 |
let SEARCH_PATTERN= SELECT SLEEP.*\nTABLE LOCK.*\nRECORD LOCKS space id; |
| 47 |
--source include/search_pattern_multiline.inc |
| 48 |
--remove_file $SEARCH_FILE |
| 49 |
|
| 50 |
--exec echo "restart: --no-console --log-error=$SEARCH_FILE --log-error-verbosity=3 ">$_expect_file_name |
| 51 |
--enable_reconnect |
| 52 |
--source include/wait_until_connected_again.inc |
| 53 |
--disable_reconnect |
| 54 |
|
| 55 |
BEGIN; |
| 56 |
SELECT * FROM t FOR UPDATE; |
| 57 |
# This alone should not enable any output. |
| 58 |
SET GLOBAL innodb_status_output_locks=ON; |
| 59 |
SELECT SLEEP(30); |
| 60 |
COMMIT; |
| 61 |
|
| 62 |
--source include/shutdown_mysqld.inc |
| 63 |
|
| 64 |
# We should not see any extra output. |
| 65 |
|
| 66 |
let SEARCH_PATTERN= ready for connections. Version:; |
| 67 |
--source include/search_pattern.inc |
| 68 |
|
| 69 |
let SEARCH_PATTERN= .*(a chance to die gracefully|Shutting down|Normal shutdown); |
| 70 |
--source include/search_pattern_multiline.inc |
| 71 |
|
| 72 |
--remove_file $SEARCH_FILE |
| 73 |
|
| 74 |
--exec echo "restart: --no-console --log-error=$SEARCH_FILE">$_expect_file_name |
| 75 |
--enable_reconnect |
| 76 |
--source include/wait_until_connected_again.inc |
| 77 |
--disable_reconnect |
| 78 |
|
| 79 |
BEGIN; |
| 80 |
SELECT * FROM t FOR UPDATE; |
| 81 |
# Enable some output. |
| 82 |
SET GLOBAL innodb_status_output=ON; |
| 83 |
SELECT SLEEP(30); |
| 84 |
COMMIT; |
| 85 |
|
| 86 |
--source include/restart_mysqld.inc |
| 87 |
|
| 88 |
# We should have some extra output. |
| 89 |
let SEARCH_PATTERN= INNODB MONITOR OUTPUT; |
| 90 |
--source include/search_pattern.inc |
| 91 |
# No RECORD LOCKS output expected |
| 92 |
let SEARCH_PATTERN= SELECT SLEEP.*\n------; |
| 93 |
--source include/search_pattern_multiline.inc |
| 94 |
--remove_file $SEARCH_FILE |
| 95 |
|
| 96 |
# Clean up. |
| 97 |
|
| 98 |
DROP TABLE t; |