List:Commits« Previous MessageNext Message »
From:ahristov Date:August 23 2006 3:51pm
Subject:bk commit into 5.1 tree (ahristov:1.2283)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of ahristov. When ahristov does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-23 17:50:56+02:00, ahristov@stripped +4 -0
  Merge bk-internal.mysql.com:/data0/bk/mysql-5.1-runtime
  into  bk-internal.mysql.com:/data0/bk/mysql-5.1-wl3337
  MERGE: 1.2274.1.7

  mysql-test/r/ps_1general.result@stripped, 2006-08-23 17:50:51+02:00, ahristov@stripped +0 -0
    Auto merged
    MERGE: 1.59.1.2

  sql/sp_head.cc@stripped, 2006-08-23 17:50:51+02:00, ahristov@stripped +0 -0
    Auto merged
    MERGE: 1.232.1.1

  sql/table.cc@stripped, 2006-08-23 17:50:51+02:00, ahristov@stripped +0 -0
    Auto merged
    MERGE: 1.239.1.1

  sql/table.h@stripped, 2006-08-23 17:50:52+02:00, ahristov@stripped +0 -0
    Auto merged
    MERGE: 1.148.1.1

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ahristov
# Host:	bk-internal.mysql.com
# Root:	/data0/bk/mysql-5.1-wl3337/RESYNC

--- 1.240/sql/table.cc	2006-08-23 17:51:16 +02:00
+++ 1.241/sql/table.cc	2006-08-23 17:51:16 +02:00
@@ -93,6 +93,7 @@
 {
   MEM_ROOT mem_root;
   TABLE_SHARE *share;
+  char *key_buff, *path_buff;
   char path[FN_REFLEN];
   uint path_length;
   DBUG_ENTER("alloc_table_share");
@@ -103,22 +104,17 @@
                                     table_list->db,
                                     table_list->table_name, "", 0);
   init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
-  if ((share= (TABLE_SHARE*) alloc_root(&mem_root,
-					sizeof(*share) + key_length +
-                                        path_length +1)))
+  if (multi_alloc_root(&mem_root,
+                       &share, sizeof(*share),
+                       &key_buff, key_length,
+                       &path_buff, path_length + 1,
+                       NULL))
   {
     bzero((char*) share, sizeof(*share));
-    share->table_cache_key.str=    (char*) (share+1);
-    share->table_cache_key.length= key_length;
-    memcpy(share->table_cache_key.str, key, key_length);
 
-    /* Use the fact the key is db/0/table_name/0 */
-    share->db.str=            share->table_cache_key.str;
-    share->db.length=         strlen(share->db.str);
-    share->table_name.str=    share->db.str + share->db.length + 1;
-    share->table_name.length= strlen(share->table_name.str);
+    share->set_table_cache_key(key_buff, key, key_length);
 
-    share->path.str= share->table_cache_key.str+ key_length;
+    share->path.str= path_buff;
     share->path.length= path_length;
     strmov(share->path.str, path);
     share->normalized_path.str=    share->path.str;

--- 1.149/sql/table.h	2006-08-23 17:51:16 +02:00
+++ 1.150/sql/table.h	2006-08-23 17:51:16 +02:00
@@ -138,7 +138,16 @@
   CHARSET_INFO *table_charset;		/* Default charset of string fields */
 
   MY_BITMAP all_set;
-  /* A pair "database_name\0table_name\0", widely used as simply a db name */
+  /*
+    Key which is used for looking-up table in table cache and in the list
+    of thread's temporary tables. Has the form of:
+      "database_name\0table_name\0" + optional part for temporary tables.
+
+    Note that all three 'table_cache_key', 'db' and 'table_name' members
+    must be set (and be non-zero) for tables in table cache. They also
+    should correspond to each other.
+    To ensure this one can use set_table_cache() methods.
+  */
   LEX_STRING table_cache_key;
   LEX_STRING db;                        /* Pointer to db */
   LEX_STRING table_name;                /* Table name (for open) */
@@ -223,6 +232,60 @@
   uint part_state_len;
   handlerton *default_part_db_type;
 #endif
+
+
+  /*
+    Set share's table cache key and update its db and table name appropriately.
+
+    SYNOPSIS
+      set_table_cache_key()
+        key_buff    Buffer with already built table cache key to be
+                    referenced from share.
+        key_length  Key length.
+
+    NOTES
+      Since 'key_buff' buffer will be referenced from share it should has same
+      life-time as share itself.
+      This method automatically ensures that TABLE_SHARE::table_name/db have
+      appropriate values by using table cache key as their source.
+  */
+
+  void set_table_cache_key(char *key_buff, uint key_length)
+  {
+    table_cache_key.str= key_buff;
+    table_cache_key.length= key_length;
+    /*
+      Let us use the fact that the key is "db/0/table_name/0" + optional
+      part for temporary tables.
+    */
+    db.str=            table_cache_key.str;
+    db.length=         strlen(db.str);
+    table_name.str=    db.str + db.length + 1;
+    table_name.length= strlen(table_name.str);
+  }
+
+
+  /*
+    Set share's table cache key and update its db and table name appropriately.
+
+    SYNOPSIS
+      set_table_cache_key()
+        key_buff    Buffer to be used as storage for table cache key
+                    (should be at least key_length bytes).
+        key         Value for table cache key.
+        key_length  Key length.
+
+    NOTE
+      Since 'key_buff' buffer will be used as storage for table cache key
+      it should has same life-time as share itself.
+  */
+
+  void set_table_cache_key(char *key_buff, const char *key, uint key_length)
+  {
+    memcpy(key_buff, key, key_length);
+    set_table_cache_key(key_buff, key_length);
+  }
+
 } TABLE_SHARE;
 
 

--- 1.61/mysql-test/r/ps_1general.result	2006-08-23 17:51:16 +02:00
+++ 1.62/mysql-test/r/ps_1general.result	2006-08-23 17:51:16 +02:00
@@ -308,17 +308,11 @@
 execute stmt4;
 prepare stmt4 from ' show grants for user ';
 prepare stmt4 from ' show create table t2 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show master status ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show master logs ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show slave status ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show warnings limit 20 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show errors limit 20 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' show storage engines ';
 execute stmt4;
 drop table if exists t5;
@@ -387,10 +381,8 @@
 prepare stmt4 from ' use test ' ;
 ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt3 from ' create database mysqltest ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 create database mysqltest ;
 prepare stmt3 from ' drop database mysqltest ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 drop database mysqltest ;
 prepare stmt3 from ' describe t2 ';
 execute stmt3;
@@ -412,7 +404,6 @@
 prepare stmt1 from ' optimize table t1 ' ;
 prepare stmt1 from ' analyze table t1 ' ;
 prepare stmt1 from ' checksum table t1 ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' repair table t1 ' ;
 prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
 ERROR HY000: This command is not supported in the prepared statement protocol yet
@@ -440,11 +431,8 @@
 1
 SET sql_mode="";
 prepare stmt1 from ' flush local privileges ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' reset query cache ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' KILL 0 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' explain select a from t1 order by b ';
 execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr

--- 1.233/sql/sp_head.cc	2006-08-23 17:51:16 +02:00
+++ 1.234/sql/sp_head.cc	2006-08-23 17:51:16 +02:00
@@ -161,17 +161,20 @@
     }
     /* fallthrough */
   case SQLCOM_ANALYZE:
+  case SQLCOM_BACKUP_TABLE:
   case SQLCOM_OPTIMIZE:
   case SQLCOM_PRELOAD_KEYS:
   case SQLCOM_ASSIGN_TO_KEYCACHE:
   case SQLCOM_CHECKSUM:
   case SQLCOM_CHECK:
   case SQLCOM_HA_READ:
+  case SQLCOM_SHOW_AUTHORS:
   case SQLCOM_SHOW_BINLOGS:
   case SQLCOM_SHOW_BINLOG_EVENTS:
   case SQLCOM_SHOW_CHARSETS:
   case SQLCOM_SHOW_COLLATIONS:
   case SQLCOM_SHOW_COLUMN_TYPES:
+  case SQLCOM_SHOW_CONTRIBUTORS:
   case SQLCOM_SHOW_CREATE:
   case SQLCOM_SHOW_CREATE_DB:
   case SQLCOM_SHOW_CREATE_FUNC:
@@ -180,16 +183,20 @@
   case SQLCOM_SHOW_DATABASES:
   case SQLCOM_SHOW_ERRORS:
   case SQLCOM_SHOW_FIELDS:
+  case SQLCOM_SHOW_FUNC_CODE:
   case SQLCOM_SHOW_GRANTS:
   case SQLCOM_SHOW_ENGINE_STATUS:
   case SQLCOM_SHOW_ENGINE_LOGS:
   case SQLCOM_SHOW_ENGINE_MUTEX:
+  case SQLCOM_SHOW_EVENTS:
   case SQLCOM_SHOW_KEYS:
   case SQLCOM_SHOW_MASTER_STAT:
   case SQLCOM_SHOW_NEW_MASTER:
   case SQLCOM_SHOW_OPEN_TABLES:
   case SQLCOM_SHOW_PRIVILEGES:
   case SQLCOM_SHOW_PROCESSLIST:
+  case SQLCOM_SHOW_PROC_CODE:
+  case SQLCOM_SHOW_SCHEDULER_STATUS:
   case SQLCOM_SHOW_SLAVE_HOSTS:
   case SQLCOM_SHOW_SLAVE_STAT:
   case SQLCOM_SHOW_STATUS:
@@ -199,12 +206,7 @@
   case SQLCOM_SHOW_TABLES:
   case SQLCOM_SHOW_VARIABLES:
   case SQLCOM_SHOW_WARNS:
-  case SQLCOM_SHOW_PROC_CODE:
-  case SQLCOM_SHOW_FUNC_CODE:
-  case SQLCOM_SHOW_AUTHORS:
-  case SQLCOM_SHOW_CONTRIBUTORS:
   case SQLCOM_REPAIR:
-  case SQLCOM_BACKUP_TABLE:
   case SQLCOM_RESTORE_TABLE:
     flags= sp_head::MULTI_RESULTS;
     break;
@@ -262,6 +264,9 @@
   case SQLCOM_CREATE_EVENT:
   case SQLCOM_ALTER_EVENT:
   case SQLCOM_DROP_EVENT:
+  case SQLCOM_FLUSH:
+  case SQLCOM_INSTALL_PLUGIN:
+  case SQLCOM_UNINSTALL_PLUGIN:
     flags= sp_head::HAS_COMMIT_OR_ROLLBACK;
     break;
   default:
Thread
bk commit into 5.1 tree (ahristov:1.2283)ahristov23 Aug