Bug #27792 | query cache returns wrong result, with certain system variables | ||
---|---|---|---|
Submitted: | 12 Apr 2007 20:50 | Modified: | 17 May 2007 14:09 |
Reporter: | Martin Friebe (Gold Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.40 4.1.23,5.1BK | OS: | Any |
Assigned to: | Kristofer Pettersson | CPU Architecture: | Any |
Tags: | qc, query cache, system variables, wrong result |
[12 Apr 2007 20:50]
Martin Friebe
[12 Apr 2007 20:50]
Martin Friebe
patch + test
Attachment: qcache.patch (text/x-patch), 7.90 KiB.
[12 Apr 2007 23:09]
MySQL Verification Team
Thank you for the bug report and suggestion patch. Verified as described.
[3 May 2007 21:29]
Kristofer Pettersson
Update: Because of the growing size of the query cache record, the patch needs some more work. For example rather than saving ft_boolean_syntax, it might be better to clear the entire query cache when this system variable has changed.
[4 May 2007 11:12]
Martin Friebe
Parts of this Bug may now depend on Bug #28234 If ft_query_expansion_limit should be changeable at runtime, it needs to be added here. If ft_boolean_syntax should be changeable per session, then this may affect clearing the query cache. ---- There is a different way to reduce the size of the structure, but it requires far more work, if interest I can outline the details in a separate bug/feature request. (I will probably do anyway, as it goes along with a separate issue of storing some duplicates) Queries only need to store and compare those environmental setting, that are affecting the query (max_group_concat_length is only relevant for queries that contain group_concat). This can be done. I am aware that the query cache is checked before the query is parsed, and that at this time the server is unaware of the presence of this function.
[4 May 2007 11:47]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/26091 ChangeSet@1.2637, 2007-05-04 13:47:01+02:00, thek@adventure.(none) +5 -0 Bug #27792 query cache returns wrong result, with certain system variables - Queries in the query cache are identified by the individual characters in the query statement, the current database and the current environment expressed as a set of system variable flags. - Since the set of environment flags didn't properly describe the current environment unexpected results were returned from the query cache. - Query cache is now cleared when the variable ft_boolean_syntax is updated. - An identification flag for the variable default_week_format is added to the query cache record. Thanks to Martin Friebe who has supplied significant parts of this patch.
[4 May 2007 11:57]
Kristofer Pettersson
> <snip> if interest I can outline the details in a separate bug/feature > request. (I will probably do anyway, as it goes along with a separate issue of > storing some duplicates) Please do this! Your ideas are most welcome!
[4 May 2007 13:51]
Martin Friebe
done: see Bug #28241
[16 May 2007 13:46]
Bugs System
Pushed into 4.1.23
[16 May 2007 13:47]
Bugs System
Pushed into 5.0.42
[16 May 2007 13:49]
Bugs System
Pushed into 5.1.19-beta
[17 May 2007 14:09]
Paul DuBois
Noted in 4.1.23, 5.0.42, 5.1.19 changelogs. Changes to some system variables should invalidate statements in the query cache, but invalidation did not happen.