summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-01-29 15:17:25 +0100
committermonty@mysql.com <>2004-01-29 15:17:25 +0100
commit71c6d0c4f9e3047d70c60b3bc2f13efbd9fe3b7e (patch)
tree29eb80711b98066b94648b8f4b4aee7b7f37c1d0 /mysql-test
parent8c49856f2463945aa70019fabd4d70ad0aa98d83 (diff)
parent151b558e216ab4c9b53d54cae7505e72597655f6 (diff)
downloadmariadb-git-71c6d0c4f9e3047d70c60b3bc2f13efbd9fe3b7e.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/bdb.result25
-rw-r--r--mysql-test/r/myisam.result30
-rw-r--r--mysql-test/t/bdb.test14
-rw-r--r--mysql-test/t/myisam.test18
4 files changed, 85 insertions, 2 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index 05845df9dd3..2ccb5148d58 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -1165,3 +1165,28 @@ create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, pri
insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
drop table t1,t2;
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 2
+select a from t1;
+a
+a
+A
+explain select b from t1;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL b 4 NULL 2 Using index
+select b from t1;
+b
+1
+2
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL a 11 NULL 2 Using index
+select a from t1;
+a
+A
+a
+drop table t1;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 68a667f6d95..cc541388a5c 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -386,7 +386,10 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 ( a text not null, key a (a(20)));
-insert into t1 values ('aaa '),('aaa');
+insert into t1 values ('aaa '),('aaa'),('aa');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
@@ -394,6 +397,15 @@ select concat(a,'.') from t1 where a='aaa';
concat(a,'.')
aaa.
aaa .
+select concat(a,'.') from t1 where binary a='aaa';
+concat(a,'.')
+aaa.
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
+concat(a,'.')
+bbb.
+bbb.
+aa.
drop table t1;
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
@@ -403,3 +415,19 @@ select * from t1 where a='807780' and b='477' and c='165';
a b c
807780 477 165
drop table t1;
+create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
+insert into t1 (b) values ('a'),('a '),('a ');
+select concat(b,'.') from t1;
+concat(b,'.')
+a.
+a .
+a .
+update t1 set b='b ' where a=2;
+update t1 set b='b ' where a > 1;
+Duplicate entry 'b ' for key 2
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+a concat(b,'.')
+1 a.
+3 a .
+drop table t1;
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 2dfaecba9b1..4b490052535 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -815,3 +815,17 @@ insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
drop table t1,t2;
+
+#
+# Test index only read (Bug #2509)
+#
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+select a from t1;
+explain select b from t1;
+select b from t1;
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+select a from t1;
+drop table t1;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 394261aae40..7302e5dfdda 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -390,9 +390,13 @@ drop table t1;
# two bugs in myisam-space-stripping feature
#
create table t1 ( a text not null, key a (a(20)));
-insert into t1 values ('aaa '),('aaa');
+insert into t1 values ('aaa '),('aaa'),('aa');
+check table t1;
repair table t1;
select concat(a,'.') from t1 where a='aaa';
+select concat(a,'.') from t1 where binary a='aaa';
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
drop table t1;
#
@@ -406,3 +410,15 @@ insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
drop table t1;
+#
+# Test text and unique
+#
+create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
+insert into t1 (b) values ('a'),('a '),('a ');
+select concat(b,'.') from t1;
+update t1 set b='b ' where a=2;
+--error 1062
+update t1 set b='b ' where a > 1;
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+drop table t1;