diff options
author | Monty <monty@mariadb.org> | 2018-01-23 19:21:44 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-01-24 00:09:34 +0200 |
commit | b3c7cf81e3578fef828aa749de4c75258c3fbd76 (patch) | |
tree | 4272441997be7c44e2c06a581f254f7a07c97ebc /sql/log_event.cc | |
parent | a4663af05c1d1bd3abb537205df070ed2158e702 (diff) | |
download | mariadb-git-b3c7cf81e3578fef828aa749de4c75258c3fbd76.tar.gz |
Fix for MDEV-14141 Crash in print_keydup_error()
May also fix: MDEV-14970 "MariaDB crashed with signal 11 and Aria table"
I am not able to reproduce a crash, however there was no protection in
print_keydup_error() if the storage engine reported the wrong key number.
This patch adds such a protection and should stop any further crashes
in this case.
Other things:
- Added extra protection in Aria to not set errkey to more than number of
keys. (Don't think this is cause of this crash, but better safe than
sorry)
- Extend test_if_equal_repl_errors() to handle different cases of
ER_DUP_ENTRY. This is just mainly precaution for the future.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index b66ceac72bf..dcccdb2527f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4075,8 +4075,13 @@ bool test_if_equal_repl_errors(int expected_error, int actual_error) return 1; switch (expected_error) { case ER_DUP_ENTRY: + case ER_DUP_ENTRY_WITH_KEY_NAME: + case ER_DUP_KEY: case ER_AUTOINC_READ_FAILED: - return (actual_error == ER_AUTOINC_READ_FAILED || + return (actual_error == ER_DUP_ENTRY || + actual_error == ER_DUP_ENTRY_WITH_KEY_NAME || + actual_error == ER_DUP_KEY || + actual_error == ER_AUTOINC_READ_FAILED || actual_error == HA_ERR_AUTOINC_ERANGE); case ER_UNKNOWN_TABLE: return actual_error == ER_IT_IS_A_VIEW; |