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

@@ -707,8 +707,8 @@ class RemoteProfileList extends ProfileList
// basic char data (enough for tooltips)
if ($baseData)
{
foreach (Util::createSqlBatchInsert($baseData) as $ins)
DB::Aowow()->query('INSERT INTO ?_profiler_profiles (?#) VALUES '.$ins.' AS newP(`r`, `rg`, `na`, `itr`, `ra`, `cl`, `lvl`, `ge`, `g`, `gr`, `cf`) ON DUPLICATE KEY UPDATE `name` = newP.`na`, `renameItr` = newP.`itr`', array_keys(reset($baseData)));
foreach ($baseData as $ins)
DB::Aowow()->query('INSERT INTO ?_profiler_profiles (?#) VALUES (?a) ON DUPLICATE KEY UPDATE `name` = ?, `renameItr` = ?d', array_keys($ins), array_values($ins), $ins['name'], $ins['renameItr']);
// merge back local ids
$localIds = DB::Aowow()->select(