Skip to content

Conversation

@idoqo
Copy link
Contributor

@idoqo idoqo commented Oct 30, 2025

PMM-14321

Copy link

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 PR fixes a bounds checking bug in the query fingerprinting logic that could cause an index out of bounds error when processing certain SQL queries. The fix adds a length check before accessing q[qi+1] to prevent potential panics.

  • Added bounds checking to prevent index out of range errors
  • Added test coverage for system variable queries that trigger the edge case

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
query/query.go Added bounds check (qi+1 < len(q)) before accessing q[qi+1] to prevent index out of bounds errors
query/query_test.go Added test case for system variable queries to verify the bug fix works correctly

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

@it-percona-cla
Copy link

it-percona-cla commented Nov 25, 2025

CLA assistant check
All committers have signed the CLA.

@idoqo idoqo force-pushed the PMM-14321-slowlog-crashes branch from 153252e to c2df7b9 Compare November 29, 2025 15:37
@idoqo idoqo merged commit 5d45a34 into main Dec 1, 2025
2 checks passed
@idoqo idoqo deleted the PMM-14321-slowlog-crashes branch December 1, 2025 04:02
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.

5 participants