mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
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:
@@ -37,7 +37,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
||||
|
||||
$data = DB::World()->select($q);
|
||||
foreach ($data as $d)
|
||||
DB::Aowow()->query('INSERT INTO ?_quests_startend (?#) VALUES (?a) AS newQSE(`t`, `ti`, `qi`, `m`, `ei`) ON DUPLICATE KEY UPDATE `method` = `method` | newQSE.`m`, `eventId` = IF(`eventId` = 0, newQSE.`ei`, `eventId`)', array_keys($d), array_values($d));
|
||||
DB::Aowow()->query('INSERT INTO ?_quests_startend (?#) VALUES (?a) ON DUPLICATE KEY UPDATE `method` = `method` | ?d, `eventId` = IF(`eventId` = 0, ?d, `eventId`)', array_keys($d), array_values($d), $d['method'], $d['eventId']);
|
||||
}
|
||||
|
||||
// update quests without start as unavailable
|
||||
|
||||
Reference in New Issue
Block a user