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 | f9d939178efb050add0e74f9c79258683d00cd40 (patch) | |
tree | 65615dabb55932602d588ebf37c46ca100194391 /sql/handler.cc | |
parent | 425f07eacee344113ddcb90198072bddafbd2064 (diff) | |
parent | 357a008ad32704df620411bcb8a7cb26f15662de (diff) | |
download | mariadb-git-f9d939178efb050add0e74f9c79258683d00cd40.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); + } } |