diff options
author | unknown <svoj@april.(none)> | 2006-05-10 21:50:04 +0500 |
---|---|---|
committer | unknown <svoj@april.(none)> | 2006-05-10 21:50:04 +0500 |
commit | 2eeab0b0d8e561fec1451e7f763de4526236962b (patch) | |
tree | 3362204079a840355be45f5ceb63e91042aff484 /mysql-test/t/heap.test | |
parent | 8052fafd313d498362c1cb02d1efff889efea030 (diff) | |
download | mariadb-git-2eeab0b0d8e561fec1451e7f763de4526236962b.tar.gz |
BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on
SELECT WHERE a= AND b=
Selecting data from memory table with varchar column and hash index over it
returns only first row matched.
Problem was that key length calculation for varchar columns didn't include
number of bytes to store length.
Fixed key length for varchar fields to include number of bytes to store length.
heap/hp_create.c:
Fixed key length for varchar fields to include number of bytes to store length.
mysql-test/r/heap.result:
Testcase for BUG#18233.
mysql-test/t/heap.test:
Testcase for BUG#18233.
Diffstat (limited to 'mysql-test/t/heap.test')
-rw-r--r-- | mysql-test/t/heap.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 82294db336d..e501fce1eeb 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -458,4 +458,16 @@ create table t2 (c varchar(10)) engine=memory; show table status like 't_'; drop table t1, t2; +# +# BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on +# SELECT WHERE a= AND b= +# +CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256), + KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY; +INSERT INTO t1 VALUES('a','aa',REPEAT('a', 256)),('a','aa',REPEAT('a',256)); +SELECT COUNT(*) FROM t1 WHERE a='a'; +SELECT COUNT(*) FROM t1 WHERE b='aa'; +SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); +DROP TABLE t1; + # End of 5.0 tests |