summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 4a9df5b2bf8..6f83175f16a 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3356,6 +3356,12 @@ void handler::print_error(int error, myf errflag)
DBUG_ENTER("handler::print_error");
DBUG_PRINT("enter",("error: %d",error));
+ if (ha_thd()->transaction_rollback_request)
+ {
+ /* Ensure this becomes a true error */
+ errflag&= ~(ME_JUST_WARNING | ME_JUST_INFO);
+ }
+
int textno= -1; // impossible value
switch (error) {
case EACCES:
@@ -3501,10 +3507,14 @@ void handler::print_error(int error, myf errflag)
textno=ER_LOCK_TABLE_FULL;
break;
case HA_ERR_LOCK_DEADLOCK:
- textno=ER_LOCK_DEADLOCK;
- /* cannot continue. the statement was already aborted in the engine */
- SET_FATAL_ERROR;
- break;
+ {
+ String str, full_err_msg(ER_DEFAULT(ER_LOCK_DEADLOCK), system_charset_info);
+
+ get_error_message(error, &str);
+ full_err_msg.append(str);
+ my_printf_error(ER_LOCK_DEADLOCK, "%s", errflag, full_err_msg.c_ptr_safe());
+ DBUG_VOID_RETURN;
+ }
case HA_ERR_READ_ONLY_TRANSACTION:
textno=ER_READ_ONLY_TRANSACTION;
break;