summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <mhansson/martin@linux-st28.site>2007-08-15 09:23:44 +0200
committerunknown <mhansson/martin@linux-st28.site>2007-08-15 09:23:44 +0200
commit546c7fcfa107372d0c4d9a305783ef3ddb91e42e (patch)
tree2d9eb6b63a9f0e51771e9422008f51c07409e227 /sql/handler.cc
parentd0f21f84feba4d745fda76ac99179bb47bb471b1 (diff)
downloadmariadb-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.cc3
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