mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
47dc78e6a3
mysql-test/r/view.result: query cache part moved to separate test mysql-test/t/view.test: query cache part moved to separate test sql/item_func.cc: fixed for safety sql/sql_base.cc: do not use real table call with view fixed wrapping * substitured items fixed fix_fields call parameter (refference) sql/sql_yacc.yy: added initialisation of SELECT in commands which can use subqueries sql/table.cc: fised fix_fields call parameter sql/table.h: new view specific method
58 lines
1.6 KiB
Text
58 lines
1.6 KiB
Text
-- source include/have_query_cache.inc
|
|
#
|
|
# QUERY CACHE options for VIEWs
|
|
#
|
|
set GLOBAL query_cache_size=1355776;
|
|
flush status;
|
|
create table t1 (a int, b int);
|
|
|
|
# queries with following views should not be in query cache
|
|
create view v1 (c,d) as select sql_no_cache a,b from t1;
|
|
create view v2 (c,d) as select a+rand(),b from t1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from v1;
|
|
select * from v2;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from v1;
|
|
select * from v2;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
|
|
drop view v1,v2;
|
|
|
|
# SQL_CACHE option
|
|
set query_cache_type=demand;
|
|
flush status;
|
|
# query with view will be cached, but direct acess to table will not
|
|
create view v1 (c,d) as select sql_cache a,b from t1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from v1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from t1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from v1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
select * from t1;
|
|
show status like "Qcache_queries_in_cache";
|
|
show status like "Qcache_inserts";
|
|
show status like "Qcache_hits";
|
|
drop view v1;
|
|
set query_cache_type=default;
|
|
|
|
drop table t1;
|
|
set GLOBAL query_cache_size=default;
|
|
|
|
|