1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix and test-case for the bug #775: SELECT misses rows in indexed HEAP table columns.

This commit is contained in:
ram@mysql.r18.ru
2003-07-03 18:21:59 +05:00
parent 3308f226ee
commit 726fca05f7
3 changed files with 29 additions and 3 deletions

View File

@ -197,6 +197,20 @@ a b
INSERT INTO t1 VALUES (1,3);
Duplicate entry '3' for key 1
DROP TABLE t1;
CREATE TABLE t1 (
a int default NULL,
key a (a)
) TYPE=HEAP;
INSERT INTO t1 VALUES (10), (10), (10);
EXPLAIN SELECT * FROM t1 WHERE a=10;
table type possible_keys key key_len ref rows Extra
t1 ref a a 5 const 10 Using where
SELECT * FROM t1 WHERE a=10;
a
10
10
10
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;

View File

@ -129,6 +129,15 @@ SELECT * FROM t1 WHERE b<=>NULL;
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
CREATE TABLE t1 (
a int default NULL,
key a (a)
) TYPE=HEAP;
INSERT INTO t1 VALUES (10), (10), (10);
EXPLAIN SELECT * FROM t1 WHERE a=10;
SELECT * FROM t1 WHERE a=10;
DROP TABLE t1;
#
# Test when deleting all rows
#