Commit 7e307f3c authored by unknown's avatar unknown

abort storing query to query cache if warnings appeared (BUG#9414)


mysql-test/r/query_cache.result:
  Query with warning prohibited to query cache
mysql-test/t/query_cache.test:
  Query with warning prohibited to query cache
sql/sql_error.cc:
  abort storing query to query cache if warnings appeared
parent 93b7a93b
This diff is collapsed.
......@@ -730,4 +730,23 @@ flush query cache;
drop table t1, t2;
#
# Query with warning prohibited to query cache (BUG#9414)
#
flush status;
CREATE TABLE t1 (
`date` datetime NOT NULL default '0000-00-00 00:00:00',
KEY `date` (`date`)
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('20050326');
INSERT INTO t1 VALUES ('20050325');
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0';
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
drop table t1;
set GLOBAL query_cache_size=0;
......@@ -108,6 +108,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES))
return(0);
query_cache_abort(&thd->net);
if (thd->query_id != thd->warn_id)
mysql_reset_errors(thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment