Changeset 175

Show
Ignore:
Timestamp:
05/04/06 00:16:33 (4 years ago)
Author:
sky
Message:

r178@crucially-3 (orig r1212): btrott | 2006-04-13 10:22:42 -0700
There's an edge case where we don't get exactly back the number of
items that we requested from the cache, BUT we don't need to get any
more. Very strange. But anyway, this was causing us to give
DBI->lookup_multi an empty array ref of PKs, which generates mangled
SQL. This patch fixes that.


Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Data/ObjectDriver/Driver/BaseCache.pm

    r173 r175  
    107107    } 
    108108 
    109     my $more = $driver->fallback->lookup_multi($class, \@need); 
    110     $i = 0; 
    111     for my $obj (@$more) { 
    112         $got[ $need2got{$i++} ] = $obj; 
     109    if (@need) { 
     110        my $more = $driver->fallback->lookup_multi($class, \@need); 
     111        $i = 0; 
     112        for my $obj (@$more) { 
     113            $got[ $need2got{$i++} ] = $obj; 
     114        } 
    113115    } 
    114116