List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:June 5 2006 11:15am
Subject:bk commit into 5.1 tree (sergefp:1.2183) BUG#19684
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of psergey. When psergey 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.2183 06/06/05 15:15:28 sergefp@stripped +3 -0
  BUG#19684: Garbage in 'partitions' column in EXPLAIN output:
  In select_describe(), make the String object that holds the value of 
  "partitions" column to "own" the value buffer, so the buffer isn't
  prematurely freed.
  [this is the second attempt with review fixes]

  sql/sql_select.cc
    1.410 06/06/05 15:15:22 sergefp@stripped +7 -5
    BUG#19684: Garbage in 'partitions' column in EXPLAIN output:
    - Added comment
    - Make the String object that holds the value of "partitions" column
      to "own" the value buffer, so the buffer isn't prematurely freed.

  mysql-test/t/partition_pruning.test
    1.14 06/06/05 15:15:22 sergefp@stripped +16 -0
    BUG#19684: Testcase

  mysql-test/r/partition_pruning.result
    1.16 06/06/05 15:15:22 sergefp@stripped +19 -0
    BUG#19684: Testcase

# 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:	sergefp
# Host:	newbox.mylan
# Root:	/home/psergey/mysql-5.1-bug19684

--- 1.409/sql/sql_select.cc	2006-06-03 00:22:51 +04:00
+++ 1.410/sql/sql_select.cc	2006-06-05 15:15:22 +04:00
@@ -13844,6 +13844,10 @@
   thd->server_status&= ~(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED);
   join->unit->offset_limit_cnt= 0;
 
+  /* 
+    NOTE: the number/types of items pushed into item_list must be in sync with
+    EXPLAIN column types as they're "defined" in THD::send_explain_fields()
+  */
   if (message)
   {
     item_list.push_back(new Item_int((int32)
@@ -13983,11 +13987,9 @@
         if (!table->derived_select_number && 
             (part_info= table->part_info))
         {          
-          char parts_buff[128]; 
-          String parts_str(parts_buff,sizeof(parts_buff),cs);
-          make_used_partitions_str(part_info, &parts_str);
-          item_list.push_back(new Item_string(parts_str.ptr(),
-                                              parts_str.length(), cs));
+          Item_string *item_str= new Item_string(cs);
+          make_used_partitions_str(part_info, &item_str->str_value);
+          item_list.push_back(item_str);
         }
         else
           item_list.push_back(item_null);

--- 1.15/mysql-test/r/partition_pruning.result	2006-06-04 17:17:31 +04:00
+++ 1.16/mysql-test/r/partition_pruning.result	2006-06-05 15:15:22 +04:00
@@ -678,3 +678,22 @@
 id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	p0	ALL	NULL	NULL	NULL	NULL	3	Using where
 drop table t1;
+create table t2 (a int, b int)
+partition by LIST(a)
+subpartition by HASH(b) subpartitions 40
+( partition p_0_long_partition_name values in(1),
+partition p_1_long_partition_name values in(2));
+insert into t2 values (1,1),(2,2);
+explain partitions select * from t2;
+id	1
+select_type	SIMPLE
+table	t2
+partitions	p_0_long_partition_name_p_0_long_partition_namesp0,p_0_long_partition_name_p_0_long_partition_namesp1,p_0_long_partition_name_p_0_long_partition_namesp2,p_0_long_partition_name_p_0_long_partition_namesp3,p_0_long_partition_name_p_0_long_partition_namesp4,p_0_long_partition_name_p_0_long_partition_namesp5,p_0_long_partition_name_p_0_long_partition_namesp6,p_0_long_partition_name_p_0_long_partition_namesp7,p_0_long_partition_name_p_0_long_partition_namesp8,p_0_long_partition_name_p_0_long_partition_namesp9,p_0_long_partition_name_p_0_long_partition_namesp10,p_0_long_partition_name_p_0_long_partition_namesp11,p_0_long_partition_name_p_0_long_partition_namesp12,p_0_long_partition_name_p_0_long_partition_namesp13,p_0_long_partition_name_p_0_long_partition_namesp14,p_0_long_partition_name_p_0_long_partition_namesp15,p_0_long_partition_name_p_0_long_partition_namesp16,p_0_long_partition_name_p_0_long_partition_namesp17,p_0_long_partition_name_p_0_long_partition_namesp18,
 p_0_long_partition_name_p_0_long_partition_namesp19,p_0_long_partition_name_p_0_long_partition_namesp20,p_0_long_partition_name_p_0_long_partition_namesp21,p_0_long_partition_name_p_0_long_partition_namesp22,p_0_long_partition_name_p_0_long_partition_namesp23,p_0_long_partition_name_p_0_long_partition_namesp24,p_0_long_partition_name_p_0_long_partition_namesp25,p_0_long_partition_name_p_0_long_partition_namesp26,p_0_long_partition_name_p_0_long_partition_namesp27,p_0_long_partition_name_p_0_long_partition_namesp28,p_0_long_partition_name_p_0_long_partition_namesp29,p_0_long_partition_name_p_0_long_partition_namesp30,p_0_long_partition_name_p_0_long_partition_namesp31,p_0_long_partition_name_p_0_long_partition_namesp32,p_0_long_partition_name_p_0_long_partition_namesp33,p_0_long_partition_name_p_0_long_partition_namesp34,p_0_long_partition_name_p_0_long_partition_namesp35,p_0_long_partition_name_p_0_long_partition_namesp36,p_0_long_partition_name_p_0_long_partition_namesp37,p
 _0_long_partition_name_p_0_long_partition_namesp38,p_0_long_partition_name_p_0_long_partition_namesp39,p_1_long_partition_name_p_1_long_partition_namesp0,p_1_long_partition_name_p_1_long_partition_namesp1,p_1_long_partition_name_p_1_long_partition_namesp2,p_1_long_partition_name_p_1_long_partition_namesp3,p_1_long_partition_name_p_1_long_partition_namesp4,p_1_long_partition_name_p_1_long_partition_namesp5,p_1_long_partition_name_p_1_long_partition_namesp6,p_1_long_partition_name_p_1_long_partition_namesp7,p_1_long_partition_name_p_1_long_partition_namesp8,p_1_long_partition_name_p_1_long_partition_namesp9,p_1_long_partition_name_p_1_long_partition_namesp10,p_1_long_partition_name_p_1_long_partition_namesp11,p_1_long_partition_name_p_1_long_partition_namesp12,p_1_long_partition_name_p_1_long_partition_namesp13,p_1_long_partition_name_p_1_long_partition_namesp14,p_1_long_partition_name_p_1_long_partition_namesp15,p_1_long_partition_name_p_1_long_partition_namesp16,p_1_long_par
 tition_name_p_1_long_partition_namesp17,p_1_long_partition_name_p_1_long_partition_namesp18,p_1_long_partition_name_p_1_long_partition_namesp19,p_1_long_partition_name_p_1_long_partition_namesp20,p_1_long_partition_name_p_1_long_partition_namesp21,p_1_long_partition_name_p_1_long_partition_namesp22,p_1_long_partition_name_p_1_long_partition_namesp23,p_1_long_partition_name_p_1_long_partition_namesp24,p_1_long_partition_name_p_1_long_partition_namesp25,p_1_long_partition_name_p_1_long_partition_namesp26,p_1_long_partition_name_p_1_long_partition_namesp27,p_1_long_partition_name_p_1_long_partition_namesp28,p_1_long_partition_name_p_1_long_partition_namesp29,p_1_long_partition_name_p_1_long_partition_namesp30,p_1_long_partition_name_p_1_long_partition_namesp31,p_1_long_partition_name_p_1_long_partition_namesp32,p_1_long_partition_name_p_1_long_partition_namesp33,p_1_long_partition_name_p_1_long_partition_namesp34,p_1_long_partition_name_p_1_long_partition_namesp35,p_1_long_part
 ition_name_p_1_long_partition_namesp36,p_1_long_partition_name_p_1_long_partition_namesp37,p_1_long_partition_name_p_1_long_partition_namesp38,p_1_long_partition_name_p_1_long_partition_namesp39
+type	ALL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	2
+Extra	
+drop table t2;

--- 1.13/mysql-test/t/partition_pruning.test	2006-06-04 17:17:32 +04:00
+++ 1.14/mysql-test/t/partition_pruning.test	2006-06-05 15:15:22 +04:00
@@ -574,3 +574,19 @@
 explain partitions select * from t1 where s1 = 0 or s1 is null;
 drop table t1;
 
+#
+# BUG#19684: EXPLAIN PARTITIONS produces garbage in 'partitions' column when
+# the length of string to be displayed exceeds some limit.
+create table t2 (a int, b int)
+  partition by LIST(a)
+  subpartition by HASH(b) subpartitions 40
+( partition p_0_long_partition_name values in(1),
+  partition p_1_long_partition_name values in(2));
+
+insert into t2 values (1,1),(2,2);
+
+--vertical_results
+explain partitions select * from t2;
+--horizontal_results
+drop table t2;
+
Thread
bk commit into 5.1 tree (sergefp:1.2183) BUG#19684Sergey Petrunia5 Jun