summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-02-01 14:09:48 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2018-02-01 14:09:48 +0200
commitc7e5feb2596e2a032207191320dbf1387d440959 (patch)
treeb4a5f850c3ab553a9a3c6b1b58bc5280ed42a861 /sql/handler.cc
parent08b2c516da4df91082ae9fbe5e060959c4bb5faa (diff)
parentd01dbe66a8bf9cb6031f95159c49100f9299a768 (diff)
downloadmariadb-git-c7e5feb2596e2a032207191320dbf1387d440959.tar.gz
Merge tag 'mariadb-10.0.34' into 10.0-galeramariadb-galera-10.0.34
Conflicts: storage/innobase/lock/lock0lock.cc storage/xtradb/lock/lock0lock.cc storage/xtradb/lock/lock0wait.cc support-files/mysql.server.sh
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f6ae797fb52..657cb01cbc8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3413,9 +3413,11 @@ void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag)
if (key == NULL)
{
- /* Key is unknown */
- str.copy("", 0, system_charset_info);
- my_printf_error(ER_DUP_ENTRY, msg, errflag, str.c_ptr(), "*UNKNOWN*");
+ /*
+ Key is unknown. Should only happen if storage engine reports wrong
+ duplicate key number.
+ */
+ my_printf_error(ER_DUP_ENTRY, msg, errflag, "", "*UNKNOWN*");
}
else
{
@@ -3507,11 +3509,9 @@ void handler::print_error(int error, myf errflag)
if (table)
{
uint key_nr=get_dup_key(error);
- if ((int) key_nr >= 0)
+ if ((int) key_nr >= 0 && key_nr < table->s->keys)
{
- print_keydup_error(table,
- key_nr == MAX_KEY ? NULL : &table->key_info[key_nr],
- errflag);
+ print_keydup_error(table, &table->key_info[key_nr], errflag);
DBUG_VOID_RETURN;
}
}