From 285257f7c8c3d9e00811c7713323586ad36a832d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Oct 2009 20:15:10 +0200 Subject: bug#33731 - INSTALL/UNINSTALL PLUGIN: Inconsistent handling of identifier case indexed column in mysql.plugin table should use case-insensitive collation for index lookups to work (backport from 6.0) sql/sql_plugin.cc: generate the key correctly using key_copy. field->store() stores the value in record format, not key format. --- sql/sql_plugin.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 025c8a8248d..4e0b4b4d07b 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1764,12 +1764,13 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) reap_plugins(); pthread_mutex_unlock(&LOCK_plugin); + uchar user_key[MAX_KEY_LENGTH]; table->use_all_columns(); table->field[0]->store(name->str, name->length, system_charset_info); - if (! table->file->index_read_idx_map(table->record[0], 0, - (uchar *)table->field[0]->ptr, - HA_WHOLE_KEY, - HA_READ_KEY_EXACT)) + key_copy(user_key, table->record[0], table->key_info, + table->key_info->key_length); + if (! table->file->index_read_idx_map(table->record[0], 0, user_key, + HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { int error; /* -- cgit v1.2.1