Commit 3fb22596 authored by Aleksey Midenkov's avatar Aleksey Midenkov

is_partition(), is_temporary_name() fix

Return true for temporary partitions.
parent 79459c7e
......@@ -262,15 +262,14 @@ void set_my_errno(int err)
/** Checks whether the file name belongs to a partition of a table.
@param[in] file_name file name
@return pointer to the end of the table name part of the file name, or NULL */
static
char*
is_partition(
/*=========*/
char* file_name)
const char* file_name)
{
/* We look for pattern #P# to see if the table is partitioned
MariaDB table. */
return strstr(file_name, table_name_t::part_suffix);
return strstr(const_cast<char *>(file_name), table_name_t::part_suffix);
}
......
......@@ -1816,6 +1816,9 @@ typedef enum {
DICT_FRM_INCONSISTENT_KEYS = 3 /*!< Key count mismatch */
} dict_frm_t;
char*
is_partition(const char *file_name);
/** Data structure for a database table. Most fields will be
zero-initialized in dict_table_t::create(). */
struct dict_table_t {
......@@ -1867,7 +1870,9 @@ struct dict_table_t {
which denotes temporary or intermediate tables in MariaDB. */
static bool is_temporary_name(const char* name)
{
return strstr(name, "/#sql");
return strstr(name, "/#sql") || (
is_partition(name) &&
0 == memcmp(name + strlen(name) - 5, "#TMP#", 5));
}
/** @return whether instant ALTER TABLE is in effect */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment