From f34b4827ee1b113641e15a9335cfd7ae1f8038d2 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Wed, 2 Sep 2020 20:58:38 +0200 Subject: [PATCH] DB/MySQL (#219) * fixed usage of field name 'rank' which became a keyword in MySQL 8 --- includes/types/profile.class.php | 2 +- pages/guild.php | 2 +- setup/tools/sqlgen/spell.func.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index 0582600d..4069f0be 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -616,7 +616,7 @@ class RemoteProfileList extends ProfileList foreach ($talentLookup as $realm => $chars) $talentLookup[$realm] = DB::Characters($realm)->selectCol('SELECT guid AS ARRAY_KEY, spell AS ARRAY_KEY2, talentGroup FROM character_talent ct WHERE guid IN (?a)', array_keys($chars)); - $talentSpells = DB::Aowow()->select('SELECT spell AS ARRAY_KEY, tab, rank FROM ?_talents WHERE class IN (?a)', array_unique($talentSpells)); + $talentSpells = DB::Aowow()->select('SELECT spell AS ARRAY_KEY, tab, `rank` FROM ?_talents WHERE class IN (?a)', array_unique($talentSpells)); if ($distrib !== null) { diff --git a/pages/guild.php b/pages/guild.php index 8051eb11..68cb836d 100644 --- a/pages/guild.php +++ b/pages/guild.php @@ -109,7 +109,7 @@ class GuildPage extends GenericPage // statistic calculations here // smuggle the guild ranks into the html - if ($ranks = DB::Aowow()->selectCol('SELECT rank AS ARRAY_KEY, name FROM ?_profiler_guild_rank WHERE guildId = ?d', $this->subjectGUID)) + if ($ranks = DB::Aowow()->selectCol('SELECT `rank` AS ARRAY_KEY, name FROM ?_profiler_guild_rank WHERE guildId = ?d', $this->subjectGUID)) $this->extraHTML = ''; diff --git a/setup/tools/sqlgen/spell.func.php b/setup/tools/sqlgen/spell.func.php index 9dc7b25f..fcbe44d2 100644 --- a/setup/tools/sqlgen/spell.func.php +++ b/setup/tools/sqlgen/spell.func.php @@ -243,7 +243,7 @@ SqlGen::register(new class extends SetupScript DB::Aowow()->query('UPDATE ?_spell SET cuFlags = cuFlags | ?d WHERE id IN (?a)', CUSTOM_DISABLED, $disables); // apply spell ranks (can't use skilllineability.dbc, as it does not contain ranks for non-player/pet spells) - $ranks = DB::World()->selectCol('SELECT first_spell_id AS ARRAY_KEY, spell_id AS ARRAY_KEY2, rank FROM spell_ranks'); + $ranks = DB::World()->selectCol('SELECT first_spell_id AS ARRAY_KEY, spell_id AS ARRAY_KEY2, `rank` FROM spell_ranks'); foreach ($ranks as $firstSpell => $sets) { // apply flag: SPELL_CU_FIRST_RANK @@ -417,7 +417,7 @@ SqlGen::register(new class extends SetupScript DB::Aowow()->query('UPDATE ?_spell SET learnedAt = ?d WHERE id = ?d', $reqSkill, $spell); // calc reqSkill for gethering-passives (herbing, mining, skinning) (on second thought .. it is set in skilllineability >.<) - $sets = DB::World()->selectCol('SELECT spell_id AS ARRAY_KEY, rank * 75 AS reqSkill FROM spell_ranks WHERE first_spell_id IN (?a)', [55428, 53120, 53125]); + $sets = DB::World()->selectCol('SELECT spell_id AS ARRAY_KEY, `rank` * 75 AS reqSkill FROM spell_ranks WHERE first_spell_id IN (?a)', [55428, 53120, 53125]); foreach ($sets as $spell => $reqSkill) DB::Aowow()->query('UPDATE ?_spell SET learnedAt = ?d WHERE id = ?d', $reqSkill, $spell);