List:Internals« Previous MessageNext Message »
From:ingo Date:November 7 2005 12:16pm
Subject:bk commit into 4.0 tree (ingo:1.2174) BUG#14616
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of mydev. When mydev 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
  1.2174 05/11/07 12:16:49 ingo@stripped +3 -0
  Bug#14616 - Freshly imported table returns error 124 when using LIMIT
  Initialized usable_keys from table->keys_in_use instead of ~0
  in test_if_skip_sort_order(). It was possible that a disabled
  index was used for sorting.

  sql/sql_select.cc
    1.294 05/11/07 12:16:47 ingo@stripped +6 -2
    Bug#14616 - Freshly imported table returns error 124 when using LIMIT
    Initialized usable_keys from table->keys_in_use instead of ~0
    in test_if_skip_sort_order(). It was possible that a disabled
    index was used for sorting.

  mysql-test/t/myisam.test
    1.27 05/11/07 12:16:47 ingo@stripped +12 -0
    Bug#14616 - Freshly imported table returns error 124 when using LIMIT
    The test case.

  mysql-test/r/myisam.result
    1.31 05/11/07 12:16:47 ingo@stripped +10 -0
    Bug#14616 - Freshly imported table returns error 124 when using LIMIT
    The test result.

# 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:	ingo
# Host:	chilla.local
# Root:	/home/mydev/mysql-4.0-bug14616

--- 1.293/sql/sql_select.cc	2005-10-13 23:20:33 +02:00
+++ 1.294/sql/sql_select.cc	2005-11-07 12:16:47 +01:00
@@ -6003,8 +6003,12 @@
   key_map usable_keys;
   DBUG_ENTER("test_if_skip_sort_order");
 
-  /* Check which keys can be used to resolve ORDER BY */
-  usable_keys= ~(key_map) 0;
+  /*
+    Check which keys can be used to resolve ORDER BY.
+    We must not try to use disabled keys.
+  */
+  usable_keys= table->keys_in_use;
+
   for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
   {
     if ((*tmp_order->item)->type() != Item::FIELD_ITEM)

--- 1.30/mysql-test/r/myisam.result	2004-08-01 13:25:58 +02:00
+++ 1.31/mysql-test/r/myisam.result	2005-11-07 12:16:47 +01:00
@@ -462,3 +462,13 @@
 count(*)
 2
 drop table t1;
+create table t1 (
+c1 varchar(32),
+key (c1)
+) engine=myisam;
+alter table t1 disable keys;
+insert into t1 values ('a'), ('b');
+select c1 from t1 order by c1 limit 1;
+c1
+a
+drop table t1;

--- 1.26/mysql-test/t/myisam.test	2004-08-01 13:25:58 +02:00
+++ 1.27/mysql-test/t/myisam.test	2005-11-07 12:16:47 +01:00
@@ -446,3 +446,15 @@
 select count(*) from t1 where a is null;
 drop table t1;
 
+#
+# Bug#14616 - Freshly imported table returns error 124 when using LIMIT
+#
+create table t1 (
+  c1 varchar(32),
+  key (c1)
+) engine=myisam;
+alter table t1 disable keys;
+insert into t1 values ('a'), ('b');
+select c1 from t1 order by c1 limit 1;
+drop table t1;
+
Thread
bk commit into 4.0 tree (ingo:1.2174) BUG#14616ingo7 Nov