summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-10-09 01:07:15 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-10-09 01:07:15 +0500
commitb9805a5a45ce96ca0689fd2534e6c31247805d48 (patch)
tree5ad0ee0cd74d19b1e59b35977787c03bd79ca0cb /sql/handler.cc
parentdb39be9510bed5d8cf7ffccd000b4f670fe9f7ea (diff)
downloadmariadb-git-b9805a5a45ce96ca0689fd2534e6c31247805d48.tar.gz
Fixed bug #31310.
Locked rows of the InnoDB storage was silently skipped in the read-committed isolation level. QUICK_RANGE_SELECT for unique ranges lacks second (blocking) read of the record that was read semi-consistently and just skip it. The handler::read_multi_range_next method has been modified to retry previous unique range if the previous read was semi-consistent. sql/handler.cc: Fixed bug #31310. The handler::read_multi_range_next method has been modified to retry previous unique range if the previous read was semi-consistent. mysql-test/include/mix1.inc: Added test case for bug #31310. mysql-test/r/innodb_mysql.result: Added test case for bug #31310.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 75c3a64bc27..3939873ec7d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3145,6 +3145,8 @@ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
}
else
{
+ if (was_semi_consistent_read())
+ goto scan_it_again;
/*
We need to set this for the last range only, but checking this
condition is more expensive than just setting the result code.
@@ -3152,10 +3154,10 @@ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
result= HA_ERR_END_OF_FILE;
}
+ multi_range_curr++;
+scan_it_again:
/* Try the next range(s) until one matches a record. */
- for (multi_range_curr++;
- multi_range_curr < multi_range_end;
- multi_range_curr++)
+ for (; multi_range_curr < multi_range_end; multi_range_curr++)
{
result= read_range_first(multi_range_curr->start_key.keypart_map ?
&multi_range_curr->start_key : 0,