summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-05-22 15:58:30 +0300
committergkodinov/kgeorge@magare.gmz <>2007-05-22 15:58:30 +0300
commit604ef46327cf0bb57f1fc4e7160783acd1707d54 (patch)
tree08d9d02d66f614e32a6d645cfda994fa73990360 /sql/table.h
parent4ac1e98630759c9b86bb73035b4f95cd6909a2a9 (diff)
downloadmariadb-git-604ef46327cf0bb57f1fc4e7160783acd1707d54.tar.gz
Bug #28476: force index on a disabled myisam index gives error 124
When processing the USE/FORCE index hints the optimizer was not checking if the indexes specified are enabled (see ALTER TABLE). Fixed by: Backporting the fix for bug 20604 to 5.0
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/table.h b/sql/table.h
index 61232a39f0e..ebcafbd4dc7 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -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;
@@ -206,7 +211,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 */