List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:March 4 2011 9:35am
Subject:bzr push into mysql-trunk branch (mattias.jonsson:3722 to 3723)
View as plain text  
 3723 Mattias Jonsson	2011-03-03 [merge]
      merge

    modified:
      mysql-test/r/partition.result
      mysql-test/t/partition.test
      sql/opt_range.cc
 3722 Alexander Barkov	2011-03-03 [merge]
      merge from mysql-5.5

=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2011-03-01 14:47:01 +0000
+++ b/mysql-test/r/partition.result	2011-03-03 22:26:19 +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-03-01 14:47:01 +0000
+++ b/mysql-test/t/partition.test	2011-03-03 22:26:19 +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	2011-02-02 22:02:29 +0000
+++ b/sql/opt_range.cc	2011-03-03 22:26:19 +0000
@@ -692,7 +692,8 @@ public:
   /* 
     If true, the index descriptions describe real indexes (and it is ok to
     call field->optimize_range(real_keynr[...], ...).
-    Otherwise index description describes fake indexes.
+    Otherwise index description describes fake indexes, like a partitioning
+    expression.
   */
   bool using_real_indexes;
   
@@ -5780,7 +5781,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, 
@@ -5912,7 +5914,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, 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mattias.jonsson:3722 to 3723) Mattias Jonsson4 Mar