diff options
author | Igor Babaev <igor@askmonty.org> | 2017-08-10 16:23:26 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-08-10 16:23:26 -0700 |
commit | 5a71e6bd5a61dff6d549d2c4f5927bbbd7ebcfee (patch) | |
tree | 98ca05164f4a2bf2fce6e1644bc6335193e69bbd /sql/handler.cc | |
parent | 1710dd2bf286f9a240f380925a0067c57c1b29f9 (diff) | |
parent | bf75dcac89d1496032015526dc6ce78d327e329f (diff) | |
download | mariadb-git-bb-10-ext-mdev-13369.tar.gz |
Merge branch 'bb-10.2-ext' into bb-10-ext-mdev-13369bb-10-ext-mdev-13369
# Conflicts:
# mysql-test/r/derived_cond_pushdown.result
# mysql-test/t/derived_cond_pushdown.test
# sql/sql_derived.cc
# sql/sql_select.cc
# sql/sql_select.h
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 18 |
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; |