diff options
author | Mikael Ronstrom <mikael@mysql.com> | 2009-10-22 16:15:06 +0200 |
---|---|---|
committer | Mikael Ronstrom <mikael@mysql.com> | 2009-10-22 16:15:06 +0200 |
commit | 6f27ad15b208091d3904bb4f73ffab2871f99581 (patch) | |
tree | 0bcd1e2792ff22088f2d5faa233170a48ebeb79a /sql/sql_show.cc | |
parent | f3f4e41c3704b6a82942de5fd6c918319e0e4bb2 (diff) | |
download | mariadb-git-6f27ad15b208091d3904bb4f73ffab2871f99581.tar.gz |
A lot of fixes to make character set work ok, first step to fixing BUG#48163
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a74e9363bcf..57ab04b5576 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1465,7 +1465,8 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, ((part_syntax= generate_partition_syntax(table->part_info, &part_syntax_len, FALSE, - show_table_options)))) + show_table_options, + NULL, NULL)))) { packet->append(STRING_WITH_LEN("\n/*!50100")); packet->append(part_syntax, part_syntax_len); @@ -4847,16 +4848,23 @@ get_partition_column_description(partition_info *part_info, { char buffer[MAX_STR_SIZE_PF]; String str(buffer, sizeof(buffer), &my_charset_bin); - String *res= col_val->item_expression->val_str(&str); + Item *item= col_val->item_expression; + + if (!(item= part_info->get_column_item(item, + part_info->part_field_array[i]))) + { + DBUG_RETURN(1); + } + String *res= item->val_str(&str); if (!res) { my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); DBUG_RETURN(1); } - if (col_val->item_expression->result_type() == STRING_RESULT) + if (item->result_type() == STRING_RESULT) tmp_str.append("'"); tmp_str.append(*res); - if (col_val->item_expression->result_type() == STRING_RESULT) + if (item->result_type() == STRING_RESULT) tmp_str.append("'"); } if (i != num_elements - 1) |