summaryrefslogtreecommitdiff
path: root/mysql-test/r/heap.result
diff options
context:
space:
mode:
authorunknown <svoj@april.(none)>2006-05-10 21:50:04 +0500
committerunknown <svoj@april.(none)>2006-05-10 21:50:04 +0500
commit2eeab0b0d8e561fec1451e7f763de4526236962b (patch)
tree3362204079a840355be45f5ceb63e91042aff484 /mysql-test/r/heap.result
parent8052fafd313d498362c1cb02d1efff889efea030 (diff)
downloadmariadb-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/r/heap.result')
-rw-r--r--mysql-test/r/heap.result13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index d72f5771f15..906c431b834 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -718,3 +718,16 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
drop table t1, t2;
+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';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 WHERE b='aa';
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
+COUNT(*)
+2
+DROP TABLE t1;