Commit df59e27b authored by Sergei Golubchik's avatar Sergei Golubchik

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)
parent 8cf70621
...@@ -22,7 +22,7 @@ set @had_user_table= @@warning_count != 0; ...@@ -22,7 +22,7 @@ set @had_user_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl char(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='MySQL plugins'; CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins';
CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table';
......
...@@ -229,6 +229,11 @@ SET GLOBAL slow_query_log = 'OFF'; ...@@ -229,6 +229,11 @@ SET GLOBAL slow_query_log = 'OFF';
ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL;
SET GLOBAL slow_query_log = @old_log_state; SET GLOBAL slow_query_log = @old_log_state;
ALTER TABLE plugin
MODIFY name varchar(64) COLLATE utf8_general_ci NOT NULL DEFAULT '',
MODIFY dl varchar(128) COLLATE utf8_general_ci NOT NULL DEFAULT '',
CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
# #
# Detect whether we had Create_view_priv # Detect whether we had Create_view_priv
# #
......
...@@ -1764,12 +1764,13 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) ...@@ -1764,12 +1764,13 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
reap_plugins(); reap_plugins();
pthread_mutex_unlock(&LOCK_plugin); pthread_mutex_unlock(&LOCK_plugin);
uchar user_key[MAX_KEY_LENGTH];
table->use_all_columns(); table->use_all_columns();
table->field[0]->store(name->str, name->length, system_charset_info); table->field[0]->store(name->str, name->length, system_charset_info);
if (! table->file->index_read_idx_map(table->record[0], 0, key_copy(user_key, table->record[0], table->key_info,
(uchar *)table->field[0]->ptr, table->key_info->key_length);
HA_WHOLE_KEY, if (! table->file->index_read_idx_map(table->record[0], 0, user_key,
HA_READ_KEY_EXACT)) HA_WHOLE_KEY, HA_READ_KEY_EXACT))
{ {
int error; int error;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment