CC: | Joel Martin <j_martin [...] lbl.gov> |
Subject: | strange behavior with set_column |
Date: | Wed, 3 Jul 2013 13:32:17 -0700 |
To: | dbix-class [...] lists.scsys.co.uk, bug-DBIx-Class [...] rt.cpan.org |
From: | Joe Carlson <jwcarlson [...] lbl.gov> |
Hello,
I've noticed strange behavior with perl 5.16/ DBIx::Class 0.08204 that I did not see with perl 5.10/DBIx::Class 0.08120
I'm looking at a resultset record which involves a joined table. I'm working with a local copy and setting in_storage(0). If I attempt to set a value for a column in one of the joined column names, I get a 'No such column', but only the second time I attempt to set it.
A snippet of code is something that joins a table 'feature' with 'featureloc'. 'fmin' is a column in Featureloc
my $featureRS = $session->db->dbh->resultset('Feature')->search(
{ 'me.feature_id' => 13039071 },
{ join => 'featureloc_feature_ids',
'+select' => ['featureloc_feature_ids.fmin'],
'+as' => ['fmin']});
my $feature = $featureRS->first;
my $fmin = $feature->get_column('fmin'); # no problem
$feature->in_storage(0);
$feature->set_column('fmin'=>12); # so far, so good
$feature->set_column('fmin'=>102); # error here.
The error occurs only if I have the second call to set_column with fmin. And in 0.082404 but not 0.08120. I believe the problem arises when the second call is attempting to see if the new value in set_column differs from the previous. I'm suspicious of the call to _is_column_numeric in _eq_column_values in DBIx::Class::Row. The code in 0.08250 looks similar to my version in this call.
Joe Carlson