| 1 |
# |
| 2 |
# Basic test for innodb_buffer_pool_dump_now |
| 3 |
# |
| 4 |
|
| 5 |
-- source include/have_innodb.inc |
| 6 |
|
| 7 |
# Check the default value |
| 8 |
SELECT @@global.innodb_buffer_pool_dump_now; |
| 9 |
|
| 10 |
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)` |
| 11 |
-- error 0,1 |
| 12 |
-- remove_file $file |
| 13 |
|
| 14 |
--disable_cursor_protocol |
| 15 |
SELECT variable_value INTO @old_dump_status FROM information_schema.global_status |
| 16 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'; |
| 17 |
--enable_cursor_protocol |
| 18 |
|
| 19 |
# A previous test could have run buffer pool dump already; |
| 20 |
# in this case we want to make sure that the current time is different |
| 21 |
# from the timestamp in the status variable. |
| 22 |
# We should have had a smart wait condition here, like the commented one below, |
| 23 |
# let $wait_condition = |
| 24 |
# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s'); |
| 25 |
# -- source include/wait_condition.inc |
| 26 |
|
| 27 |
# ... but we can't because of MDEV-9867, so there will be just sleep instead. |
| 28 |
# And it might be not enough to sleep one second, so we'll have to sleep two. |
| 29 |
|
| 30 |
if (`SELECT variable_value LIKE '%completed at%' FROM information_schema.global_status |
| 31 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`) |
| 32 |
{ |
| 33 |
-- sleep 2 |
| 34 |
} |
| 35 |
|
| 36 |
# Do the dump |
| 37 |
SET GLOBAL innodb_buffer_pool_dump_now = ON; |
| 38 |
# Should always be OFF |
| 39 |
SELECT @@global.innodb_buffer_pool_dump_now; |
| 40 |
|
| 41 |
# Wait for the dump to complete |
| 42 |
let $wait_condition = |
| 43 |
SELECT variable_value != @old_dump_status |
| 44 |
AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at ' |
| 45 |
FROM information_schema.global_status |
| 46 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'; |
| 47 |
-- source include/wait_condition.inc |
| 48 |
|
| 49 |
# Confirm that the dump file has been created |
| 50 |
-- file_exists $file |