mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
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.
This commit is contained in:
parent
8052fafd31
commit
2eeab0b0d8
3 changed files with 27 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue