diff options
author | unknown <monty@mysql.com> | 2004-06-25 20:13:05 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-06-25 20:13:05 +0300 |
commit | c6e23c85493688417c0274b4630a6b7c44f59d10 (patch) | |
tree | 983268d5f30394d4fa4ffdd75cd095f6227e5170 /mysql-test/t | |
parent | 4e664e3e43b1b0e2a37eadb8a6e28142db444352 (diff) | |
parent | 07589a6da51e7fb0b741cfca025202341bfa64e6 (diff) | |
download | mariadb-git-c6e23c85493688417c0274b4630a6b7c44f59d10.tar.gz |
Merge with 4.0 to get the latest bug patches to 4.1
BitKeeper/etc/ignore:
added sql/mysql_tzinfo_to_sql
BitKeeper/etc/logging_ok:
auto-union
acinclude.m4:
Auto merged
extra/perror.c:
Auto merged
include/mysql.h:
Auto merged
innobase/include/mach0data.ic:
Auto merged
innobase/include/mtr0log.h:
Auto merged
innobase/include/mtr0log.ic:
Auto merged
innobase/mem/mem0dbg.c:
Auto merged
innobase/pars/lexyy.c:
Auto merged
BitKeeper/deleted/.del-4.0.XX-gpl.ipr~f5909a9e9bd8094:
Auto merged
BitKeeper/deleted/.del-Clients and Tools.fgl~bf0f776883577f02:
Auto merged
BitKeeper/deleted/.del-Development.fgl~6392ce285e73f5fc:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/innodb_cache.result:
Auto merged
mysql-test/r/lowercase_table2.result:
Auto merged
mysql-test/t/innodb_cache.test:
Auto merged
mysql-test/t/lowercase_table2.test:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/handler.cc:
Auto merged
scripts/make_win_src_distribution.sh:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
libmysql/libmysql.c:
Merge with 4.0
mysql-test/r/bdb.result:
Merge with 4.0
mysql-test/r/range.result:
Merge with 4.0
mysql-test/t/bdb.test:
Merge with 4.0
mysys/hash.c:
Merge with 4.0
scripts/mysql_install_db.sh:
Merge with 4.0
sql/field.cc:
Merge with 4.0
sql/field.h:
Merge with 4.0
sql/mysql_priv.h:
Merge with 4.0
sql/sql_handler.cc:
Merge with 4.0
sql/sql_select.cc:
Merge with 4.0
sql/sql_table.cc:
Merge with 4.0
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/bdb.test | 36 | ||||
-rw-r--r-- | mysql-test/t/flush_table.test | 115 | ||||
-rw-r--r-- | mysql-test/t/innodb_cache.test | 23 | ||||
-rw-r--r-- | mysql-test/t/lowercase_table2.test | 11 |
4 files changed, 177 insertions, 8 deletions
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 42729034d41..32ea0662534 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -824,6 +824,42 @@ select a from t1; drop table t1; # +# bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash +# + +create table t1( + pk1 text not null, pk2 text not null, pk3 char(4), + key1 int, key2 int, + primary key(pk1(4), pk2(4), pk3), key(key1), key(key2) +) engine=bdb; +insert into t1 values (concat('aaa-', repeat('A', 4000)), + concat('eee-', repeat('e', 4000)), 'a++a', 1, 1); +insert into t1 values (concat('bbb-', repeat('B', 4000)), + concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1); +select substring(pk1, 1, 4), substring(pk1, 4001), + substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2 + from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + +# +# bug#2688 - Wrong index_merge query results for BDB table with variable length primary key +# + +create table t1 ( + pk1 varchar(8) not null default '', + pk2 varchar(4) not null default '', + key1 int(11) default null, + key2 int(11) default null, + primary key (pk1,pk2), + key key1 (key1), + key key2 (key2)) engine=bdb; +insert into t1 values ('','empt',2,2), ('a','a--a',2,2), + ('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2); +select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + + +# # Bug #4000: problem with active cursor. # diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index 4ddcd53d5c8..ad81f266afc 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -4,10 +4,111 @@ # Test of flush table # -#drop table if exists t1; -#create table t1 (a int not null auto_increment primary key); -#insert into t1 values(0); -#lock table t1 read; -#flush table t1; -#check table t1; -#drop table t1; +drop table if exists t1; +create table t1 (a int not null auto_increment primary key); +insert into t1 values(0); +lock table t1 read; +flush table t1; +check table t1; +drop table t1; + +# +# Check if two database names beginning the same are seen as different. +# +# This database begins like the usual 'test' database. +# +--disable_warnings +drop database if exists test_test; +--enable_warnings +create database test_test; +use test_test; +create table t1(table_id char(20) primary key); +insert into t1 values ('test_test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +create table t2(table_id char(20) primary key); +insert into t2 values ('test_test.t2'); +insert into t2 values (''); +handler t2 open; +handler t2 read first limit 9; +# +# This is the usual 'test' database. +# +use test; +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +# +# Check accesibility of all the tables. +# +use test; +handler test.t1 read first limit 9; +--error 1109; +handler test.t2 read first limit 9; +handler test_test.t1 read first limit 9; +handler test_test.t2 read first limit 9; +# +# Cleanup. +# +handler test_test.t1 close; +drop table test_test.t1; +handler test_test.t2 close; +drop table test_test.t2; +drop database test_test; +# +use test; +handler test.t1 close; +drop table test.t1; + +# +# In the following test FLUSH TABLES produces a deadlock +# (hang forever) if the fix for bug#3565 is missing. +# +--disable_warnings +drop table if exists t1; +drop table if exists t2; +--enable_warnings +create table t1(table_id char(20) primary key); +create table t2(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +insert into t2 values ('test.t2'); +insert into t2 values (''); +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush tables; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +--error 1109; +handler t2 read first limit 9; +# +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t1; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t2; +--error 1109; +handler t2 close; +drop table t1; +drop table t2; + diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test index 8568fce7d97..a81aca9b494 100644 --- a/mysql-test/t/innodb_cache.test +++ b/mysql-test/t/innodb_cache.test @@ -52,10 +52,31 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; commit; show status like "Qcache_queries_in_cache"; +drop table t3,t2,t1; -drop table if exists t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; select count(*) from t1; insert into t1 (id) values (0); select count(*) from t1; drop table t1; + +# +# one statement roll back inside transation +# +set GLOBAL query_cache_size=1355776; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb; +INSERT INTO t1 VALUES (1,'me'); +INSERT INTO t2 VALUES (1,'you'); +INSERT INTO t3 VALUES (2,1,1,2); +delete from t3 where t1_id = 1 and t2_id = 1; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +begin; +insert into t3 VALUES ( NULL, 1, 1, 2 ); +-- error 1062 +insert into t3 VALUES ( NULL, 1, 1, 2 ); +commit; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +drop table t3,t2,t1; + diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index 5c479391916..a4eaeac4ef4 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -89,3 +89,14 @@ SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHER SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; drop table T1; + +# +# Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109) +# + +create table T1 (A int); +alter table T1 add index (A); +show tables like 'T1%'; +alter table t1 add index (A); +show tables like 't1%'; +drop table t1; |