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
|
* @package api
|
||||||
* @subpackage db
|
* @subpackage db
|
||||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
* @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$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1469,6 +1469,11 @@ class egw_db
|
|||||||
{
|
{
|
||||||
$maxlength = $column_definitions[$key]['type'] == 'varchar' ? $column_definitions[$key]['precision'] : null;
|
$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))
|
if (is_array($data))
|
||||||
{
|
{
|
||||||
$or_null = '';
|
$or_null = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user