mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#41726: upgrade from 5.0 to 5.1.30 crashes if you didn't run mysql_upgrade
The problem is that the server could crash when attempting to access a non-conformant proc system table. One such case was a crash when invoking stored procedure related statements on a 5.1 server with a proc system table in the 5.0 format. The solution is to validate the proc system table format before attempts to access it are made. If the table is not in the format that the server expects, a message is written to the error log and the statement that caused the table to be accessed fails. mysql-test/r/sp-destruct.result: Add test case result for Bug#41726 mysql-test/t/sp-destruct.test: Add test case for Bug#41726 sql/event_db_repository.cc: Update code to use new structures. sql/sp.cc: Describe the proc table format and use it to validate when opening a instance of the table. Add a check to insure that a error message is written to the error log only once. sql/sql_acl.cc: Remove unused variable and use new structure. sql/sql_acl.h: Export field definition. sql/table.cc: Accept the field count and definition in a single structure. sql/table.h: Combine the field count and definition in a single structure. Transform function into a class in order to support different ways of reporting a error. Add a pointer cache to TABLE_SHARE.
This commit is contained in:
@ -31,9 +31,8 @@
|
||||
#include "sp_head.h"
|
||||
#include "sp.h"
|
||||
|
||||
time_t mysql_db_table_last_check= 0L;
|
||||
|
||||
TABLE_FIELD_W_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
|
||||
static const
|
||||
TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
|
||||
{
|
||||
{ C_STRING_WITH_LEN("Host") },
|
||||
{ C_STRING_WITH_LEN("char(60)") },
|
||||
@ -146,6 +145,8 @@ TABLE_FIELD_W_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
|
||||
}
|
||||
};
|
||||
|
||||
const TABLE_FIELD_DEF
|
||||
mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields};
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
|
||||
|
Reference in New Issue
Block a user