summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-10-22 16:10:08 +0400
committerunknown <kaa@polly.(none)>2007-10-22 16:10:08 +0400
commitbbce18c303f1779ee5386b4f1aedf3de3e19b97c (patch)
tree977554b760b3dfaac163a7d3e2a383e639907522 /sql/filesort.cc
parent04311fabaa11105743ce124de283cd504c978cc4 (diff)
downloadmariadb-git-bbce18c303f1779ee5386b4f1aedf3de3e19b97c.tar.gz
Fix for bug #31742: delete from ... order by function call that causes
an error, asserts server In case of a fatal error during filesort in find_all_keys() the error was returned without the necessary handler uninitialization. Fixed by changing the code so that handler uninitialization is performed before returning the error. mysql-test/r/delete.result: Added a test case for bug #31742. mysql-test/t/delete.test: Added a test case for bug #31742. sql/filesort.cc: In case of a fatal error in find_all_keys() do not return before doing the necessary handler uninitialization steps.
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index db73ede99b0..08ffa2211fa 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -534,7 +534,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->unlock_row();
/* It does not make sense to read more keys in case of a fatal error */
if (thd->net.report_error)
- DBUG_RETURN(HA_POS_ERROR);
+ break;
}
if (quick_select)
{
@@ -551,6 +551,9 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->ha_rnd_end();
}
+ if (thd->net.report_error)
+ DBUG_RETURN(HA_POS_ERROR);
+
DBUG_PRINT("test",("error: %d indexpos: %d",error,indexpos));
if (error != HA_ERR_END_OF_FILE)
{