mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge sql/Makefile.am: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@ -33,7 +33,7 @@ drop table if exists t1;
|
||||
create table t1(c1 int);
|
||||
insert into t1 values(1),(10),(100);
|
||||
|
||||
# Prepared statements has no parameters, query caching should happen
|
||||
# First, prepared statements with no parameters
|
||||
prepare stmt1 from "select * from t1 where c1=10";
|
||||
show status like 'Qcache_hits';
|
||||
execute stmt1;
|
||||
@ -113,7 +113,9 @@ show status like 'Qcache_hits';
|
||||
--echo ---- switch to connection default ----
|
||||
connection default;
|
||||
|
||||
# Prepared statement has parameters, query caching should not happen
|
||||
# Query caching also works when statement has parameters
|
||||
# (BUG#29318 Statements prepared with PREPARE and with one parameter don't use
|
||||
# query cache)
|
||||
prepare stmt1 from "select * from t1 where c1=?";
|
||||
show status like 'Qcache_hits';
|
||||
set @a=1;
|
||||
@ -127,6 +129,12 @@ set @a=1;
|
||||
prepare stmt4 from "select * from t1 where c1=?";
|
||||
execute stmt4 using @a;
|
||||
show status like 'Qcache_hits';
|
||||
# verify that presence of user variables forbids caching
|
||||
prepare stmt4 from "select @a from t1 where c1=?";
|
||||
execute stmt4 using @a;
|
||||
show status like 'Qcache_hits';
|
||||
execute stmt4 using @a;
|
||||
show status like 'Qcache_hits';
|
||||
--echo ---- switch to connection default ----
|
||||
connection default;
|
||||
|
||||
|
Reference in New Issue
Block a user