mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed sleep time in mysql-test-run
Fixed bug in query cache. Cleaned up des_crypt code.
This commit is contained in:
@ -46,7 +46,7 @@ which ()
|
||||
sleep_until_file_deleted ()
|
||||
{
|
||||
file=$1
|
||||
loop=$SLEEP_TIME
|
||||
loop=$SLEEP_TIME_FOR_DELETE
|
||||
while (test $loop -gt 0)
|
||||
do
|
||||
sleep 1
|
||||
@ -61,7 +61,8 @@ sleep_until_file_deleted ()
|
||||
sleep_until_file_exists ()
|
||||
{
|
||||
file=$1
|
||||
loop=60 # Should be long enough enough for all cases
|
||||
loop=$2
|
||||
org_time=$2
|
||||
while (test $loop -gt 0)
|
||||
do
|
||||
sleep 1
|
||||
@ -71,7 +72,7 @@ sleep_until_file_exists ()
|
||||
fi
|
||||
loop=`expr $loop - 1`
|
||||
done
|
||||
echo "ERROR: $file was not created in 60 seconds; Aborting"
|
||||
echo "ERROR: $file was not created in $org_time seconds; Aborting"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
@ -172,7 +173,11 @@ DO_GCOV=""
|
||||
DO_GDB=""
|
||||
DO_DDD=""
|
||||
DO_CLIENT_GDB=""
|
||||
SLEEP_TIME=10
|
||||
SLEEP_TIME_FOR_DELETE=10
|
||||
SLEEP_TIME_FOR_FIRST_MASTER=200 # Enough time to create innodb tables
|
||||
SLEEP_TIME_FOR_SECOND_MASTER=30
|
||||
SLEEP_TIME_FOR_FIRST_SLAVE=30
|
||||
SLEEP_TIME_FOR_SECOND_SLAVE=30
|
||||
CHARACTER_SET=latin1
|
||||
DBUSER=""
|
||||
START_WAIT_TIMEOUT=3
|
||||
@ -235,7 +240,6 @@ while test $# -gt 0; do
|
||||
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
|
||||
--sleep=*)
|
||||
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1"
|
||||
SLEEP_TIME=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
|
||||
;;
|
||||
--mysqld=*)
|
||||
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
|
||||
@ -260,8 +264,9 @@ while test $# -gt 0; do
|
||||
fi
|
||||
DO_GDB=1
|
||||
# We must use manager, as things doesn't work on Linux without it
|
||||
USE_MANAGER=1
|
||||
USE_RUNNING_SERVER=""
|
||||
# This needs to be checked properly
|
||||
# USE_MANAGER=1
|
||||
# USE_RUNNING_SERVER=""
|
||||
;;
|
||||
--client-gdb )
|
||||
if [ x$BINARY_DIST = x1 ] ; then
|
||||
@ -755,7 +760,8 @@ EOF
|
||||
else
|
||||
manager_launch master $MYSQLD $master_args
|
||||
fi
|
||||
sleep_until_file_exists $MASTER_MYPID
|
||||
sleep_until_file_exists $MASTER_MYPID $wait_for_master
|
||||
wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
|
||||
MASTER_RUNNING=1
|
||||
}
|
||||
|
||||
@ -847,7 +853,8 @@ start_slave()
|
||||
manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
|
||||
fi
|
||||
eval "SLAVE$1_RUNNING=1"
|
||||
sleep_until_file_exists $slave_pid
|
||||
sleep_until_file_exists $slave_pid $wait_for_slave
|
||||
wait_for_slave=$SLEEP_TIME_FOR_SECOND_SLAVE
|
||||
}
|
||||
|
||||
mysql_start ()
|
||||
@ -1143,6 +1150,8 @@ then
|
||||
# Remove files that can cause problems
|
||||
$RM -f $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
|
||||
|
||||
wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER
|
||||
wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE
|
||||
$ECHO "Installing Test Databases"
|
||||
mysql_install_db
|
||||
start_manager
|
||||
|
@ -216,3 +216,50 @@ select 1+1,"a",count(*) from t1 where foo in (2);
|
||||
1+1 a count(*)
|
||||
2 a 0
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
spID int(10) unsigned,
|
||||
userID int(10) unsigned,
|
||||
score smallint(5) unsigned,
|
||||
key (spid),
|
||||
key (score)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3);
|
||||
explain select userid,count(*) from t1 group by userid desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 6 Using temporary
|
||||
select userid,count(*) from t1 group by userid desc;
|
||||
userid count(*)
|
||||
3 3
|
||||
2 1
|
||||
1 2
|
||||
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 range spID spID 5 NULL 2 where used; Using index
|
||||
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 range spID spID 5 NULL 2 where used; Using index
|
||||
select spid,count(*) from t1 where spid between 1 and 2 group by spid;
|
||||
spid count(*)
|
||||
1 1
|
||||
2 2
|
||||
select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
|
||||
spid count(*)
|
||||
explain select sql_big_result spid,sum(userid) from t1 group by spid desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 6 Using filesort
|
||||
select sql_big_result spid,sum(userid) from t1 group by spid desc;
|
||||
spid sum(userid)
|
||||
5 3
|
||||
4 3
|
||||
3 3
|
||||
2 3
|
||||
1 1
|
||||
explain select sql_big_result score,count(*) from t1 group by score desc;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL score 3 NULL 6 Using index
|
||||
select sql_big_result score,count(*) from t1 group by score desc;
|
||||
score count(*)
|
||||
3 3
|
||||
2 1
|
||||
1 2
|
||||
drop table t1;
|
||||
|
15
mysql-test/r/innodb_cache.result
Normal file
15
mysql-test/r/innodb_cache.result
Normal file
@ -0,0 +1,15 @@
|
||||
drop table if exists t1;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) type=innodb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
@ -1,3 +1,5 @@
|
||||
flush query cache;
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
drop table if exists t1,t2,t3;
|
||||
@ -148,20 +150,6 @@ show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1, t2, t3;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) type=innodb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (1),(2),(3);
|
||||
create table t2 (a int not null);
|
||||
|
@ -74,6 +74,14 @@ a b
|
||||
2 b
|
||||
3 c
|
||||
4 d
|
||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
|
||||
a b
|
||||
1 a
|
||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
|
||||
a b
|
||||
3 c
|
||||
2 b
|
||||
1 a
|
||||
explain select a,b from t1 union all select a,b from t2;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
|
@ -35,6 +35,7 @@ select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
|
||||
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
|
||||
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
|
||||
select soundex(''),soundex('he'),soundex('hello all folks');
|
||||
--replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l.
|
||||
select password('test'),length(encrypt('test')),encrypt('test','aa');
|
||||
select md5('hello');
|
||||
select repeat('monty',5),concat('*',space(5),'*');
|
||||
|
1
mysql-test/t/innodb_cache-master.opt
Normal file
1
mysql-test/t/innodb_cache-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--set-variable=query_cache_size=1M
|
14
mysql-test/t/innodb_cache.test
Normal file
14
mysql-test/t/innodb_cache.test
Normal file
@ -0,0 +1,14 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# Without auto_commit.
|
||||
#
|
||||
drop table if exists t1;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) type=innodb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
@ -1,11 +1,11 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# Tests with query cache
|
||||
#
|
||||
|
||||
# Reset query cache variables.
|
||||
|
||||
flush query cache; # This crashed in some versions
|
||||
flush query cache; # This crashed in some versions
|
||||
reset query cache;
|
||||
flush status;
|
||||
drop table if exists t1,t2,t3;
|
||||
@ -73,17 +73,6 @@ delete from t3 where a=10;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1, t2, t3;
|
||||
#
|
||||
# Without auto_commit.
|
||||
#
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) type=innodb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
||||
#
|
||||
# FLUSH QUERY CACHE
|
||||
#
|
||||
create table t1 (a int not null);
|
||||
|
@ -18,6 +18,8 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
|
||||
|
||||
#test alternate syntax for unions
|
||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 4;
|
||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
|
||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
|
||||
|
||||
# Test some error conditions with UNION
|
||||
explain select a,b from t1 union all select a,b from t2;
|
||||
|
Reference in New Issue
Block a user