mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
dont use IN ( ), if there's only one value, it's slower for MySQL
This commit is contained in:
parent
0f2eceefb8
commit
96db81c50c
@ -7,7 +7,7 @@
|
||||
* @package api
|
||||
* @subpackage db
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2003-9 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2003-10 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
@ -1469,6 +1469,11 @@ class egw_db
|
||||
{
|
||||
$maxlength = $column_definitions[$key]['type'] == 'varchar' ? $column_definitions[$key]['precision'] : null;
|
||||
}
|
||||
// dont use IN ( ), if there's only one value, it's slower for MySQL
|
||||
if (is_array($data) && count($data) == 1)
|
||||
{
|
||||
$data = array_shift($data);
|
||||
}
|
||||
if (is_array($data))
|
||||
{
|
||||
$or_null = '';
|
||||
|
Loading…
Reference in New Issue
Block a user