MDEV-39828 Stabilize query_cache_executable_comments counter checks#5228
Open
tonychen2001 wants to merge 1 commit into
Open
MDEV-39828 Stabilize query_cache_executable_comments counter checks#5228tonychen2001 wants to merge 1 commit into
tonychen2001 wants to merge 1 commit into
Conversation
The test asserted absolute Qcache_inserts/Qcache_hits values but reset them with FLUSH STATUS which does not clear those global counters. The expected values were therefore cumulative from a pristine server, so the test drifted by a constant offset whenever the mysqld instance was reused with prior query cache activity (fulltest server reuse, --repeat). E.g: ``` ./build/mysql-test/mysql-test-run.pl --parallel=1 --repeat=2 main.query_cache_executable_comments ``` Use FLUSH GLOBAL STATUS instead, matching every other query cache test (query_cache.test, query_cache_with_views.test, subselect_cache.test). This zeroes the SHOW Qcache counters, making each case independent of server history. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
There was a problem hiding this comment.
Code Review
This pull request updates the query cache executable comments test suite by replacing FLUSH STATUS with FLUSH GLOBAL STATUS in both the test and result files. This change also updates the expected status variable values, such as Qcache_inserts and Qcache_hits, in the test results. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
Description
The test
main.query_cache_executable_commentsis unreliable and fails onthe builders (MDEV-39828).
It asserts the absolute values of the global status counters
Qcache_insertsand
Qcache_hits, but resets them per case withFLUSH STATUS.FLUSH STATUSdoes not reset the global countersquery_cache.hits/query_cache.inserts. As a result the recorded values wereactually cumulative from server start, and the test only passed against a
pristine
mysqld. When the server instance is reused with prior query-cacheactivity (server reuse,
--repeat), the leftover counter values areadded to every assertion, producing a constant offset and a "Result length
mismatch".
Fix: Replace the
FLUSH STATUScalls withFLUSH GLOBAL STATUSwhich actually resets the Qcache counters. This is the idiomatic patternalready used by every other query-cache test (
query_cache.test,query_cache_with_views.test,subselect_cache.test, thequery_cache*.incincludes, etc.).
How can this PR be tested?
Execute the
main.query_cache_executable_commentstest inmysql-test-run.Before this change:
The test passes in isolation but fails whenever the server is reused with
prior query-cache activity. This is reproducible with
--repeat=2(thesecond iteration reuses the same
mysqldinstance):After this change:
Running the test with
--repeat=2inmysql-test-runshows no failures, with the server reused throughout:Basing the PR against the correct MariaDB version
Copyright
All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.