Commit ee734b44 authored by unknown's avatar unknown

Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug2-5.0

into sanja.is.com.ua:/home/bell/mysql/bk/work-bug8-5.0

parents 7ff88ba7 dd72175d
This diff is collapsed.
......@@ -756,6 +756,50 @@ 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;
#
# queries with subquery in the FROM clause (BUG#11522)
#
create table t1 (a int);
insert into t1 values (1);
reset query cache;
flush status;
select * from (select * from t1) a;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from (select * from t1) a;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
insert into t1 values (2);
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from (select * from t1) a;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
drop table t1;
#
# SP cursors and selects with query cache (BUG#9715)
#
......
......@@ -278,7 +278,6 @@ TODO list:
- Move MRG_MYISAM table type processing to handlers, something like:
tables_used->table->file->register_used_filenames(callback,
first_argument);
- Make derived tables cachable.
- QC improvement suggested by Monty:
- Add a counter in open_table() for how many MERGE (ISAM or MyISAM)
tables are cached in the table cache.
......@@ -2135,6 +2134,13 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
tables_used;
tables_used= tables_used->next_global, n++, block_table++)
{
if (tables_used->derived)
{
DBUG_PRINT("qcache", ("derived table skipped"));
n--;
block_table--;
continue;
}
block_table->n= n;
if (tables_used->view)
{
......@@ -2778,6 +2784,12 @@ static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
tables_used->table->s->table_name,
tables_used->table->s->table_cache_key,
tables_used->table->s->db_type));
if (tables_used->derived)
{
table_count--;
DBUG_PRINT("qcache", ("derived table skipped"));
continue;
}
*tables_type|= tables_used->table->file->table_cache_type();
/*
......
......@@ -146,6 +146,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
{
DBUG_RETURN(NULL);
}
query_cache_abort(&thd->net);
if (thd->warn_list.elements < thd->variables.max_error_count)
{
......
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