summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/bdb.test15
-rw-r--r--mysql-test/t/key.test16
-rw-r--r--mysql-test/t/merge.test12
-rw-r--r--mysql-test/t/replace.test14
4 files changed, 56 insertions, 1 deletions
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 8b9c1511840..3fa35be5027 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -728,3 +728,18 @@ where
t3.platform_id = 2;
drop table t1, t2, t3, t4, t5, t6,t7;
+
+#
+# Test with blob + tinyint key
+#
+
+CREATE TABLE t1 (
+ a tinytext NOT NULL,
+ b tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (a(32),b)
+) TYPE=BDB;
+INSERT INTO t1 VALUES ('a',1),('a',2);
+SELECT * FROM t1 WHERE a='a' AND b=2;
+SELECT * FROM t1 WHERE a='a' AND b in (2);
+SELECT * FROM t1 WHERE a='a' AND b in (1,2);
+drop table t1;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 4be459b0bb7..a8417fad876 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -144,3 +144,19 @@ INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
drop table t1;
+
+#
+# Test with blob + tinyint key
+# (Failed for Greg Valure)
+#
+
+CREATE TABLE t1 (
+ a tinytext NOT NULL,
+ b tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (a(32),b)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES ('a',1),('a',2);
+SELECT * FROM t1 WHERE a='a' AND b=2;
+SELECT * FROM t1 WHERE a='a' AND b in (2);
+SELECT * FROM t1 WHERE a='a' AND b in (1,2);
+drop table t1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index fb1da4e3739..0b14ba388ce 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -50,7 +50,7 @@ insert into t2 (c) values ('test2');
insert into t2 (c) values ('test2');
select * from t3;
select * from t3;
-delete from t3;
+delete from t3 where 1=1;
select * from t3;
select * from t1;
drop table t3,t2,t1;
@@ -78,6 +78,16 @@ alter table t3 UNION=(t1,t2);
select count(*) from t3;
alter table t3 TYPE=MYISAM;
select count(*) from t3;
+
+# Test that ALTER TABLE rembers the old UNION
+
+drop table t3;
+CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr))
+TYPE=MERGE UNION=(t1,t2);
+show create table t3;
+alter table t3 drop primary key;
+show create table t3;
+
drop table t3,t2,t1;
#
diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test
index 100941108c8..e9e01615a62 100644
--- a/mysql-test/t/replace.test
+++ b/mysql-test/t/replace.test
@@ -20,3 +20,17 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=heap;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
drop table t1;
+
+#
+# Test when using replace on a key that has used up it's whole range
+#
+
+create table t1 (a tinyint not null auto_increment primary key, b char(20));
+insert into t1 values (126,"first"),(0,"last");
+--error 1062
+insert into t1 values (0,"error");
+--error 1062
+replace into t1 values (0,"error");
+replace into t1 values (126,"first updated");
+select * from t1;
+drop table t1;