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

Chisel Wright chisel at herlpacker.co.uk
Mon Jun 30 23:49:58 BST 2008


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've attached a test that demonstrates this (run against 0.08010), the
output I'm seeing from the test (before my fix) and a patch file
containing my fix.

Hopefully it all makes sense and I haven't done anything insane. The
test-suite still passes.

Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

  Perl6 is marmite.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHISEL.bug.resolve_prefetch.t
Type: application/x-troff
Size: 576 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080630/53343aed/CHISEL.bug.resolve_prefetch.t
-------------- next part --------------
t/CHISEL.bug.resolve_prefetch......
1..3
ok 1 - track resultset class
ok 2 - DBICTest::Schema::Track->can('cd')
not ok 3 - no warnings

#   Failed test 'no warnings'
#   at /usr/local/share/perl/5.8.8/Test/NoWarnings.pm line 45.
# There were 2 warning(s)
# 	Previous test 2 'DBICTest::Schema::Track->can('cd')'
# 	Use of uninitialized value in pattern match (m//) at /home/chisel/development/open_source/feedback/DBIx-Class-0.08010/lib/DBIx/Class/ResultSource.pm line 895.
#  at /home/chisel/development/open_source/feedback/DBIx-Class-0.08010/lib/DBIx/Class/ResultSource.pm line 895
# 	DBIx::Class::ResultSource::resolve_prefetch('DBIx::Class::ResultSource::Table=HASH(0x89a71fc)', 'cd', 'undef', 'HASH(0x8bd7ac8)', 'undef', 'undef') called at /home/chisel/development/open_source/feedback/DBIx-Class-0.08010/lib/DBIx/Class/ResultSource.pm line 876
# 	DBIx::Class::ResultSource::resolve_prefetch('DBIx::Class::ResultSource::Table=HASH(0x89a71fc)', 'HASH(0x87a29c4)') called at t/CHISEL.bug.resolve_prefetch.t line 28
# 
# ----------
# 	Previous test 2 'DBICTest::Schema::Track->can('cd')'
# 	Use of uninitialized value in concatenation (.) or string at /home/chisel/development/open_source/feedback/DBIx-Class-0.08010/lib/DBIx/Class/ResultSource.pm line 876.
#  at /home/chisel/development/open_source/feedback/DBIx-Class-0.08010/lib/DBIx/Class/ResultSource.pm line 876
# 	DBIx::Class::ResultSource::resolve_prefetch('DBIx::Class::ResultSource::Table=HASH(0x89a71fc)', 'HASH(0x87a29c4)') called at t/CHISEL.bug.resolve_prefetch.t line 28
# 
# Looks like you failed 1 test of 3.
 Dubious, test returned 1 (wstat 256, 0x100)
 Failed 1/3 subtests 

Test Summary Report
-------------------
t/CHISEL.bug.resolve_prefetch.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
Files=1, Tests=3,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.85 cusr  0.02 csys =  0.89 CPU)
Result: FAIL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolve_prefetch_warnings.patch
Type: text/x-diff
Size: 429 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080630/53343aed/resolve_prefetch_warnings.bin


More information about the DBIx-Class mailing list