[Dbix-class] DBIx::Class::ResultSet / resolve_prefetch() / Use of uninitialized value in pattern match

Matt S Trout dbix-class at trout.me.uk
Wed Jul 30 10:52:49 BST 2008


On Tue, Jul 29, 2008 at 11:05:59AM +0100, Chisel Wright wrote:
> On Tue, Jul 29, 2008 at 10:41:31AM +0100, Matt S Trout wrote:
> > On Mon, Jun 30, 2008 at 11:49:58PM +0100, Chisel Wright wrote:
> > > Hi all,
> > > 
> > > I noticed a problem with DBIx::Class::ResultSource::resolve_prefetch() a
> > > while back, thought I was doing something daft, hacked round it locally
> > > and forgot all about it - until today.
> > > 
> > > A co-worker was trying to clean up our apache error logs. During the
> > > process he mentioned the issue I'd forgotten about.
> > > 
> > > In a nutshell, when calling ->prefetch_columns(..) the call spews out
> > > "Use of uninitialized value in pattern match (m//)" warnings.
> > 
> > I don't see a prefetch_columns method anywhere in the main DBIC dist.
> > 
> > Did you get the wrong method name or is it something external?
> 
> I'm not sure where I got prefetch_columns() from, whatever I was
> smoking, I hope it was good.
> But hopefully the test script I attached previously speaks for itself:

Right, but is it a bug that we don't make undef alias become '' or is
it a bug that we don't die on it?

Assuming there's nothing using it in undef mode I think for the moment we
should just die() when not given an alias.

It's maybe arguable that you should have '' mean "don't add an alias at all"
but DBIC will never need that feature so I'd rather we left it for the moment.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list