Show
Ignore:
Timestamp:
01/26/08 16:20:24 (3 years ago)
Author:
pookey
Message:

fix to whereIn to prevent invalid SQL being generated when no params are passed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.9/lib/Doctrine/Query/Abstract.php

    r3534 r3641  
    8787    { 
    8888        $params = (array) $params; 
     89 
     90        // if there's no params, return (else we'll get a WHERE IN (), invalid SQL) 
     91        if (!count($params)) 
     92          return; 
     93 
    8994        $a = array(); 
    9095        foreach ($params as $k => $value) { 
     
    9398                unset($params[$k]); 
    9499            } else { 
    95                 $value = '?';           
     100                $value = '?'; 
    96101            } 
    97102            $a[] = $value;