mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-29 18:19:04 +01:00
use replace for mysql only if the primary keys are included
This commit is contained in:
parent
f2fe2045bd
commit
ac501a1937
@ -1148,8 +1148,13 @@
|
|||||||
$sql_append = ' UPDATE DUPLICATES';
|
$sql_append = ' UPDATE DUPLICATES';
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
|
// use replace if primary keys are included
|
||||||
|
if (count(array_intersect(array_keys($where),$table_def['pk'])) == count($table_def['pk']))
|
||||||
|
{
|
||||||
$cmd = 'REPLACE';
|
$cmd = 'REPLACE';
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
// fall through !!!
|
||||||
default:
|
default:
|
||||||
$this->select($table,'count(*)',$where,$line,$file);
|
$this->select($table,'count(*)',$where,$line,$file);
|
||||||
if ($this->next_record() && $this->f(0))
|
if ($this->next_record() && $this->f(0))
|
||||||
|
Loading…
Reference in New Issue
Block a user