diff options
Diffstat (limited to 'sql/sp.cc')
-rw-r--r-- | sql/sp.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/sp.cc b/sql/sp.cc index 283db3539c9..982dc3dc91b 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1400,6 +1400,7 @@ bool lock_db_routines(THD *thd, char *db) Open_tables_backup open_tables_state_backup; MDL_request_list mdl_requests; Lock_db_routines_error_handler err_handler; + uchar keybuf[MAX_KEY_LENGTH]; DBUG_ENTER("lock_db_routines"); /* @@ -1422,11 +1423,11 @@ 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); - if (! table->file->index_read_map(table->record[0], - table->field[MYSQL_PROC_FIELD_DB]->ptr, - (key_part_map)1, HA_READ_KEY_EXACT)) + if (! table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1, + HA_READ_KEY_EXACT)) { do { @@ -1438,9 +1439,7 @@ bool lock_db_routines(THD *thd, char *db) MDL_key::FUNCTION : MDL_key::PROCEDURE, db, sp_name, MDL_EXCLUSIVE, MDL_TRANSACTION); mdl_requests.push_front(mdl_request); - } while (! (nxtres= table->file->index_next_same(table->record[0], - table->field[MYSQL_PROC_FIELD_DB]->ptr, - key_len))); + } while (! (nxtres= table->file->ha_index_next_same(table->record[0], keybuf, key_len))); } table->file->ha_index_end(); if (nxtres != 0 && nxtres != HA_ERR_END_OF_FILE) @@ -1487,8 +1486,6 @@ sp_drop_db_routines(THD *thd, char *db) key_len= table->key_info->key_part[0].store_length; 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_read_map(table->record[0], keybuf, (key_part_map)1, |