1 #ifndef SQL_PARTITION_INCLUDED
2 #define SQL_PARTITION_INCLUDED
36 #define HA_CAN_PARTITION (1 << 0)
37 #define HA_CAN_UPDATE_PARTITION_KEY (1 << 1)
38 #define HA_CAN_PARTITION_UNIQUE (1 << 2)
40 #define HA_USE_AUTO_PARTITION (1 << 3)
42 #define NORMAL_PART_NAME 0
43 #define TEMP_PART_NAME 1
44 #define RENAMED_PART_NAME 2
57 const char *table_name;
76 #define NOT_A_PARTITION_ID UINT_MAX32
78 bool is_partition_in_list(
char *part_name,
List<char> list_part_names);
82 int get_parts_for_update(
const uchar *old_data, uchar *new_data,
84 uint32 *old_part_id, uint32 *new_part_id,
85 longlong *func_value);
86 int get_part_for_delete(
const uchar *
buf,
const uchar *rec0,
91 void set_linear_hash_mask(
partition_info *part_info, uint num_parts);
92 bool fix_partition_func(THD *thd,
TABLE *
table,
bool create_table_ind);
97 uint get_partition_field_store_length(
Field *field);
98 int get_cs_converted_part_value_from_string(THD *thd,
104 void get_full_part_id_from_key(
const TABLE *
table, uchar *
buf,
108 bool mysql_unpack_partition(THD *thd,
char *part_buf,
112 bool *work_part_info_used);
117 bool include_endpoint);
118 uint32 get_partition_id_range_for_endpoint(
partition_info *part_info,
120 bool include_endpoint);
121 bool check_part_func_fields(
Field **ptr,
bool ok_with_charsets);
122 bool field_is_partition_charset(
Field *field);
124 void mem_alloc_error(
size_t size);
125 void truncate_partition_filename(
char *path);
168 partition_iter_func get_next;
173 bool ret_null_part, ret_null_part_orig;
235 typedef int (*get_partitions_in_range_iter)(
partition_info *part_info,
237 uint32 *store_length_array,
238 uchar *min_val, uchar *max_val,
239 uint min_len, uint max_len,
243 #include "partition_info.h"
245 #ifdef WITH_PARTITION_STORAGE_ENGINE
246 uint fast_alter_partition_table(THD *thd,
TABLE *
table,
253 enum partition_state part_state);
257 bool *partition_changed,
258 bool *fast_alter_table);
260 uint *buf_length,
bool use_sql_alloc,
261 bool show_partition_options,
264 const char *current_comment_start);
271 void create_partition_name(
char *out,
const char *in1,
272 const char *in2, uint name_variant,
274 void create_subpartition_name(
char *out,
const char *in1,
275 const char *in2,
const char *in3,
278 void set_field_ptr(
Field **ptr,
const uchar *new_buf,
const uchar *old_buf);
279 void set_key_field_ptr(
KEY *key_info,
const uchar *new_buf,
280 const uchar *old_buf);