Repository navigation
fix(node): node stats query on MySQL and MariaDB - #1132
Merged
Merged
Conversation
get_node_stats repeated the truncation expression in its HAVING clause, which MySQL 9 and MariaDB reject (Unknown column 'node_stats.created_at'). Use _exclude_partial_first_bucket, which compares against the period_start alias, and drop the MySQL skip in the bucket limits test.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
…MySQL, MariaDB and PostgreSQL (PasarGuard#1132)
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
…on port/w2-chain-v, the fork's get_node_stats has no HAVING since 1519b6b
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
…ard#1132 fork commits on port/w2-chain-ad after the rebase onto main 2cad25c, and record the generated client fix of the PasarGuard#1127 pick
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
…utbounds bucket test and MySQL skip obligations that the PasarGuard#1127 and PasarGuard#1132 rows defer to it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GET /api/node/{id}/statsreturned "Database temporarily unavailable" on MySQL 9 and MariaDB:get_node_statshad its own copy of the "drop the partial first bucket" HAVING clause, and it repeated the whole truncation expression there. MySQL 9 and MariaDB reject that._exclude_partial_first_bucket, which the usage queries already use, compares against theperiod_startalias instead, soget_node_statsnow calls it.Node system stats are only recorded on PostgreSQL, so on MySQL the endpoint now returns an empty list, as on SQLite.
The MySQL skip in
test_stats_endpoint_accepts_normal_range(added in #1128) is removed, so CI covers the endpoint on MySQL and MariaDB again.