From 8c14ed4230fb808c4bc5d7664345a909eb190520 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Nov 2002 19:15:46 +0100 Subject: [PATCH 1/2] IGNORE/USE INDEX now work with HA_EXTRA_KEYREAD BitKeeper/etc/ignore: Added depcomp to the ignore list --- .bzrignore | 1 + mysql-test/r/select.result | 4 ++-- sql/sql_base.cc | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.bzrignore b/.bzrignore index 63e77a9e30b..0cc24f9dbf6 100644 --- a/.bzrignore +++ b/.bzrignore @@ -321,3 +321,4 @@ sql-bench/innotest1b sql-bench/innotest2 sql-bench/innotest2a sql-bench/innotest2b +depcomp diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 413b03130f6..5ac5de05f97 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -94,9 +94,9 @@ fld3 table type possible_keys key key_len ref rows Extra t2 ref fld3 fld3 30 const 1 where used; Using index table type possible_keys key key_len ref rows Extra -t2 index fld3 fld3 30 NULL 1199 where used; Using index +t2 ALL fld3 NULL NULL NULL 1199 where used table type possible_keys key key_len ref rows Extra -t2 index fld3 fld3 30 NULL 1199 where used; Using index +t2 ALL fld3 NULL NULL NULL 1199 where used table type possible_keys key key_len ref rows Extra t2 ref fld3 fld3 30 const 1 where used; Using index table type possible_keys key key_len ref rows Extra diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6b445442058..fb120442385 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1834,6 +1834,7 @@ bool setup_tables(TABLE_LIST *tables) DBUG_RETURN(1); table->table->keys_in_use_for_query &= ~map; } + table->table->used_keys &= table->table->keys_in_use_for_query; } if (tablenr > MAX_TABLES) { From bb2ceda1b2b8bba35bcabcc63dba3d95c67fa85a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Nov 2002 19:57:13 +0100 Subject: [PATCH 2/2] results fixed mysql-test/r/isam.result: fixed result for new errmsg mysql-test/r/select.result: fixed result for IGNORE/USE INDEX --- mysql-test/r/isam.result | 6 +++--- mysql-test/r/select.result | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result index d19352aad42..0f7224f52da 100644 --- a/mysql-test/r/isam.result +++ b/mysql-test/r/isam.result @@ -47,14 +47,14 @@ test.t1 optimize status OK check table t1,t2; Table Op Msg_type Msg_text test.t1 check status OK -test.t2 check error The handler for the table doesn't support check/repair +test.t2 check error The handler for the table doesn't support check repair table t1,t2; Table Op Msg_type Msg_text test.t1 repair status OK -test.t2 repair error The handler for the table doesn't support check/repair +test.t2 repair error The handler for the table doesn't support repair check table t2,t1; Table Op Msg_type Msg_text -test.t2 check error The handler for the table doesn't support check/repair +test.t2 check error The handler for the table doesn't support check test.t1 check status OK lock tables t1 write; check table t2,t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 1a40c5b11c3..fdcc7f9cdea 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1331,10 +1331,10 @@ table type possible_keys key key_len ref rows Extra t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; table type possible_keys key key_len ref rows Extra -t2 index NULL fld3 30 NULL 1199 Using where; Using index +t2 ALL NULL NULL NULL NULL 1199 Using where explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; table type possible_keys key key_len ref rows Extra -t2 index NULL fld3 30 NULL 1199 Using where; Using index +t2 ALL NULL NULL NULL NULL 1199 Using where explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; table type possible_keys key key_len ref rows Extra t2 ref fld3 fld3 30 const 1 Using where; Using index