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

bug#28570: handler::index_read() is called with different find_flag when

ORDER BY is used

The range analysis module did not correctly signal to the 
handler that a range represents a ref (EQ_RANGE flag). This causes 
non-range queries like 
SELECT ... FROM ... WHERE keypart_1=const, ..., keypart_n=const 
ORDER BY ... FOR UPDATE
to wait for a lock unneccesarily if another running transaction uses
SELECT ... FOR UPDATE on the same table.

Fixed by setting EQ_RANGE for all range accesses that represent 
an equality predicate.
This commit is contained in:
mhansson/martin@linux-st28.site
2007-08-15 09:23:44 +02:00
parent 117c3ff9d7
commit 1da8451d4d
4 changed files with 50 additions and 3 deletions

View File

@ -840,5 +840,34 @@ DISCONNECT con2;
DROP PROCEDURE p1;
DROP TABLE t1;
#
# Bug #28570: handler::index_read() is called with different find_flag when
# ORDER BY is used
#
CREATE TABLE t1 (
a INT,
b INT,
KEY (b)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
START TRANSACTION;
SELECT * FROM t1 WHERE b=20 FOR UPDATE;
--connect (conn2, localhost, root,,test)
# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
# restarting transaction" message when the bug is present.
START TRANSACTION;
SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
ROLLBACK;
--disconnect conn2
--connection default
ROLLBACK;
DROP TABLE t1;
--echo End of 5.0 tests