mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 17:18:54 +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';
|
||||
break;
|
||||
case 'mysql':
|
||||
$cmd = 'REPLACE';
|
||||
break;
|
||||
// use replace if primary keys are included
|
||||
if (count(array_intersect(array_keys($where),$table_def['pk'])) == count($table_def['pk']))
|
||||
{
|
||||
$cmd = 'REPLACE';
|
||||
break;
|
||||
}
|
||||
// fall through !!!
|
||||
default:
|
||||
$this->select($table,'count(*)',$where,$line,$file);
|
||||
if ($this->next_record() && $this->f(0))
|
||||
|
Loading…
Reference in New Issue
Block a user