1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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]


mysql-test/r/partition_pruning.result:
  BUG#19684: Testcase
mysql-test/t/partition_pruning.test:
  BUG#19684: Testcase
sql/sql_select.cc:
  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.
This commit is contained in:
unknown
2006-06-05 15:15:28 +04:00
parent 6ccab8d4de
commit 027d90bc58
3 changed files with 42 additions and 5 deletions

View File

@ -13844,6 +13844,10 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
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 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
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);