Skip to content
Permalink
Browse files
cleanup: generate_partition_syntax()
Don't write to a temporary file, use String.
Remove strange one-liner "helpers", use String methods.
Don't use current_thd, don't allocate memory for 1-byte strings, etc.
  • Loading branch information
vuvova committed Jul 5, 2017
1 parent 03c52e9 commit 504eff0
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 451 deletions.
@@ -9053,8 +9053,6 @@ int ha_partition::check_for_upgrade(HA_CHECK_OPT *check_opt)
!(part_buf= generate_partition_syntax(thd, m_part_info,
&part_buf_len,
true,
true,
NULL,
NULL,
NULL)) ||
print_admin_msg(thd, SQL_ADMIN_MSG_TEXT_SIZE + 1, "error",
@@ -21,13 +21,6 @@
#include "sql_partition.h" /* part_id_range, partition_element */
#include "queues.h" /* QUEUE */

enum partition_keywords
{
PKW_HASH= 0, PKW_RANGE, PKW_LIST, PKW_KEY, PKW_MAXVALUE, PKW_LINEAR,
PKW_COLUMNS, PKW_ALGORITHM
};


#define PARTITION_BYTES_IN_POS 2


@@ -394,9 +394,9 @@ bool partition_info::set_up_default_partitions(THD *thd, handler *file,
{
const char *error_string;
if (part_type == RANGE_PARTITION)
error_string= partition_keywords[PKW_RANGE].str;
error_string= "RANGE";
else
error_string= partition_keywords[PKW_LIST].str;
error_string= "LIST";
my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), error_string);
goto end;
}

0 comments on commit 504eff0

Please sign in to comment.