1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

merge: 5.1 -> 5.1-rpl

conflicts:
  Text conflict in client/mysqltest.cc
  Text conflict in mysql-test/include/wait_until_connected_again.inc
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
  Text conflict in mysql-test/r/events_bugs.result
  Text conflict in mysql-test/r/log_state.result
  Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
  Text conflict in mysql-test/r/mysqlcheck.result
  Text conflict in mysql-test/r/query_cache.result
  Text conflict in mysql-test/r/status.result
  Text conflict in mysql-test/suite/binlog/r/binlog_index.result
  Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
  Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
  Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
  Text conflict in mysql-test/t/disabled.def
  Text conflict in mysql-test/t/events_bugs.test
  Text conflict in mysql-test/t/log_state.test
  Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
  Text conflict in mysql-test/t/mysqlcheck.test
  Text conflict in mysql-test/t/query_cache.test
  Text conflict in mysql-test/t/rpl_init_slave_func.test
  Text conflict in mysql-test/t/status.test
This commit is contained in:
Luis Soares
2009-01-23 13:22:05 +01:00
265 changed files with 7144 additions and 4058 deletions

View File

@ -300,7 +300,7 @@ select * from t1;
select * from t1;
show status like "Qcache_queries_in_cache";
insert delayed into t1 values (4);
--sleep 5 # Wait for insert delayed to be executed.
--sleep 5 # Wait for insert delayed to be executed.
select a from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
@ -410,10 +410,10 @@ create table t1(id int auto_increment primary key);
insert into t1 values (NULL), (NULL), (NULL);
select * from t1 where id=2;
alter table t1 rename to t2;
-- error 1146
--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
drop table t2;
-- error 1146
--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
#
@ -435,11 +435,14 @@ create table t1 (a int);
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
select * from t1 into outfile "query_cache.out.file";
--error 1086
--error ER_FILE_EXISTS_ERROR
select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
drop table t1;
let $datadir=`select @@datadir`;
--remove_file $datadir/test/query_cache.dump.file
--remove_file $datadir/test/query_cache.out.file
#
# test of SQL_SELECT_LIMIT
@ -537,7 +540,7 @@ drop table t1;
# If at least one of the above variables has changed,
# the cached query can't be reused. In the below test
# absolutely the same query is used several times,
# SELECT should fetch different results for every instance.
# SELECT should fetch different results for every instance.
# No hits should be produced.
# New cache entry should appear for every SELECT.
#
@ -554,21 +557,21 @@ show status like "Qcache_queries_in_cache";
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
SELECT a,'<27>','<27>'='<27>' FROM t1;
SELECT a,'<27>','<27>'='<27>' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
SELECT a,'<27>','<27>'='<27>' FROM t1;
SELECT a,'<27>','<27>'='<27>' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
SELECT a,'<27>','<27>'='<27>' FROM t1;
SELECT a,'<27>','<27>'='<27>' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
SET NAMES default;
@ -602,12 +605,12 @@ insert into t1 set c = repeat('x',24);
insert into t1 set c = concat(repeat('x',24),'x');
insert into t1 set c = concat(repeat('x',24),'w');
insert into t1 set c = concat(repeat('x',24),'y');
set max_sort_length=200;
set max_sort_length=200;
select c from t1 order by c, id;
reset query cache;
set max_sort_length=20;
select c from t1 order by c, id;
set max_sort_length=200;
set max_sort_length=200;
select c from t1 order by c, id;
set max_sort_length=default;
# sql_mode
@ -1017,7 +1020,7 @@ set GLOBAL query_cache_size= default;
#
# Bug #28897 UUID() returns non-unique values when query cache is enabled
# Bug#28897 UUID() returns non-unique values when query cache is enabled
#
set GLOBAL query_cache_size=1000000;
@ -1026,7 +1029,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select UUID(), a from t1`;
let $q2= `select UUID(), a from t1`;
let $q2= `select UUID(), a from t1`;
# disabling the logging of the query because the UUIDs are different each run.
--disable_query_log
@ -1047,7 +1050,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
# disabling the logging of the query because the times are different each run.
--disable_query_log
@ -1182,75 +1185,6 @@ DROP PROCEDURE proc29856;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
#
# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock
#
--echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
connect (user1,localhost,root,,test,,);
connect (user2,localhost,root,,test,,);
connect (user3,localhost,root,,test,,);
connection user1;
set GLOBAL query_cache_type=1;
set GLOBAL query_cache_limit=10000;
set GLOBAL query_cache_min_res_unit=0;
set GLOBAL query_cache_size= 100000;
flush tables;
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
create table t1 (a int);
create table t2 (a int);
insert into t1 values (1),(2),(3);
connection user2;
--echo Locking table T2 with a write lock.
lock table t2 write;
connection user1;
--echo Select blocked by write lock.
--send select *, (select count(*) from t2) from t1;
--echo Sleeing is ok, because selecting should be done very fast.
sleep 5;
connection user3;
--echo Inserting into table T1.
insert into t1 values (4);
connection user2;
--echo Unlocking the tables.
unlock tables;
connection user1;
--echo Collecting result from previously blocked select.
#
# Since the lock ordering rule in thr_multi_lock depends on
# pointer values, from execution to execution we might have
# different lock order, and therefore, sometimes lock t1 and block
# on t2, and sometimes block on t2 right away. In the second case,
# the following insert succeeds, and only then this select can
# proceed, and we actually test nothing, as the very first select
# returns 4 rows right away.
# It's fine to have a test case that covers the problematic area
# at least once in a while.
# We, however, need to disable the result log here to make the
# test repeatable.
--disable_result_log
--reap
--enable_result_log
--echo Next select should contain 4 rows, as the insert is long finished.
select *, (select count(*) from t2) from t1;
reset query cache;
select *, (select count(*) from t2) from t1;
drop table t1,t2;
connection default;
disconnect user1;
disconnect user2;
disconnect user3;
#
--echo #
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
@ -1261,7 +1195,7 @@ set global query_cache_type=0;
show status like 'Qcache_free_blocks';
--echo Restore default values.
# Bug #28211 RENAME DATABASE and query cache don't play nicely together
# Bug#28211 RENAME DATABASE and query cache don't play nicely together
#
# TODO: enable these tests when RENAME DATABASE is implemented.
# --disable_warnings
@ -1279,7 +1213,7 @@ show status like 'Qcache_free_blocks';
# show status like 'Qcache_queries_in_cache';
# drop database db2;
# set global query_cache_size=default;
#
#
# --disable_warnings
# drop database if exists db1;
# drop database if exists db3;