| Bug #35020 | illegal sql_cache select syntax | ||
|---|---|---|---|
| Submitted: | 4 Mar 2008 3:45 | Modified: | 25 Jul 2008 3:50 |
| Reporter: | Marc Alff | ||
| Status: | Closed | ||
| Category: | Server: Parser | Severity: | S3 (Non-critical) |
| Version: | 5.1/6.0 | OS: | Any |
| Assigned to: | Martin Hansson | Target Version: | |
| Triage: | D3 (Medium) | ||
[4 Mar 2008 3:45]
Marc Alff
[4 Mar 2008 3:52]
Miguel Solorzano
Thank you for the bug report.
[4 Mar 2008 4:27]
Marc Alff
See related Bug#34943
[7 Mar 2008 10:58]
Martin Hansson
This is actually two orthogonal bugs: #1 SQL_NO_CACHE/SQL_CACHE should not be allowed in subqueries. #2 It should not be possible to combine SQL_NO_CACHE and SQL_CACHE. #2 has been reported as Bug#35138: Incompatible SELECT options should not be allowed.
[10 Mar 2008 10:53]
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/43665 ChangeSet@1.2609, 2008-03-10 10:22:24+01:00, mhansson@riffraff.(none) +8 -0 Bug#35020: illegal sql_cache select syntax The select option flags SQL_CACHE and SQL_NO_CACHE were available for use in subqueries, which they're not supposed to. Fixed by creating special parser rules for select options in subqueries.
[13 Mar 2008 16:49]
Marc Alff
Patch approved by email, with minor comments.
[1 Apr 2008 11:35]
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/44721 ChangeSet@1.2609, 2008-04-01 11:29:01+02:00, mhansson@riffraff.(none) +3 -0 Bug#35020: illegal sql_cache select syntax The select option flags SQL_CACHE and SQL_NO_CACHE were available for use in subqueries, which they're not supposed to. Fixed by creating special parser rules for select options in subqueries. Added tests that SQL_CACHE / SQL_NO_CACHE may only be used once on the first top-level SELECT statement and not in presence of its opposite.
[4 Apr 2008 11:50]
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/44901 ChangeSet@1.2610, 2008-04-04 11:43:32+02:00, mhansson@riffraff.(none) +1 -0 Bug#35020: Post-merge fix.
[4 Apr 2008 13:14]
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/44910 ChangeSet@1.2623, 2008-04-04 13:08:25+02:00, mhansson@riffraff.(none) +1 -0 Bug#35020: Post-merge fix.
[28 May 2008 12:01]
Bugs System
Pushed into 6.0.6-alpha
[25 Jul 2008 3:50]
Paul DuBois
Noted in 6.0.6 changelog. The use of the SQL_CACHE and SQL_NO_CACHE options in SELECT statements now is checked more restrictively: 1) Previously, both options could be given in the same statement. This is no longer true; only one can be given. 2) Previously, these options could be given in SELECT statements that were not at the top-level. This is no longer true; the options are disallowed in subqueries (including subqueries in the FROM clause, and SELECT statements in unions other than the first SELECT.
