1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

MySQL: Fix for insert with '_DUPLICATE_KEY_UPDATE'

This commit is contained in:
Cameron
2016-08-07 14:17:27 -07:00
parent 63026ef1c4
commit 0348fab9bf

View File

@@ -859,6 +859,7 @@ class e_db_mysql
$arg = array_merge($arg, $this->getFieldDefs($tableName));
}
$argUpdate = $arg; // used when DUPLICATE_KEY_UPDATE is active;
// Handle 'NOT NULL' fields without a default value
@@ -899,7 +900,7 @@ class e_db_mysql
if($DUPEKEY_UPDATE === true)
{
$query .= " ON DUPLICATE KEY UPDATE ";
$query .= $this->_prepareUpdateArg($tableName, $arg);
$query .= $this->_prepareUpdateArg($tableName, $argUpdate);
}
}