[Dbix-class] Loosing data while upgrading from 0.08013 to 0.08101
Emmanuel Quevillon
tuco at pasteur.fr
Mon Apr 27 12:15:06 GMT 2009
Hi,
I am using DBIx::Class in collaboration with Catalyst.
As long I used version 0.08013 of DBIx::Class everything was working
well.
I upgraded to the latest version today, and now my application is
missing some data while joining:
Here is the search code (works well with 8013):
my $auth_set = $c->model('BiblioListDB::Authors')
->search({ 'pub_auth.id_pub' => { -in => $id_pubs }},
{
join => [qw/pub_auth/],
columns => [qw/me.name me.surname me.id_author/],
'+select' => [qw/pub_auth.id_pub/],
'+as' => [qw/id_pub/],
});
while(my $author = $auth_set->next()){
my $id_pub = $author->get_column('id_pub');
$authors->{$id_pub} = [ ] unless($authors->{$id_pub});
push @{$authors->{$id_pub}}, {
id_auth => $author->id_author(),
name => $author->name(),
surname => $author->surname(),
};
}
The dumped result looks like this :
'695' => [
{
'name' => 'Rajagopalan',
'id_auth' => '1121',
'surname' => 'M'
},
{
'name' => 'Madiraju',
'id_auth' => '1126',
'surname' => 'MV'
},
{
'name' => 'Qin',
'id_auth' => '2179',
'surname' => 'MH'
}
]
As soon as I upgraded to 8101 I've lost the data fetched from
$author and got a lots a warning in my Catalyst log:
SELECT me.name, me.surname, me.id_author, pub_auth.id_pub FROM
authors me LEFT JOIN pub_auths pub_auth ON pub_auth.id_auth =
me.id_author WHERE ( pub_auth.id_pub IN ( '695' ) ):
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in hash element at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 1024.
Use of uninitialized value in anonymous hash ({}) at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 2406.
Use of uninitialized value in anonymous hash ({}) at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 2406.
Use of uninitialized value in anonymous hash ({}) at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm line 2406.
and the result looks like this:
'695' => [
{
'name' => undef,
'id_auth' => undef,
'surname' => undef
},
{
'name' => undef,
'id_auth' => undef,
'surname' => undef
},
{
'name' => undef,
'id_auth' => undef,
'surname' => undef
}
]
I've tried to change my code to $author->get_column('x'); without
success.
Anybody knows about this problem when upgrading?
Thanks a lot for answers.
Best regards
--
-------------------------
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-------------------------
More information about the DBIx-Class
mailing list