1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Limit created keys to MAX_KEY_LENGTH.

Fix problem with query cache and database names
This commit is contained in:
monty@hundin.mysql.fi
2001-12-23 02:43:46 +02:00
parent 95a3bfac1d
commit d2cae57402
7 changed files with 101 additions and 41 deletions

View File

@ -347,7 +347,7 @@ fi
[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
[ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
[ -z "$COLUMNS" ] && COLUMNS=80
if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi
E=`$EXPR $COLUMNS - 8`
DASH72=`$ECHO '------------------------------------------------------------------------'|$CUT -c 1-$E`
@ -547,10 +547,10 @@ mysql_install_db () {
for slave_num in 1 2 ;
do
$RM -rf var/slave$slave_num-data/
mkdir -p var/slave$slave_num-data/mysql
mkdir -p var/slave$slave_num-data/test
cp var/slave-data/mysql/* var/slave$slave_num-data/mysql
$RM -rf var/slave$slave_num-data/
mkdir -p var/slave$slave_num-data/mysql
mkdir -p var/slave$slave_num-data/test
cp var/slave-data/mysql/* var/slave$slave_num-data/mysql
done
return 0
}
@ -604,7 +604,8 @@ abort_if_failed()
start_manager()
{
if [ $USE_MANAGER = 0 ] ; then
echo "Manager disabled, skipping manager start."
echo "Manager disabled, skipping manager start."
$RM -f $MYSQL_MANAGER_LOG
return
fi
$ECHO "Starting MySQL Manager"
@ -675,7 +676,7 @@ manager_term()
shift
if [ $USE_MANAGER = 0 ] ; then
$MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock -O \
connect_timeout=5 -O shutdown_timeout=20 shutdown >/dev/null 2>&1
connect_timeout=5 -O shutdown_timeout=20 shutdown >> $MYSQL_MANAGER_LOG 2>&1
return
fi
$MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \

View File

@ -2,7 +2,7 @@ flush query cache;
flush query cache;
reset query cache;
flush status;
drop table if exists t1,t2,t3,t11,t21;
drop table if exists t1,t2,t3,t11,t21, mysqltest.t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
@ -346,7 +346,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
drop table t1,t2;
create database mysqltest;
create database if not exists mysqltest;
create table mysqltest.t1 (i int not null auto_increment, a int, primary key (i));
insert into mysqltest.t1 (a) values (1);
select * from mysqltest.t1 where i is null;
@ -375,6 +375,36 @@ set CHARACTER SET DEFAULT;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
drop table t1;
create database if not exists mysqltest;
create table mysqltest.t1 (i int not null);
create table t1 (i int not null);
insert into mysqltest.t1 (i) values (1);
insert into t1 (i) values (2);
select * from t1;
i
2
use mysqltest;
select * from t1;
i
1
select * from t1;
i
1
use test;
select * from t1;
i
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 6
drop database mysqltest;
drop table t1;
flush query cache;
reset query cache;

View File

@ -8,7 +8,7 @@ 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,t11,t21;
drop table if exists t1,t2,t3,t11,t21, mysqltest.t1;
#
# First simple test
@ -235,7 +235,7 @@ drop table t1,t2;
#
# noncachable ODBC work around (and prepare cache for drop database)
#
create database mysqltest;
create database if not exists mysqltest;
create table mysqltest.t1 (i int not null auto_increment, a int, primary key (i));
insert into mysqltest.t1 (a) values (1);
select * from mysqltest.t1 where i is null;
@ -258,6 +258,7 @@ set CHARACTER SET cp1251_koi8;
select * from t1;
set CHARACTER SET DEFAULT;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop table t1;
# The following tests can't be done as the values differen on 32 and 64 bit
@ -265,6 +266,27 @@ drop table t1;
#show variables like "query_cache_size";
#show status like "Qcache_free_memory";
#
# same tables in different db
#
create database if not exists mysqltest;
create table mysqltest.t1 (i int not null);
create table t1 (i int not null);
insert into mysqltest.t1 (i) values (1);
insert into t1 (i) values (2);
select * from t1;
use mysqltest;
select * from t1;
select * from t1;
use test;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop database mysqltest;
drop table t1;
#
# Test insert delayed
#