… | |
… | |
108 | no warnings; |
108 | no warnings; |
109 | use strict 'vars'; |
109 | use strict 'vars'; |
110 | |
110 | |
111 | use base 'Exporter'; |
111 | use base 'Exporter'; |
112 | |
112 | |
|
|
113 | our $VERSION; |
|
|
114 | |
113 | BEGIN { |
115 | BEGIN { |
114 | our $VERSION = '1.7'; |
116 | $VERSION = '1.71'; |
115 | |
117 | |
116 | our @BDB_REQ = qw( |
118 | our @BDB_REQ = qw( |
117 | db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect |
119 | db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect |
118 | db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove |
120 | db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove |
119 | db_open db_close db_compact db_sync db_upgrade |
121 | db_open db_close db_compact db_sync db_upgrade |
… | |
… | |
570 | |
572 | |
571 | BerkeleyDB comes in various versions, many of them have minor |
573 | BerkeleyDB comes in various versions, many of them have minor |
572 | incompatibilities. This means that traditional "at least version x.x" |
574 | incompatibilities. This means that traditional "at least version x.x" |
573 | checks are often not sufficient. |
575 | checks are often not sufficient. |
574 | |
576 | |
575 | Example: set the log_autoremove option in a way compatible with <v.47 and |
577 | Example: set the log_autoremove option in a way compatible with <v4.7 and |
576 | v4.7. Note the use of & on the constants to avoid triggering a compiletime |
578 | v4.7. Note the use of & on the constants to avoid triggering a compiletime |
577 | bug when the symbol isn't available. |
579 | bug when the symbol isn't available. |
578 | |
580 | |
579 | $DB_ENV->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7; |
581 | $DB_ENV->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7; |
580 | $DB_ENV->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7; |
582 | $DB_ENV->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7; |
… | |
… | |
613 | =back |
615 | =back |
614 | |
616 | |
615 | =cut |
617 | =cut |
616 | |
618 | |
617 | sub VERSION { |
619 | sub VERSION { |
|
|
620 | # I was dumb enough to override the VERSION method here, so let's try |
|
|
621 | # to fix it up. |
|
|
622 | |
|
|
623 | if ($_[0] eq __PACKAGE__) { |
|
|
624 | $VERSION |
|
|
625 | } else { |
618 | if (@_ > 0) { |
626 | if (@_ > 0) { |
619 | return undef if VERSION_v lt $_[0]; |
627 | return undef if VERSION_v lt $_[0]; |
620 | if (@_ > 1) { |
628 | if (@_ > 1) { |
621 | return undef if VERSION_v ge $_[1]; |
629 | return undef if VERSION_v ge $_[1]; |
|
|
630 | } |
622 | } |
631 | } |
|
|
632 | |
|
|
633 | VERSION_v |
623 | } |
634 | } |
624 | |
|
|
625 | VERSION_v |
|
|
626 | } |
635 | } |
627 | |
636 | |
628 | =head3 CONTROLLING THE NUMBER OF THREADS |
637 | =head3 CONTROLLING THE NUMBER OF THREADS |
629 | |
638 | |
630 | =over 4 |
639 | =over 4 |