Subject: | $env->lock_detect dies due to incorrect version check |
When I try to call lock_detect, my program dies with:
$env->lock_detect needs Berkeley DB 2.2.x or better
Since I'm using DB 4.8, the error is bogus.
Looking at BerkeleyDB.xs, the cause seems to be a #ifndef check of macro AT_LEAST_DB_2_2, which is never set anywhere - so this method can never be called sucessfully. set/get_tx_max might also be affected.
To reproduce:
1. Build BerkeleyDB against version 3/4/5 of the BerkeleyDB C API.
2. Call
$ perl -MBerkeleyDB -e '$e = BerkeleyDB::Env->new(-Home => "/tmp", -Flags => DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_RECOVER); $e->lock_detect()'
BerkeleyDB Aborting: $env->lock_detect needs Berkeley DB 2.2.x or better at -e line 1.