~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/include/query_cache_sql_prepare.inc

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
############### include/query_cache_sql_prepare.inc ################
2
2
#
3
3
# This is to see how statements prepared via the PREPARE SQL command
4
 
# go into the query cache: if using parameters they cannot; if not
5
 
# using parameters they can.
 
4
# go into the query cache.
6
5
# Query cache is abbreviated as "QC"
7
6
#
8
7
# Last update:
 
8
# 2008-05-26 Kostja
 
9
#               - Add test coverage for automatic statement reprepare
 
10
#
9
11
# 2007-05-03 ML - Move t/query_cache_sql_prepare.test
10
12
#                 to   include/query_cache_sql_prepare.inc
11
13
#               - Create two toplevel tests sourcing this routine
490
492
 
491
493
--echo
492
494
--echo ########################################################################
 
495
--echo #
 
496
--echo # Bug#27430 Crash in subquery code when in PS and table DDL changed
 
497
--echo # after PREPARE
 
498
--echo # Check the effect of automatic reprepare on query cache
 
499
--echo #
 
500
--echo ########################################################################
 
501
--disable_warnings
 
502
drop table if exists t1;
 
503
--enable_warnings
 
504
create table t1 (a varchar(255));
 
505
insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
 
506
flush status;
 
507
prepare stmt from "select a from t1";
 
508
execute stmt;
 
509
set @@global.query_cache_size=0;
 
510
alter table t1 add column b int;
 
511
execute stmt;
 
512
set @@global.query_cache_size=100000;
 
513
execute stmt;
 
514
execute stmt;
 
515
--echo #
 
516
--echo # Sic: ALTER TABLE caused an automatic reprepare 
 
517
--echo # of the prepared statement. Since the query cache was disabled
 
518
--echo # at the time of reprepare, the new prepared statement doesn't
 
519
--echo # work with it.
 
520
--echo # 
 
521
show status like 'Qcache_hits';
 
522
show status like 'Qcache_queries_in_cache';
 
523
--echo # Cleanup
 
524
deallocate prepare stmt;
 
525
drop table t1;
493
526
 
494
527
###############################################################################
495
528