mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
5.5 merge
This commit is contained in:
16
sql/sp.cc
16
sql/sp.cc
@@ -1418,7 +1418,6 @@ bool lock_db_routines(THD *thd, char *db)
|
||||
{
|
||||
TABLE *table;
|
||||
uint key_len;
|
||||
int nxtres= 0;
|
||||
Open_tables_backup open_tables_state_backup;
|
||||
MDL_request_list mdl_requests;
|
||||
Lock_db_routines_error_handler err_handler;
|
||||
@@ -1446,7 +1445,13 @@ bool lock_db_routines(THD *thd, char *db)
|
||||
table->field[MYSQL_PROC_FIELD_DB]->store(db, strlen(db), system_charset_info);
|
||||
key_len= table->key_info->key_part[0].store_length;
|
||||
table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW);
|
||||
table->file->ha_index_init(0, 1);
|
||||
int nxtres= table->file->ha_index_init(0, 1);
|
||||
if (nxtres)
|
||||
{
|
||||
table->file->print_error(nxtres, MYF(0));
|
||||
close_system_tables(thd, &open_tables_state_backup);
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
|
||||
if (! table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1,
|
||||
HA_READ_KEY_EXACT))
|
||||
@@ -1509,7 +1514,11 @@ sp_drop_db_routines(THD *thd, char *db)
|
||||
table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW);
|
||||
|
||||
ret= SP_OK;
|
||||
table->file->ha_index_init(0, 1);
|
||||
if (table->file->ha_index_init(0, 1))
|
||||
{
|
||||
ret= SP_KEY_NOT_FOUND;
|
||||
goto err_idx_init;
|
||||
}
|
||||
if (!table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1,
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
@@ -1535,6 +1544,7 @@ sp_drop_db_routines(THD *thd, char *db)
|
||||
}
|
||||
table->file->ha_index_end();
|
||||
|
||||
err_idx_init:
|
||||
close_thread_tables(thd);
|
||||
/*
|
||||
Make sure to only release the MDL lock on mysql.proc, not other
|
||||
|
Reference in New Issue
Block a user