mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge olga.mysql.com:/home/igor/mysql-5.1-bugteam
into olga.mysql.com:/home/igor/dev-opt/mysql-5.1-bug35844 sql/sql_select.cc: Auto merged
This commit is contained in:
@ -1309,3 +1309,35 @@ WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
|
||||
ORDER BY t2.c LIMIT 1;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
|
||||
#
|
||||
# Bug#35844: Covering index for ref access not compatible with ORDER BY list
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id1 INT NULL,
|
||||
id2 INT NOT NULL,
|
||||
junk INT NOT NULL,
|
||||
PRIMARY KEY (id1, id2, junk),
|
||||
INDEX id2_j_id1 (id2, junk, id1)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1, 1), (2, 1, 2), (3, 1, 3), (4, 1, 4);
|
||||
INSERT INTO t1 VALUES (5, 2, 1), (6, 2, 2), (7, 2, 3), (8, 2, 4);
|
||||
INSERT INTO t1 VALUES (9, 3, 1), (10, 3, 2), (11, 3, 3), (12, 3, 4);
|
||||
INSERT INTO t1 VALUES (13, 4, 1), (14, 4, 2), (15, 4, 3), (16, 4, 4);
|
||||
INSERT INTO t1 VALUES (17, 5, 1), (18, 5, 2), (19, 5, 3), (20, 5, 4);
|
||||
INSERT INTO t1 VALUES (21, 6, 1), (22, 6, 2), (23, 6, 3), (24, 6, 4);
|
||||
INSERT INTO t1 VALUES (25, 7, 1), (26, 7, 2), (27, 7, 3), (28, 7, 4);
|
||||
INSERT INTO t1 VALUES (29, 8, 1), (30, 8, 2), (31, 8, 3), (32, 8, 4);
|
||||
INSERT INTO t1 VALUES (33, 9, 1), (34, 9, 2), (35, 9, 3), (36, 9, 4);
|
||||
|
||||
EXPLAIN SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
|
||||
|
||||
SELECT id1 FROM t1 WHERE id2 = 4 ORDER BY id1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user