Fix ambiguous 'online' column on character pages
The bot-account filter joins acore_auth.account, which has its own `online`
column. The character query selected several columns unqualified, so `online`
became ambiguous and every character page returned a 500:
Error: Column 'online' in field list is ambiguous
at CharacterController.getCharacterData
Qualifies every column in that SELECT with `characters`, rather than only the
one that collided, so a future join cannot reintroduce this. The search and
guild listings were never affected: DataTablesSsp always qualifies its columns
with the base table, and only this hand-written query did not.
Verified against the live realm - the previously failing query for
Heavenlymagi now returns its row, and a bot name still returns none.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NW2ooBP2KPqQVzdZZDMvZd
This commit is contained in:
parent
424d65233b
commit
0e7cf0f988
1 changed files with 1 additions and 1 deletions
|
|
@ -354,7 +354,7 @@ export class CharacterController {
|
|||
|
||||
const [rows] = await this.armory.getCharactersDb(realm.name).query({
|
||||
sql: `
|
||||
SELECT \`characters\`.\`guid\`, \`characters\`.\`name\`, \`race\`, \`class\`, \`gender\`, \`level\`, \`skin\`, \`face\`, \`hairStyle\`, \`hairColor\`, \`facialStyle\`, \`playerFlags\`, \`online\`, \`guild\`.\`name\` AS \`guild\`
|
||||
SELECT \`characters\`.\`guid\`, \`characters\`.\`name\`, \`characters\`.\`race\`, \`characters\`.\`class\`, \`characters\`.\`gender\`, \`characters\`.\`level\`, \`characters\`.\`skin\`, \`characters\`.\`face\`, \`characters\`.\`hairStyle\`, \`characters\`.\`hairColor\`, \`characters\`.\`facialStyle\`, \`characters\`.\`playerFlags\`, \`characters\`.\`online\`, \`guild\`.\`name\` AS \`guild\`
|
||||
FROM \`characters\`
|
||||
LEFT JOIN \`guild_member\` ON \`guild_member\`.\`guid\` = \`characters\`.\`guid\`
|
||||
LEFT JOIN \`guild\` ON \`guild\`.\`guildid\` = \`guild_member\`.\`guildid\`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue