#include <stddef.h>
#include <sys/types.h>
#include "my_bitmap.h"
#include "my_inttypes.h"
#include "sql/lock.h"
#include "sql/partition_element.h"
#include "sql/sql_bitmap.h"
#include "sql/sql_data_change.h"
#include "sql/sql_list.h"
Go to the source code of this file.
|
typedef uint32(* | partition_iter_func) (PARTITION_ITERATOR *part_iter) |
| A "Get next" function for partition iterator. More...
|
|
typedef int(* | get_part_id_func) (partition_info *part_info, uint32 *part_id, longlong *func_value) |
|
typedef int(* | get_subpart_id_func) (partition_info *part_info, uint32 *part_id) |
|
typedef int(* | get_partitions_in_range_iter) (partition_info *part_info, bool is_subpart, uint32 *store_length_array, uchar *min_val, uchar *max_val, uint min_len, uint max_len, uint flags, PARTITION_ITERATOR *part_iter) |
| Get an iterator for set of partitions that match given field-space interval. More...
|
|
◆ NOT_A_PARTITION_ID
◆ get_part_id_func
◆ get_partitions_in_range_iter
Get an iterator for set of partitions that match given field-space interval.
Functions with this signature are used to perform "Partitioning Interval
Analysis". This analysis is applicable for any type of [sub]partitioning by some function of a single fieldX. The idea is as follows: Given an interval "const1 <=? fieldX <=? const2", find a set of partitions that may contain records with value of fieldX within the given interval.
The min_val, max_val and flags parameters specify the interval. The set of partitions is returned by initializing an iterator in *part_iter
- Note
- There are currently three functions of this type:
- get_part_iter_for_interval_via_walking
- get_part_iter_for_interval_cols_via_map
- get_part_iter_for_interval_via_mapping
- Parameters
-
part_info | Partitioning info |
is_subpart | When true, act for sub partitions. When false, act for partitions. |
store_length_array | Length of fields packed in opt_range_key format |
min_val | Left edge, field value in opt_range_key format |
max_val | Right edge, field value in opt_range_key format |
min_len | Length of minimum value |
max_len | Length of maximum value |
flags | Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE, NO_MAX_RANGE |
part_iter | Iterator structure to be initialized |
- Returns
- Operation status
- Return values
-
0 | No matching partitions, iterator not initialized |
1 | Some partitions would match, iterator initialized for traversing them |
-1 | All partitions would match, iterator not initialized |
◆ get_subpart_id_func
◆ partition_iter_func
A "Get next" function for partition iterator.
Depending on whether partitions or sub-partitions are iterated, the function returns next subpartition id/partition number. The sequence of returned numbers is not ordered and may contain duplicates.
When the end of sequence is reached, NOT_A_PARTITION_ID is returned, and the iterator resets itself (so next get_next() call will start to enumerate the set all over again).
- Parameters
-
[in,out] | part_iter | Partition iterator, you call only "iter.get_next(&iter)" |
- Returns
- Partition id
- Return values
-
NOT_A_PARTITION_ID | if there are no more partitions. |
[sub]partition_id | of the next partition |
◆ enum_key_algorithm
PARTITION BY KEY ALGORITHM=N Which algorithm to use for hashing the fields.
N = 1 - Use 5.1 hashing (numeric fields are hashed as binary) N = 2 - Use 5.5 hashing (numeric fields are hashed like latin1 bytes)
Enumerator |
---|
KEY_ALGORITHM_NONE | |
KEY_ALGORITHM_51 | |
KEY_ALGORITHM_55 | |
◆ check_partition_dirs()
◆ fill_partition_tablespace_names()
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.
◆ get_next_partition_id_range()
◆ has_external_data_or_index_dir()
Predicate which returns true if any partition or subpartition uses an external data directory or external index directory.
- Parameters
-
pi | partitioning information |
- Return values
-
true | if any partition or subpartition has an external data directory or external index directory. |
false | otherwise |
◆ init_all_partitions_iterator()
◆ init_single_partition_iterator()
◆ 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_info | Partition 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()
Check if all tablespace names specified for partitions are valid.
Do the validation by invoking the SE specific validation function.
- Parameters
-
part_info | Partition info that could be using tablespaces. |
default_engine | Table 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.