summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-07-12 16:48:21 +0530
committerAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-07-12 16:48:21 +0530
commite231e7f8eb85ebe8b0170060d3bcf66e44fa8ed8 (patch)
tree65615dabb55932602d588ebf37c46ca100194391 /sql/handler.cc
parente7dd7ac58b5565167138060b1e397cbe9870cb2a (diff)
parente612f55237d79ae67f613391657447e6059321d3 (diff)
downloadmariadb-git-e231e7f8eb85ebe8b0170060d3bcf66e44fa8ed8.tar.gz
Merging from mysql-5.1 to mysql-5.5.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 310e23574dc..27309a4b1d7 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4655,7 +4655,19 @@ int handler::read_range_first(const key_range *start_key,
? HA_ERR_END_OF_FILE
: result);
- DBUG_RETURN (compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);
+ if (compare_key(end_range) <= 0)
+ {
+ DBUG_RETURN(0);
+ }
+ else
+ {
+ /*
+ The last read row does not fall in the range. So request
+ storage engine to release row lock if possible.
+ */
+ unlock_row();
+ DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
}
@@ -4687,7 +4699,20 @@ int handler::read_range_next()
result= index_next(table->record[0]);
if (result)
DBUG_RETURN(result);
- DBUG_RETURN(compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);
+
+ if (compare_key(end_range) <= 0)
+ {
+ DBUG_RETURN(0);
+ }
+ else
+ {
+ /*
+ The last read row does not fall in the range. So request
+ storage engine to release row lock if possible.
+ */
+ unlock_row();
+ DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
}