List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:January 20 2011 11:47am
Subject:bzr commit into mysql-trunk branch (mattias.jonsson:3532) Bug#59503
View as plain text  
#At file:///C:/mysql-bzr/b59503-trunk/ based on revid:anders.song@stripped

 3532 Mattias Jonsson	2011-01-20
      bug#59503: explain extended crash in get_mm_leaf
      
      The problem was during partitioning pruning, which does not
      use any real indexes (instead uses the partitioning function)
      so one must check if real indexes is in use before trying to
      use them.

    modified:
      mysql-test/r/partition.result
      mysql-test/t/partition.test
      sql/opt_range.cc
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2011-01-10 16:37:47 +0000
+++ b/mysql-test/r/partition.result	2011-01-20 11:47:35 +0000
@@ -1,5 +1,18 @@
 drop table if exists t1, t2;
 #
+# Bug#59503: explain extended crash in get_mm_leaf
+#
+CREATE TABLE t1 (a VARCHAR(51) CHARACTER SET latin1)
+ENGINE=MyISAM
+PARTITION BY KEY (a) PARTITIONS 1;
+INSERT INTO t1 VALUES ('a'),('b'),('c');
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a > 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	100.00	Using where
+Warnings:
+Note	1003	select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 1)
+DROP TABLE t1;
+#
 # Bug#57778: failed primary key add to partitioned innodb table
 #            inconsistent and crashes
 #

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2011-01-10 16:37:47 +0000
+++ b/mysql-test/t/partition.test	2011-01-20 11:47:35 +0000
@@ -15,6 +15,16 @@ drop table if exists t1, t2;
 --enable_warnings
 
 --echo #
+--echo # Bug#59503: explain extended crash in get_mm_leaf
+--echo #
+CREATE TABLE t1 (a VARCHAR(51) CHARACTER SET latin1)
+ENGINE=MyISAM
+PARTITION BY KEY (a) PARTITIONS 1;
+INSERT INTO t1 VALUES ('a'),('b'),('c');
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a > 1;
+DROP TABLE t1;
+
+--echo #
 --echo # Bug#57778: failed primary key add to partitioned innodb table
 --echo #            inconsistent and crashes
 --echo #

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2010-12-29 00:38:59 +0000
+++ b/sql/opt_range.cc	2011-01-20 11:47:35 +0000
@@ -5774,7 +5774,8 @@ get_mm_leaf(RANGE_OPT_PARAM *param, Item
       !(conf_func->compare_collation()->state & MY_CS_BINSORT &&
         (type == Item_func::EQUAL_FUNC || type == Item_func::EQ_FUNC)))
   {
-    if (param->thd->lex->describe & DESCRIBE_EXTENDED)
+    if (param->using_real_indexes &&
+		param->thd->lex->describe & DESCRIBE_EXTENDED)
       push_warning_printf(
               param->thd,
               MYSQL_ERROR::WARN_LEVEL_WARN, 
@@ -5906,7 +5907,8 @@ get_mm_leaf(RANGE_OPT_PARAM *param, Item
       value->result_type() != STRING_RESULT &&
       field->cmp_type() != value->result_type())
   {
-    if (param->thd->lex->describe & DESCRIBE_EXTENDED)
+	  if (param->using_real_indexes &&
+		  param->thd->lex->describe & DESCRIBE_EXTENDED)
       push_warning_printf(
               param->thd,
               MYSQL_ERROR::WARN_LEVEL_WARN, 


Attachment: [text/bzr-bundle] bzr/mattias.jonsson@oracle.com-20110120114735-b3oc6ez97ew2ft3l.bundle
Thread
bzr commit into mysql-trunk branch (mattias.jonsson:3532) Bug#59503Mattias Jonsson20 Jan
  • Re: bzr commit into mysql-trunk branch (mattias.jonsson:3532) Bug#59503Jorgen Loland20 Jan