MySQL 8.4.3
Source Code Documentation
partition_info.cc File Reference
#include "sql/partition_info.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "lex_string.h"
#include "map_helpers.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_sqlcommand.h"
#include "my_sys.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/plugin.h"
#include "mysql/strings/int2str.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/udf_registration_types.h"
#include "mysqld_error.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/create_field.h"
#include "sql/derror.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/partitioning/partition_handler.h"
#include "sql/set_var.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"
#include "sql/sql_parse.h"
#include "sql/sql_partition.h"
#include "sql/sql_tablespace.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/table_trigger_dispatcher.h"
#include "sql/thr_malloc.h"
#include "sql/trigger_chain.h"
#include "sql/trigger_def.h"
#include "sql_string.h"
#include "string_with_len.h"

Macros

#define MAX_PART_NAME_SIZE   8
 

Functions

static bool check_engine_condition (partition_element *p_elem, bool table_engine_set, handlerton **engine_type, bool *first)
 
static int partition_info_compare_column_values (const part_column_list_val *first, const part_column_list_val *second)
 
static void warn_if_dir_in_part_elem (THD *thd, partition_element *part_elem)
 Check if we allow DATA/INDEX DIRECTORY, if not warn and set them to NULL. More...
 
bool check_partition_dirs (partition_info *part_info)
 
static bool strcmp_null (const char *a, const char *b)
 helper function to compare strings that can also be a NULL pointer. More...
 
static bool has_same_column_order (List< Create_field > *create_list, Field **field_array)
 
bool has_external_data_or_index_dir (partition_info &pi)
 Predicate which returns true if any partition or subpartition uses an external data directory or external index directory. More...
 
bool fill_partition_tablespace_names (partition_info *part_info, Tablespace_hash_set *tablespace_set)
 Fill the Tablespace_hash_set with the tablespace names used by the partitions on the table. More...
 
bool validate_partition_tablespace_name_lengths (partition_info *part_info)
 Check if all tablespace names specified for partitions have a valid length. More...
 
bool validate_partition_tablespace_names (partition_info *part_info, const handlerton *default_engine)
 Check if all tablespace names specified for partitions are valid. More...
 

Macro Definition Documentation

◆ MAX_PART_NAME_SIZE

#define MAX_PART_NAME_SIZE   8

Function Documentation

◆ check_engine_condition()

static bool check_engine_condition ( partition_element p_elem,
bool  table_engine_set,
handlerton **  engine_type,
bool *  first 
)
static

◆ check_partition_dirs()

bool check_partition_dirs ( partition_info part_info)

◆ fill_partition_tablespace_names()

bool fill_partition_tablespace_names ( partition_info part_info,
Tablespace_hash_set tablespace_set 
)

Fill the Tablespace_hash_set with the tablespace names used by the partitions on the table.

Parameters
part_info- Partition info that could be using tablespaces.
tablespace_set- (OUT) Tablespace_hash_set where tablespace names are collected.
Returns
true - On failure.
false - On success.

◆ has_external_data_or_index_dir()

bool has_external_data_or_index_dir ( partition_info pi)

Predicate which returns true if any partition or subpartition uses an external data directory or external index directory.

Parameters
pipartitioning information
Return values
trueif any partition or subpartition has an external data directory or external index directory.
falseotherwise

◆ has_same_column_order()

static bool has_same_column_order ( List< Create_field > *  create_list,
Field **  field_array 
)
static

◆ partition_info_compare_column_values()

static int partition_info_compare_column_values ( const part_column_list_val first,
const part_column_list_val second 
)
static

◆ strcmp_null()

static bool strcmp_null ( const char *  a,
const char *  b 
)
static

helper function to compare strings that can also be a NULL pointer.

Parameters
achar pointer (can be NULL).
bchar pointer (can be NULL).
Returns
false if equal
Return values
truestrings differs
falsestrings is equal

◆ validate_partition_tablespace_name_lengths()

bool validate_partition_tablespace_name_lengths ( partition_info part_info)

Check if all tablespace names specified for partitions have a valid length.

Parameters
part_infoPartition info that could be using tablespaces.
Returns
true One of the tablespace names specified has invalid length and an error is reported.
false All the tablespace names specified for partitions have a valid length.

◆ validate_partition_tablespace_names()

bool validate_partition_tablespace_names ( partition_info part_info,
const handlerton default_engine 
)

Check if all tablespace names specified for partitions are valid.

Do the validation by invoking the SE specific validation function.

Parameters
part_infoPartition info that could be using tablespaces.
default_engineTable level engine.
Returns
true One of the tablespace names specified is invalid and an error is reported.
false All the tablespace names specified for partitions are valid.

◆ warn_if_dir_in_part_elem()

static void warn_if_dir_in_part_elem ( THD thd,
partition_element part_elem 
)
static

Check if we allow DATA/INDEX DIRECTORY, if not warn and set them to NULL.

Parameters
thdTHD also containing sql_mode (looks from MODE_NO_DIR_IN_CREATE).
part_elempartition_element to check.