List:Commits« Previous MessageNext Message »
From:kgeorge Date:May 22 2007 2:05pm
Subject:bk commit into 5.0 tree (gkodinov:1.2498)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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, 2007-05-22 17:05:33+03:00, gkodinov@stripped +2 -0
  Merge gkodinov@stripped:/home/bk/mysql-5.0-opt
  into  magare.gmz:/home/kgeorge/mysql/autopush/B28476-5.0-opt
  MERGE: 1.2483.8.1

  sql/sql_base.cc@stripped, 2007-05-22 17:05:31+03:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.377.2.1

  sql/table.h@stripped, 2007-05-22 17:05:31+03:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.141.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:	gkodinov
# Host:	magare.gmz
# Root:	/home/kgeorge/mysql/autopush/B28476-5.0-opt/RESYNC

--- 1.379/sql/sql_base.cc	2007-05-16 08:51:57 +03:00
+++ 1.380/sql/sql_base.cc	2007-05-22 17:05:31 +03:00
@@ -5167,7 +5167,12 @@ bool setup_tables(THD *thd, Name_resolut
       get_key_map_from_key_list(&map, table, table_list->use_index);
       if (map.is_set_all())
 	DBUG_RETURN(1);
-      table->keys_in_use_for_query=map;
+      /* 
+	 Don't introduce keys in keys_in_use_for_query that weren't there 
+	 before. FORCE/USE INDEX should not add keys, it should only remove
+	 all keys except the key(s) specified in the hint.
+      */
+      table->keys_in_use_for_query.intersect(map);
     }
     if (table_list->ignore_index)
     {

--- 1.142/sql/table.h	2007-05-11 19:33:11 +03:00
+++ 1.143/sql/table.h	2007-05-22 17:05:31 +03:00
@@ -137,7 +137,12 @@ typedef struct st_table_share
   const char *table_name;               /* Table name (for open) */
   const char *path;                     /* Path to .frm file (from datadir) */
   LEX_STRING connect_string;
-  key_map keys_in_use;                  /* Keys in use for table */
+
+  /* 
+     Set of keys in use, implemented as a Bitmap.
+     Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.
+  */
+  key_map keys_in_use;
   key_map keys_for_keyread;
   ulong   avg_row_length;		/* create information */
   ulong   raid_chunksize;
@@ -208,7 +213,21 @@ struct st_table {
 
   byte *record[2];			/* Pointer to records */
   byte *insert_values;                  /* used by INSERT ... UPDATE */
-  key_map quick_keys, used_keys, keys_in_use_for_query;
+  key_map quick_keys, used_keys;
+
+  /*
+    A set of keys that can be used in the query that references this
+    table 
+
+    All indexes disabled on the table's TABLE_SHARE (see TABLE::s) will be 
+    subtracted from this set upon instantiation. Thus for any TABLE t it holds
+    that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we 
+    must not introduce any new keys here (see setup_tables).
+
+    The set is implemented as a bitmap.
+  */
+  key_map keys_in_use_for_query;
+  key_map merge_keys;
   KEY  *key_info;			/* data of keys in database */
 
   Field *next_number_field,		/* Set if next_number is activated */
Thread
bk commit into 5.0 tree (gkodinov:1.2498)kgeorge22 May