salortiz / LMDB_File

Perl wrapper around the OpenLDAP's LMDB
Other
8 stars 12 forks source link

Can't set_flags with MDB_NOTLS, MDB_RDONLY #14

Closed akotlar closed 8 years ago

akotlar commented 8 years ago
say "mdb notls is " .MDB_NOTLS . ' and nometaasync ' .MDB_NOMETASYNC;
$Env->set_flags(
    MDB_NOMETASYNC | MDB_NOTLS,
    1
  );

  my $flags;
  p $envs->{$name}->get_flags($flags);
  say "flags are ";
  p $flags;
mdb notls is 2097152 and nometaasync 262144
0
flags are 
0

Works fine when setting in constructor:

my $Env =  LMDB::Env->new($dbPath, {
      mapsize => 1024 * 1024 * 1024 * 1024, # Plenty space, don't worry
      #maxdbs => 20, # Some databases
      mode   => 0755,
      flags => MDB_NOMETASYNC | MDB_NOTLS,
  });
flags are 
2359296

Interestingly, MDB_NOMETASYNC works in set_flags:

$Env->set_flags(
    MDB_NOMETASYNC ,
    1
  );
$Env->get_flags($flags);
flags are 
262144

Same issue with MDB_RDONLY

akotlar commented 8 years ago

Never mind. Documentation does not state that these can be set using set_flags.