List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:October 12 2009 6:16pm
Subject:bzr push into mysql-5.5.0-next-mr-bugfixing branch (serg:2895 to 2896)
Bug#33731
View as plain text  
 2896 Sergei Golubchik	2009-10-12
      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.

    modified:
      scripts/mysql_system_tables.sql
      scripts/mysql_system_tables_fix.sql
      sql/sql_plugin.cc
 2895 Alexander Nozdrin	2009-10-09 [merge]
      Merge from mysql-next-mr.

    modified:
      .bzr-mysql/default.conf
=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2009-05-15 12:57:51 +0000
+++ b/scripts/mysql_system_tables.sql	2009-10-12 18:15:10 +0000
@@ -22,7 +22,7 @@ set @had_user_table= @@warning_count != 
 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';

=== modified file 'scripts/mysql_system_tables_fix.sql'
--- a/scripts/mysql_system_tables_fix.sql	2009-03-11 20:30:56 +0000
+++ b/scripts/mysql_system_tables_fix.sql	2009-10-12 18:15:10 +0000
@@ -229,6 +229,11 @@ SET GLOBAL slow_query_log = 'OFF';
 ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL;
 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
 #

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-09-04 10:32:21 +0000
+++ b/sql/sql_plugin.cc	2009-10-12 18:15:10 +0000
@@ -1764,12 +1764,13 @@ bool mysql_uninstall_plugin(THD *thd, co
   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;
     /*


Attachment: [text/bzr-bundle] bzr/serg@mysql.com-20091012181510-vsabmymdy32whtzt.bundle
Thread
bzr push into mysql-5.5.0-next-mr-bugfixing branch (serg:2895 to 2896)Bug#33731Sergei Golubchik12 Oct