Fwd: [rt.cpan.org #81516] Test failures due to hash randomisation in perl 5.17.6

Jens Rehsack <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization Comprehensive Perl Archive Network
Message-ID <[email protected]>
Hi all,

I digged a bit deeper (because I didn't think Andreas J. König
is a complete moron), and discovered that 1 of 4 "make test" fails.
Thinking a bit before answering could had helped showing that I'm
neither a moron - but failed to do that. Sorry ;)

Okay - figured out what happens:
Test #12 of t/51dbm_file.t initialized DBD::DBM with
{
   f_dir               => $dir,
   sql_identifier_case => 2,      # SQL_IC_LOWER
   dbm_tables          => { fred => $tbl_info },
}

In all earlier versions of perl, it seems that we're lucky enough
to get f_dir being traversed before dbm_tables in 
DBI::DBD::SqlEngine::dr::connect :)

Well, I'm a lucky moron \o/

But back to the issue - now it seems dbm_tables is fetched earlier
in some cases than f_dir which causes an invocation of
DBI::DBD::SqlEngine::Table::get_table_meta (including
DBI::DBD::SqlEngine::Table::bootstrap_table_meta) before f_dir
has been set. This causes $dbh->{sql_meta}->{fred}->{f_dir} being
initialized to the default value of $dbh->{f_dir} which is
always cur_dir().

Looking into DBI::DBD::SqlEngine::dr::connect around line 180
it could be seen that there's already some magic for "some
settings must be done before others".

A quick fix for "now" could be: keys: ("sql_meta", $dbh->{dbm_meta},
...) must be initialized last - after any other k/v pair from %$attrs.
Another quick should could be forbid setting meta info during connect(),
as it's documented - but this would be a hugh step backwards in my
effort making DBI::DBD::SqlEngine and derived DBD's usable through
Gofer proxy. So I'd prefer the first quick shot ...

For longer way, I'd like to refactor the order procedure to a
more flexible way:
$dbh->{dbd_init_order} = [
   [qw(Profile RaiseError PrintError AutoCommit)],
   [qw(ReadOnly ...)],
   ...
   [qw(sql_meta dbm_tables ...)]
];

Remaining question in that proposal: where's the fence between "must
be last" and "insert unnamed attrs here"?

/Jens
-------- Original Message --------
Subject: [rt.cpan.org #81516] Test failures due to hash randomisation in 
perl 5.17.6
Date: Wed, 28 Nov 2012 14:25:57 -0500
From: Andreas Koenig via RT <[email protected]>
Reply-To: [email protected]
To: undisclosed-recipients:;

Wed Nov 28 14:25:56 2012: Request 81516 was acted upon.
Transaction: Ticket created by ANDK
        Queue: DBI
      Subject: Test failures due to hash randomisation in perl 5.17.6
    Broken in: 1.622, 1.622_921
     Severity: Important
        Owner: Nobody
   Requestors: [email protected]
       Status: new
  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81516 >


Since bleadperl v5.17.5-518-g7dc8663 your tests are failing.
That commit introduced hash key randomization and it seems at least the
test

t/51dbm_file.t

is hit by that. Find a sample fail report at:

http://www.cpantesters.org/cpan/
report/6f8af7be-32bb-11e2-9f28-2edaa290f8f5

You can read more about the commit at
http://perl5.git.perl.org/perl  .git/commit/7dc8663964c66a698d
31bbdc8e8abed69bddeec3

HTH&&Thanks&&Regards,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.