List:Internals« Previous MessageNext Message »
From:igor Date:June 23 2005 11:08am
Subject:bk commit into 5.0 tree (igor:1.1986) BUG#11487
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor 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.1986 05/06/23 02:08:30 igor@stripped +3 -0
  opt_range.cc:
    Fixed buf #11487.
    Added a call of  QUICK_RANGE_SELECT::init to the
    QUICK_RANGE_SELECT::reset method. Without it the second
    evaluation of a subquery employing the range access failed.
  subselect.result, subselect.test:
    Added a test case for bug #11487.

  sql/opt_range.cc
    1.172 05/06/23 00:28:45 igor@stripped +4 -1
    Fixed buf #11487.
    Added a call of  QUICK_RANGE_SELECT::init to the
    QUICK_RANGE_SELECT::reset method. Without it the second
    evaluation of a subquery employing the range access failed.

  mysql-test/r/subselect.result
    1.116 05/06/23 00:27:59 igor@stripped +21 -0
    Added a test case for bug #11487.

  mysql-test/t/subselect.test
    1.101 05/06/23 00:27:30 igor@stripped +22 -0
    Added a test case for bug #11487.

# 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:	igor
# Host:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-5.0-0

--- 1.171/sql/opt_range.cc	Wed Jun 22 02:08:21 2005
+++ 1.172/sql/opt_range.cc	Thu Jun 23 00:28:45 2005
@@ -5992,7 +5992,10 @@
   next=0;
   range= NULL;
   cur_range= (QUICK_RANGE**) ranges.buffer;
-  
+
+  if (file->inited == handler::NONE && (error= file->ha_index_init(index)))
+      DBUG_RETURN(error);
+ 
   /* Do not allocate the buffers twice. */
   if (multi_range_length)
   {

--- 1.115/mysql-test/r/subselect.result	Fri May 20 06:31:43 2005
+++ 1.116/mysql-test/r/subselect.result	Thu Jun 23 00:27:59 2005
@@ -2816,3 +2816,24 @@
 EMPNUM
 E1
 DROP TABLE t1,t2;
+CREATE TABLE t1(select_id BIGINT, values_id BIGINT);
+INSERT INTO t1 VALUES (1, 1);
+CREATE TABLE t2 (select_id BIGINT, values_id BIGINT, 
+PRIMARY KEY(select_id,values_id));
+INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5);
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+WHERE select_id IN (1, 0));
+values_id
+1
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+WHERE select_id BETWEEN 0 AND 1);
+values_id
+1
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+WHERE select_id = 0 OR select_id = 1);
+values_id
+1
+DROP TABLE t1, t2;

--- 1.100/mysql-test/t/subselect.test	Fri May 20 06:31:43 2005
+++ 1.101/mysql-test/t/subselect.test	Thu Jun 23 00:27:30 2005
@@ -1837,3 +1837,25 @@
        WHERE t1.EMPNUM = t2.EMPNUM);
 select * from t1;
 DROP TABLE t1,t2;
+
+#
+# Test for bug #11487: range access in a subquery
+#
+
+CREATE TABLE t1(select_id BIGINT, values_id BIGINT);
+INSERT INTO t1 VALUES (1, 1);
+CREATE TABLE t2 (select_id BIGINT, values_id BIGINT, 
+                 PRIMARY KEY(select_id,values_id));
+INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5);
+
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+                    WHERE select_id IN (1, 0));
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+                    WHERE select_id BETWEEN 0 AND 1);
+SELECT values_id FROM t1 
+WHERE values_id IN (SELECT values_id FROM t2
+                    WHERE select_id = 0 OR select_id = 1);
+
+DROP TABLE t1, t2;
Thread
bk commit into 5.0 tree (igor:1.1986) BUG#11487igor23 Jun