diff options
author | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2012-07-12 16:48:21 +0530 |
---|---|---|
committer | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2012-07-12 16:48:21 +0530 |
commit | e231e7f8eb85ebe8b0170060d3bcf66e44fa8ed8 (patch) | |
tree | 65615dabb55932602d588ebf37c46ca100194391 /sql/handler.cc | |
parent | e7dd7ac58b5565167138060b1e397cbe9870cb2a (diff) | |
parent | e612f55237d79ae67f613391657447e6059321d3 (diff) | |
download | mariadb-git-e231e7f8eb85ebe8b0170060d3bcf66e44fa8ed8.tar.gz |
Merging from mysql-5.1 to mysql-5.5.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 29 |
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); + } } |