Skip to content

Fixing SQL issues when there are no service checks to perform#72

Merged
TheWitness merged 3 commits intomainfrom
no_checks
Feb 4, 2026
Merged

Fixing SQL issues when there are no service checks to perform#72
TheWitness merged 3 commits intomainfrom
no_checks

Conversation

@TheWitness
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes SQL syntax errors and adds a safeguard to prevent errors when there are no service checks to perform. The changes address issues that would occur when the $tests array is empty.

Changes:

  • Fixed SQL syntax error by removing comma between WHERE conditions and properly concatenating the dynamic WHERE clause
  • Added leading space to $sql_where variable for proper SQL formatting
  • Wrapped the statistics collection loop in a cacti_sizeof($tests) check to prevent iterating over empty arrays

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

browniebraun
browniebraun previously approved these changes Feb 4, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TheWitness TheWitness merged commit dc75cc3 into main Feb 4, 2026
3 checks passed
@TheWitness TheWitness deleted the no_checks branch February 4, 2026 12:43
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