Show
Ignore:
Timestamp:
05/30/08 02:23:26 (18 months ago)
Author:
bchoate
Message:

Updates to optimize recently_commented_on, category and tag attributes for Entries tag - BugId:79914. Search app can now supply user state - BugId:79906. Fix for 2-digit year bug - BugId:79924

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/lib/MT/ObjectDriver/Driver/DBI.pm

    r2459 r2463  
    160160    $stmt->group([ map { { column => $_ } } @group ]); 
    161161 
    162     ## Ugly. 
    163     my $sql = $stmt->as_sql; 
    164  
    165162    ## Set statement's ORDER clause if any. 
    166163    if ($order) { 
    167164        if (! ref($order)) { 
    168             $sql .= "\nORDER BY " . $decorate->($order); 
    169             if ($direction) { 
    170                 $sql .= $direction eq 'descend' ? ' DESC' : ' ASC'; 
    171             } 
     165            $stmt->order( [ { column => $decorate->($order), 
     166                desc => $direction eq 'descend' ? 'DESC' : 'ASC' 
     167            } ] ); 
    172168        } else { 
    173169            my @order; 
     
    179175            } 
    180176            $stmt->order(\@order); 
    181             $sql .= "\n" . $stmt->as_aggregate('order'); 
    182         } 
    183     } 
     177        } 
     178    } 
     179 
     180    my $sql = $stmt->as_sql; 
    184181 
    185182    my $dbh = $driver->r_handle;