mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Backport of:
---------------------------------------------------------- revno: 2630.2.6 committer: Konstantin Osipov <konstantin@mysql.com> branch nick: mysql-6.0-27430 timestamp: Mon 2008-05-26 16:12:28 +0400 message: Cover four special cases of WL#4166 with tests: - when the query cache is disabled at the time of prepared statement reprepare - when long data parameters are used - when character_set_connection != character_set_client, and a parameter conversion takes place - when parameter data is out of acceptable range, e.g. year 10000 is supplied as part of MYSQL_TYPE_DATETIME value. The server is supposed to warn in such case.
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
############### include/query_cache_sql_prepare.inc ################
|
||||
#
|
||||
# This is to see how statements prepared via the PREPARE SQL command
|
||||
# go into the query cache: if using parameters they cannot; if not
|
||||
# using parameters they can.
|
||||
# go into the query cache.
|
||||
# Query cache is abbreviated as "QC"
|
||||
#
|
||||
# Last update:
|
||||
# 2008-05-26 Kostja
|
||||
# - Add test coverage for automatic statement reprepare
|
||||
#
|
||||
# 2007-05-03 ML - Move t/query_cache_sql_prepare.test
|
||||
# to include/query_cache_sql_prepare.inc
|
||||
# - Create two toplevel tests sourcing this routine
|
||||
@ -490,6 +492,37 @@ use test;
|
||||
|
||||
--echo
|
||||
--echo ########################################################################
|
||||
--echo #
|
||||
--echo # Bug#27430 Crash in subquery code when in PS and table DDL changed
|
||||
--echo # after PREPARE
|
||||
--echo # Check the effect of automatic reprepare on query cache
|
||||
--echo #
|
||||
--echo ########################################################################
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a varchar(255));
|
||||
insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
|
||||
flush status;
|
||||
prepare stmt from "select a from t1";
|
||||
execute stmt;
|
||||
set @@global.query_cache_size=0;
|
||||
alter table t1 add column b int;
|
||||
execute stmt;
|
||||
set @@global.query_cache_size=100000;
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
--echo #
|
||||
--echo # Sic: ALTER TABLE caused an automatic reprepare
|
||||
--echo # of the prepared statement. Since the query cache was disabled
|
||||
--echo # at the time of reprepare, the new prepared statement doesn't
|
||||
--echo # work with it.
|
||||
--echo #
|
||||
show status like 'Qcache_hits';
|
||||
show status like 'Qcache_queries_in_cache';
|
||||
--echo # Cleanup
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
Reference in New Issue
Block a user