summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-08-06 15:21:28 +0200
committerunknown <pem@mysql.comhem.se>2004-08-06 15:21:28 +0200
commitb4c9e3f47c7b26a1010d3e4cf5585474bfbf83ca (patch)
tree2ea2cfa413417ad54180f865a8cb0b33ba4188d1 /sql
parent6901fd5514afce898766ee104ca6ea88b4ebf089 (diff)
downloadmariadb-git-b4c9e3f47c7b26a1010d3e4cf5585474bfbf83ca.tar.gz
Fixed BUG#4904: Stored procedure crash if continue handler for HY000 errors.
The description is not entirerly correct. The issue was follow-up errors where the first error is not caught - in which case it's often a system error with errcode < 1000 (which are mapped by default to 'HY000'). In this case the error state is different from what was assumed in the execution loop. mysql-test/r/sp.result: New test case for BUG#4902. mysql-test/t/sp.test: New test case for BUG#4902. sql/sp_head.cc: Don't test the net.report_error flag in the execution loop. (Don't know why this was done in the first place, as it seems to serve no purpose.)
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_head.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 987f20c23f6..6ba72215e39 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -486,8 +486,7 @@ sp_head::execute(THD *thd)
continue;
}
}
- } while (ret == 0 && !thd->killed && !thd->query_error &&
- !thd->net.report_error);
+ } while (ret == 0 && !thd->killed && !thd->query_error);
if (thd->current_arena)
cleanup_items(thd->current_arena->free_list);
@@ -497,7 +496,7 @@ sp_head::execute(THD *thd)
DBUG_PRINT("info", ("ret=%d killed=%d query_error=%d",
ret, thd->killed, thd->query_error));
- if (thd->killed || thd->query_error || thd->net.report_error)
+ if (thd->killed || thd->query_error)
ret= -1;
/* If the DB has changed, the pointer has changed too, but the
original thd->db will then have been freed */