diff options
author | unknown <mhansson/martin@linux-st28.site> | 2007-08-15 09:23:44 +0200 |
---|---|---|
committer | unknown <mhansson/martin@linux-st28.site> | 2007-08-15 09:23:44 +0200 |
commit | 546c7fcfa107372d0c4d9a305783ef3ddb91e42e (patch) | |
tree | 2d9eb6b63a9f0e51771e9422008f51c07409e227 /sql/handler.cc | |
parent | d0f21f84feba4d745fda76ac99179bb47bb471b1 (diff) | |
download | mariadb-git-546c7fcfa107372d0c4d9a305783ef3ddb91e42e.tar.gz |
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.
mysql-test/r/innodb_mysql.result:
bug#28570: Test Result
mysql-test/t/innodb_mysql.test:
bug#28570: Test Case
sql/handler.cc:
bug#28570: Updated comment
sql/opt_range.cc:
bug#28570: Removed the criterion that key has to be unique (HA_NOSAME) in
order for the EQ_RANGE flag to be set. It is sufficient that the range
represent a ref access.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 8ef14ce8906..bfb7e8c369f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2610,7 +2610,8 @@ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p) read_range_first() start_key Start key. Is 0 if no min range end_key End key. Is 0 if no max range - eq_range_arg Set to 1 if start_key == end_key + eq_range_arg Set to 1 if start_key == end_key and the range endpoints + will not change during query execution. sorted Set to 1 if result should be sorted per key NOTES |