1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
Karthik Kamath
2017-12-05 19:49:59 +05:30
parent ecc5a07874
commit 9e1035c64f
6 changed files with 36 additions and 9 deletions

View File

@ -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.