summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/include/wait_all_purged.inc
blob: 992e14f08434489d1586cbc3c5bd62a25c3c2dec (plain)
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
# Wait for everything to be purged.
# The user should have set innodb_purge_rseg_truncate_frequency=1.

if (!$wait_all_purged)
{
  let $wait_all_purged= 0;
}
let $remaining_expect= `select concat('InnoDB		',$wait_all_purged)`;

let $wait_counter= 600;
while ($wait_counter)
{
    --replace_regex /.*History list length ([0-9]+).*/\1/
    let $remaining= `SHOW ENGINE INNODB STATUS`;
    if ($remaining == $remaining_expect)
    {
        let $wait_counter= 0;
    }
    if ($wait_counter)
    {
        real_sleep 0.1;
        dec $wait_counter;
    }
}
echo $remaining transactions not purged;