Description:
`SHOW WARNINGS` incorrectly displays warnings from an earlier query if the most recent query hit the query cache.
How to repeat:
Suppose that the table test.test_table exists but test.test_table_nope does not exist. Then
mysql> select * from test.test_table_nope;
ERROR 1146 (42S02): Table 'test.test_table_nope' doesn't exist
mysql> select * from test.test_table;
Empty set (0.16 sec)
mysql> show warnings;
Empty set (0.00 sec)
mysql> select * from test.test_table_nope;
ERROR 1146 (42S02): Table 'test.test_table_nope' doesn't exist
mysql> select * from test.test_table;
Empty set (0.00 sec)
mysql> show warnings;
+-------+------+--------------------------------------------+
| Level | Code | Message |
+-------+------+--------------------------------------------+
| Error | 1146 | Table 'test.test_table_nope' doesn't exist |
+-------+------+--------------------------------------------+
1 row in set (0.00 sec)
Since both sets of 3 queries were identical, I expected the second SHOW WARNINGS to also return an empty set. (Expected behavior is seen with SQL_NO_CACHE but that's not necessarily desirable.)