Compat/SQL

* make ON DUPLICATE KEY UPDATE queries compatible with both MySQL8 and MariaDB by providing update values from php
This commit is contained in:
Sarjuuk
2025-01-26 13:50:12 +01:00
parent 5309843d77
commit 88da3588e5
3 changed files with 5 additions and 5 deletions

View File

@@ -1263,7 +1263,7 @@ abstract class Util
return $json;
}
public static function createSqlBatchInsert(array $data)
public static function createSqlBatchInsert(array $data) : array
{
$nRows = 100;
$nItems = count(reset($data));
@@ -1278,7 +1278,7 @@ abstract class Util
if (count($d) != $nItems)
return [];
$d = array_map(function ($x) { return $x === null ? 'NULL' : DB::Aowow()->escape($x); }, $d);
$d = array_map(fn($x) => $x === null ? 'NULL' : DB::Aowow()->escape($x), $d);
$buff[] = implode(',', $d);