Skip to content

fix(dashboard): quote reserved word 'rows' in table_sizes query - #409

Merged
TheWitness merged 1 commit into
developfrom
fix/dashboard-rows-reserved-word
Nov 7, 2026
Merged

TheWitness merged 1 commit into
developfrom
fix/dashboard-rows-reserved-word

Conversation

@TheWitness

Copy link
Copy Markdown
Member

The table_sizes dashboard card aliased TABLE_ROWS AS rows without quoting.
ROWS is a reserved word in modern MariaDB/MySQL, so the query failed with
a syntax error ("...near 'rows, (DATA_LENGTH + INDEX_LENGTH) AS bytes
FROM information_schema.TABLES...'") and the card logged a DB error.

Backtick-quote the alias. The result key stays 'rows', so the downstream
rendering ($t['rows']) is unchanged.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The table_sizes dashboard card aliased TABLE_ROWS AS rows without quoting.
ROWS is a reserved word in modern MariaDB/MySQL, so the query failed with
a syntax error ("...near 'rows, (DATA_LENGTH + INDEX_LENGTH) AS bytes
FROM information_schema.TABLES...'") and the card logged a DB error.

Backtick-quote the alias. The result key stays 'rows', so the downstream
rendering ($t['rows']) is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:52
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change that quotes the reserved SQL alias rows.

No open issues 🎉

What changed in this PR

Fixes the Device Tracking dashboard’s table-size query by quoting the reserved SQL alias rows, preventing syntax errors on modern MariaDB/MySQL.

Changes:

  • Changes TABLE_ROWS AS rows to TABLE_ROWS AS `rows` while preserving the rows result key and existing rendering.
File Description
mactrack_view_dashboard.php Quotes the rows alias in the table_sizes card query.

Review effort: Balanced

@TheWitness
TheWitness merged commit d51cd70 into develop Nov 7, 2026
8 checks passed
@TheWitness
TheWitness deleted the fix/dashboard-rows-reserved-word branch November 7, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants