diff options
author | Christoph Berg | 2015-06-23 14:35:31 +0000 |
---|---|---|
committer | Christoph Berg | 2015-06-23 14:35:31 +0000 |
commit | 60af9f27721d62219a5ef220feff02ae7e8b79b1 (patch) | |
tree | c101a4e892a5ff1054c1696e7260f9631a1f60df | |
parent | 791a17ff1b662b1b6d4d3e5261bfdc3aac313731 (diff) |
Fix txn_time regression test for 9.0/9.1
Newer versions will show the last or current query here, older versions
will just show "<IDLE> in transaction" if there is currently no
query running.
-rw-r--r-- | t/02_txn_time.t | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/02_txn_time.t b/t/02_txn_time.t index 8be2fa18c..d743fe1f9 100644 --- a/t/02_txn_time.t +++ b/t/02_txn_time.t @@ -76,7 +76,8 @@ sleep(1); like ($cp->run(q{-w 0}), qr{longest txn: 1s}, $t); $t .= ' (MRTG)'; -like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:\w+ query:SELECT 1\n}, $t); +my $query_patten = ($ver >= 90200) ? "SELECT 1" : "<IDLE> in transaction"; +like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:\w+ query:$query_patten\n}, $t); $idle_dbh->commit; |