| 1 |
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct; |
| 2 |
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm; |
| 3 |
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0; |
| 4 |
SET GLOBAL innodb_max_dirty_pages_pct=0.0; |
| 5 |
CREATE TABLE t(a INT) ENGINE=InnoDB STATS_PERSISTENT=0; |
| 6 |
connect prevent_purge,localhost,root; |
| 7 |
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
| 8 |
connection default; |
| 9 |
SET GLOBAL innodb_max_purge_lag_wait=0; |
| 10 |
SET GLOBAL innodb_max_dirty_pages_pct=90.0; |
| 11 |
select variable_value into @innodb_async_writes_total_count_before |
| 12 |
from information_schema.global_status |
| 13 |
where variable_name='innodb_async_writes_total_count'; |
| 14 |
SELECT variable_value INTO @log_writes FROM information_schema.global_status |
| 15 |
WHERE variable_name='innodb_log_writes'; |
| 16 |
BEGIN; |
| 17 |
ROLLBACK; |
| 18 |
SELECT if(variable_value-@log_writes<500,'ok',variable_value-@log_writes) |
| 19 |
FROM information_schema.global_status WHERE variable_name='innodb_log_writes'; |
| 20 |
if(variable_value-@log_writes<500,'ok',variable_value-@log_writes) |
| 21 |
ok |
| 22 |
disconnect prevent_purge; |
| 23 |
SELECT variable_value>0 FROM information_schema.global_status |
| 24 |
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'; |
| 25 |
variable_value>0 |
| 26 |
1 |
| 27 |
SET GLOBAL innodb_max_dirty_pages_pct=0.0; |
| 28 |
select (cast(variable_value as unsigned) > |
| 29 |
cast(@innodb_async_writes_total_count_before as unsigned)) |
| 30 |
as innodb_async_writes_grow |
| 31 |
from information_schema.global_status |
| 32 |
where variable_name='innodb_async_writes_total_count'; |
| 33 |
innodb_async_writes_grow |
| 34 |
1 |
| 35 |
DROP TABLE t; |
| 36 |
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct; |
| 37 |
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm; |