summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorKarthik Kamath <karthik.kamath@oracle.com>2017-12-05 19:49:59 +0530
committerKarthik Kamath <karthik.kamath@oracle.com>2017-12-05 19:49:59 +0530
commit9e1035c64f2db233995082397921f553810bdfbc (patch)
tree1ed66ef6d8247b0de2ca7ea98326742b66d2f55d /sql/sql_plugin.cc
parentecc5a07874d44307b835ff5dbd091343961fbc93 (diff)
downloadmariadb-git-9e1035c64f2db233995082397921f553810bdfbc.tar.gz
BUG#26881798: SERVER EXITS WHEN PRIMARY KEY IN MYSQL.PROC
IS DROPPED ANALYSIS: ========= It is advised not to tamper with the system tables. When primary key is dropped from a system table, certain operations on the table which tries to access the table key information may lead to server exit. FIX: ==== An appropriate error is now reported in such a case.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 9ec0390483a..3af9136d37f 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1899,6 +1899,16 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
if (! (table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT)))
DBUG_RETURN(TRUE);
+ if (!table->key_info)
+ {
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "The table '%s.%s' does not have the necessary key(s) "
+ "defined on it. Please check the table definition and "
+ "create index(s) accordingly.", MYF(0),
+ table->s->db.str, table->s->table_name.str);
+ DBUG_RETURN(TRUE);
+ }
+
/*
Pre-acquire audit plugins for events that may potentially occur
during [UN]INSTALL PLUGIN.