Bug #83346 CLIENT_DEPRECATE_EOF not respected when query cache is enabled
Submitted: 12 Oct 2016 17:48 Modified: 7 Jul 2017 9:09
Reporter: Filipe Silva Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S2 (Serious)
Version:5.7.15 OS:Any
Assigned to: CPU Architecture:Any

[12 Oct 2016 17:48] Filipe Silva
Description:
Results from a cached query are always returned in the same protocol  CLIENT_DEPRECATE_EOF mode as of first execution, no matter what the client says afterwards.

This relates to Bug#83304.

How to repeat:
1. Turn query cache on
2. Create a simple table with one field.
3. Execute the query using a client with  CLIENT_DEPRECATE_EOF turned off.
4. Execute the query using a client with  CLIENT_DEPRECATE_EOF turned on.

Steps 3. and 4. can be executed with Connector/J 5.1.38 and Connector/J 5.1.39 respectively.

Between steps 3. and 4. the response from the server is exactly the same but the first should contain the deprecated EOF packets while the latter the new OK packets form.

Individually, each mode works well, this problem arises when combining clients with the two modes.

Suggested fix:
Make the response from cached queries comply with the CLIENT_DEPRECATE_EOF mode from current session instead of the one from first execution.

Or, invalidate query cache if current CLIENT_DEPRECATE_EOF mode is not the same as per first execution.
[13 Oct 2016 13:38] MySQL Verification Team
Thank you for the report.
[22 Mar 2017 8:46] Daniƫl van Eeden
Marking Bug #85551 as a duplicate
[7 Jul 2017 9:09] Erlend Dahl
MySQL will no longer invest in the query cache, see:

http://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/
[7 Jul 2017 13:28] monty solomon
The referenced article from the MySQL Server Blog states that the query cache will continue to be supported for the life time of MySQL 5.7