summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-01-22 20:35:36 +0400
committerunknown <ram@gw.mysql.r18.ru>2004-01-22 20:35:36 +0400
commit4db4ffef27624e58cc5c45cc8a165bfb9509fbfa (patch)
tree03586acb0a42d608f68d46872499d11a385de025 /mysql-test
parent79f6e16d5e8b5edeb76d97b5d9886306e000ae87 (diff)
parentf9cf5bb2631590ab2df55b304628d92bc534b447 (diff)
downloadmariadb-git-4db4ffef27624e58cc5c45cc8a165bfb9509fbfa.tar.gz
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b2298 myisam/mi_search.c: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_str.result7
-rw-r--r--mysql-test/r/myisam-blob.result27
-rw-r--r--mysql-test/r/myisam.result18
-rw-r--r--mysql-test/r/range.result8
-rw-r--r--mysql-test/t/func_str.test9
-rw-r--r--mysql-test/t/myisam-blob-master.opt1
-rw-r--r--mysql-test/t/myisam-blob.test30
-rw-r--r--mysql-test/t/myisam.test21
-rw-r--r--mysql-test/t/range.test11
9 files changed, 113 insertions, 19 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 35a5ba70e86..7d2668c8cf6 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -266,3 +266,10 @@ CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
NULL
</a>..........................
DROP TABLE t1;
+CREATE TABLE t1 (i int, j int);
+INSERT INTO t1 VALUES (1,1),(2,2);
+SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
+i ELT(j, '345', '34')
+1 345
+2 34
+DROP TABLE t1;
diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result
new file mode 100644
index 00000000000..743d4dac254
--- /dev/null
+++ b/mysql-test/r/myisam-blob.result
@@ -0,0 +1,27 @@
+drop table if exists t1;
+CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+length(data)
+18874368
+delete from t1 where left(data,1)='a';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+truncate table t1;
+INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
+INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
+delete from t1 where left(data,1)='b';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+UPDATE t1 set data=repeat('c',17*1024*1024);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+delete from t1 where left(data,1)='c';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index e113a48f4da..68a667f6d95 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -385,3 +385,21 @@ check table t1;
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');
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+select concat(a,'.') from t1 where a='aaa';
+concat(a,'.')
+aaa.
+aaa .
+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');
+insert into t1 values('807780', '477', '162');
+insert into t1 values('807780', '472', '162');
+select * from t1 where a='807780' and b='477' and c='165';
+a b c
+807780 477 165
+drop table t1;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 45d20a8fced..e87df9a6c24 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -300,11 +300,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*)
6
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');
-insert into t1 values('807780', '477', '162');
-insert into t1 values('807780', '472', '162');
-select * from t1 where a='807780' and b='477' and c='165';
-a b c
-807780 477 165
-drop table t1;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 33d89b3ca37..1eba49a9583 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill');
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
DROP TABLE t1;
+
+#
+# test for Bug #2290 "output truncated with ELT when using DISTINCT"
+#
+
+CREATE TABLE t1 (i int, j int);
+INSERT INTO t1 VALUES (1,1),(2,2);
+SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/myisam-blob-master.opt b/mysql-test/t/myisam-blob-master.opt
new file mode 100644
index 00000000000..1a1076c7bad
--- /dev/null
+++ b/mysql-test/t/myisam-blob-master.opt
@@ -0,0 +1 @@
+--max-allowed-packet=24M --skip-innodb --key-buffer-size=1M
diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test
new file mode 100644
index 00000000000..d58222ec8bf
--- /dev/null
+++ b/mysql-test/t/myisam-blob.test
@@ -0,0 +1,30 @@
+#
+# Test bugs in the MyISAM code with blobs
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# Bug #2159 (Problem with update of blob to > 16M)
+
+CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+delete from t1 where left(data,1)='a';
+check table t1;
+truncate table t1;
+INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
+INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
+delete from t1 where left(data,1)='b';
+check table t1;
+
+# now we have two blocks in the table, first is a 1M record and second is
+# a 16M delete block.
+
+UPDATE t1 set data=repeat('c',17*1024*1024);
+check table t1;
+delete from t1 where left(data,1)='c';
+check table t1;
+drop table t1;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 12853cd67ca..394261aae40 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -385,3 +385,24 @@ insert into t1 (b) values (repeat('z',100));
update t1 set b="test" where left(b,1) > 'n';
check table t1;
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');
+repair table t1;
+select concat(a,'.') from t1 where a='aaa';
+drop table t1;
+
+#
+# Third bug in the same code (BUG#2295)
+#
+
+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');
+insert into t1 values('807780', '477', '162');
+insert into t1 values('807780', '472', '162');
+select * from t1 where a='807780' and b='477' and c='165';
+drop table t1;
+
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 9d9feaa4edc..b04e614a740 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -249,14 +249,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
DROP TABLE t1;
-#
-# BUG#2295 - range on blob
-#
-
-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');
-insert into t1 values('807780', '477', '162');
-insert into t1 values('807780', '472', '162');
-select * from t1 where a='807780' and b='477' and c='165';
-drop table t1;
-