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
This commit is contained in:
parent
f3dd815156
commit
e45709dfbd
File diff suppressed because one or more lines are too long
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user