List:Commits« Previous MessageNext Message »
From:igor Date:January 13 2007 7:49pm
Subject:bk commit into 4.1 tree (igor:1.2597) BUG#24776
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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@stripped, 2007-01-13 10:49:26-08:00, igor@stripped +3 -0
  Fixed bug #24776: an assertion abort in handler::ha_index_init
  for queries using 'range checked for each record'.
  The problem was fixed in 5.0 by the patch for bug 12291.
  This patch down-ported the corresponding code from 5.0 into 
  QUICK_SELECT::init() and added a new test case. 

  mysql-test/r/range.result@stripped, 2007-01-13 10:49:24-08:00, igor@stripped +43 -0
    Added a test case for bug #24776.

  mysql-test/t/range.test@stripped, 2007-01-13 10:49:24-08:00, igor@stripped +43 -0
    Added a test case for bug #24776.

  sql/opt_range.h@stripped, 2007-01-13 10:49:24-08:00, igor@stripped +2 -0
    Fixed bug #24776: an assertion abort in handler::ha_index_init
    for queries using 'range checked for each record'.
    The problem was fixed in 5.0 by the patch for bug 12291.
    The patch for 4.1 down-ported the corresponding code from 5.0 into 
    QUICK_SELECT::init(). 

# 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:	olga.mysql.com
# Root:	/home/igor/dev-opt/mysql-4.1-opt-bug24776

--- 1.43/sql/opt_range.h	2007-01-13 10:49:30 -08:00
+++ 1.44/sql/opt_range.h	2007-01-13 10:49:30 -08:00
@@ -90,6 +90,8 @@
   int init()
   {
     key_part_info= head->key_info[index].key_part;
+    if (file->inited != handler::NONE)
+      file->ha_index_or_rnd_end();
     return error=file->ha_index_init(index);
   }
   virtual int get_next();

--- 1.36/mysql-test/r/range.result	2007-01-13 10:49:30 -08:00
+++ 1.37/mysql-test/r/range.result	2007-01-13 10:49:30 -08:00
@@ -658,4 +658,47 @@
 a
 xx
 drop table t1;
+CREATE TABLE t1 (
+OXID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+OXPARENTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT 'oxrootid',
+OXLEFT int NOT NULL DEFAULT '0',
+OXRIGHT int NOT NULL DEFAULT '0',
+OXROOTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+PRIMARY KEY  (OXID),
+KEY OXNID (OXID),
+KEY OXLEFT (OXLEFT),
+KEY OXRIGHT (OXRIGHT),
+KEY OXROOTID (OXROOTID)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
+INSERT INTO t1 VALUES
+('d8c4177d09f8b11f5.52725521','oxrootid',1,40,'d8c4177d09f8b11f5.52725521'),
+('d8c4177d151affab2.81582770','d8c4177d09f8b11f5.52725521',2,3,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d206a333d2.74422679','d8c4177d09f8b11f5.52725521',4,5,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d225791924.30714720','d8c4177d09f8b11f5.52725521',6,7,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d2380fc201.39666693','d8c4177d09f8b11f5.52725521',8,9,
+'d8c4177d09f8b11f5.52725521'),
+('d8c4177d24ccef970.14957924','d8c4177d09f8b11f5.52725521',10,11,
+'d8c4177d09f8b11f5.52725521');
+EXPLAIN
+SELECT s.oxid FROM t1 v, t1 s 
+WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	v	ref	OXLEFT,OXRIGHT,OXROOTID	OXROOTID	32	const	5	Using where
+1	SIMPLE	s	ALL	OXLEFT	NULL	NULL	NULL	5	Range checked for each record (index map: 0x4)
+SELECT s.oxid FROM t1 v, t1 s 
+WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+oxid
+d8c4177d151affab2.81582770
+d8c4177d206a333d2.74422679
+d8c4177d225791924.30714720
+d8c4177d2380fc201.39666693
+d8c4177d24ccef970.14957924
+DROP TABLE t1;
 End of 4.1 tests

--- 1.32/mysql-test/t/range.test	2007-01-13 10:49:30 -08:00
+++ 1.33/mysql-test/t/range.test	2007-01-13 10:49:30 -08:00
@@ -520,4 +520,47 @@
 select a from t1 where a > 'x';
 drop table t1;
 
+#
+# Bug #24776: assertion abort for 'range checked for each record' 
+#
+
+CREATE TABLE t1 (
+  OXID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+  OXPARENTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT 'oxrootid',
+  OXLEFT int NOT NULL DEFAULT '0',
+  OXRIGHT int NOT NULL DEFAULT '0',
+  OXROOTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
+  PRIMARY KEY  (OXID),
+  KEY OXNID (OXID),
+  KEY OXLEFT (OXLEFT),
+  KEY OXRIGHT (OXRIGHT),
+  KEY OXROOTID (OXROOTID)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
+
+INSERT INTO t1 VALUES
+('d8c4177d09f8b11f5.52725521','oxrootid',1,40,'d8c4177d09f8b11f5.52725521'),
+('d8c4177d151affab2.81582770','d8c4177d09f8b11f5.52725521',2,3,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d206a333d2.74422679','d8c4177d09f8b11f5.52725521',4,5,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d225791924.30714720','d8c4177d09f8b11f5.52725521',6,7,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d2380fc201.39666693','d8c4177d09f8b11f5.52725521',8,9,
+ 'd8c4177d09f8b11f5.52725521'),
+('d8c4177d24ccef970.14957924','d8c4177d09f8b11f5.52725521',10,11,
+ 'd8c4177d09f8b11f5.52725521');
+
+EXPLAIN
+SELECT s.oxid FROM t1 v, t1 s 
+  WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+        v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+        s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+
+SELECT s.oxid FROM t1 v, t1 s 
+  WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
+        v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
+        s.oxleft > v.oxleft AND s.oxleft < v.oxright;
+
+DROP TABLE t1;
+
 --echo End of 4.1 tests
Thread
bk commit into 4.1 tree (igor:1.2597) BUG#24776igor13 Jan