golden hour
/usr/include/mysql/server/private
⬆️ Go Up
Upload
File/Folder
Size
Actions
aria_backup.h
1.51 KB
Del
OK
assume_aligned.h
2.29 KB
Del
OK
atomic
-
Del
OK
authors.h
9.9 KB
Del
OK
backup.h
1.21 KB
Del
OK
bounded_queue.h
6.67 KB
Del
OK
client_settings.h
1.89 KB
Del
OK
compat56.h
2.23 KB
Del
OK
config.h
14.18 KB
Del
OK
contributors.h
4.76 KB
Del
OK
create_options.h
4.42 KB
Del
OK
custom_conf.h
1.06 KB
Del
OK
datadict.h
1.53 KB
Del
OK
debug_sync.h
2 KB
Del
OK
derived_handler.h
2.32 KB
Del
OK
derror.h
980 B
Del
OK
des_key_file.h
1.21 KB
Del
OK
discover.h
1.53 KB
Del
OK
dur_prop.h
1.06 KB
Del
OK
embedded_priv.h
1.62 KB
Del
OK
event_data_objects.h
4.09 KB
Del
OK
event_db_repository.h
3.56 KB
Del
OK
event_parse_data.h
2.83 KB
Del
OK
event_queue.h
3.36 KB
Del
OK
event_scheduler.h
3.21 KB
Del
OK
events.h
4.59 KB
Del
OK
field.h
211.96 KB
Del
OK
field_comp.h
1.15 KB
Del
OK
filesort.h
6.67 KB
Del
OK
filesort_utils.h
8 KB
Del
OK
ft_global.h
3.04 KB
Del
OK
gcalc_slicescan.h
16.87 KB
Del
OK
gcalc_tools.h
11.62 KB
Del
OK
grant.h
2.69 KB
Del
OK
group_by_handler.h
3.45 KB
Del
OK
gstream.h
2.38 KB
Del
OK
ha_partition.h
62.22 KB
Del
OK
ha_sequence.h
5.94 KB
Del
OK
handle_connections_win.h
884 B
Del
OK
handler.h
188.39 KB
Del
OK
hash.h
4.34 KB
Del
OK
hash_filo.h
5.55 KB
Del
OK
heap.h
9.2 KB
Del
OK
hostname.h
5.29 KB
Del
OK
ilist.h
6.85 KB
Del
OK
init.h
852 B
Del
OK
innodb_priv.h
1.29 KB
Del
OK
item.h
263.12 KB
Del
OK
item_cmpfunc.h
128.01 KB
Del
OK
item_create.h
11.22 KB
Del
OK
item_func.h
124.59 KB
Del
OK
item_geofunc.h
34.69 KB
Del
OK
item_jsonfunc.h
19.8 KB
Del
OK
item_row.h
5.43 KB
Del
OK
item_strfunc.h
64.55 KB
Del
OK
item_subselect.h
56.19 KB
Del
OK
item_sum.h
69.2 KB
Del
OK
item_timefunc.h
57.85 KB
Del
OK
item_vers.h
3.79 KB
Del
OK
item_windowfunc.h
32.61 KB
Del
OK
item_xmlfunc.h
4.36 KB
Del
OK
key.h
2 KB
Del
OK
keycaches.h
1.95 KB
Del
OK
lex.h
28.9 KB
Del
OK
lex_ident.h
2.07 KB
Del
OK
lex_string.h
3.97 KB
Del
OK
lex_symbol.h
1.29 KB
Del
OK
lf.h
6.31 KB
Del
OK
lock.h
2.15 KB
Del
OK
log.h
44.46 KB
Del
OK
log_event.h
178.94 KB
Del
OK
log_event_data_type.h
1.85 KB
Del
OK
log_event_old.h
19.32 KB
Del
OK
log_slow.h
1.98 KB
Del
OK
maria.h
5.73 KB
Del
OK
mariadb.h
1.25 KB
Del
OK
mdl.h
36.78 KB
Del
OK
mem_root_array.h
6.94 KB
Del
OK
message.h
1.17 KB
Del
OK
multi_range_read.h
22.58 KB
Del
OK
my_alarm.h
2.37 KB
Del
OK
my_apc.h
4.62 KB
Del
OK
my_atomic.h
7.11 KB
Del
OK
my_atomic_wrapper.h
2.92 KB
Del
OK
my_base.h
26.5 KB
Del
OK
my_bit.h
6.05 KB
Del
OK
my_bitmap.h
5.22 KB
Del
OK
my_check_opt.h
2.56 KB
Del
OK
my_compare.h
10.93 KB
Del
OK
my_context.h
6.59 KB
Del
OK
my_counter.h
1.68 KB
Del
OK
my_cpu.h
4.85 KB
Del
OK
my_crypt.h
904 B
Del
OK
my_decimal.h
13.43 KB
Del
OK
my_default.h
1.84 KB
Del
OK
my_handler_errors.h
4.74 KB
Del
OK
my_json_writer.h
17.9 KB
Del
OK
my_libwrap.h
1.16 KB
Del
OK
my_md5.h
1.45 KB
Del
OK
my_minidump.h
848 B
Del
OK
my_nosys.h
1.4 KB
Del
OK
my_rdtsc.h
8.15 KB
Del
OK
my_rnd.h
1.04 KB
Del
OK
my_service_manager.h
1.47 KB
Del
OK
my_stack_alloc.h
6.2 KB
Del
OK
my_stacktrace.h
3.14 KB
Del
OK
my_time.h
10.22 KB
Del
OK
my_tree.h
3.9 KB
Del
OK
my_uctype.h
67.9 KB
Del
OK
my_user.h
1.1 KB
Del
OK
myisam.h
17.11 KB
Del
OK
myisamchk.h
4.61 KB
Del
OK
myisammrg.h
4.78 KB
Del
OK
myisampack.h
14.58 KB
Del
OK
mysql_async.h
1.77 KB
Del
OK
mysqld.h
38.7 KB
Del
OK
mysqld_default_groups.h
204 B
Del
OK
mysqld_suffix.h
1.17 KB
Del
OK
mysys_err.h
2.95 KB
Del
OK
nt_servc.h
2.94 KB
Del
OK
opt_range.h
57.58 KB
Del
OK
opt_subselect.h
14.21 KB
Del
OK
opt_trace.h
8.11 KB
Del
OK
opt_trace_context.h
3.21 KB
Del
OK
parse_file.h
4.11 KB
Del
OK
partition_element.h
5.09 KB
Del
OK
partition_info.h
18.85 KB
Del
OK
password.h
1.14 KB
Del
OK
pfs_file_provider.h
3.08 KB
Del
OK
pfs_idle_provider.h
1.35 KB
Del
OK
pfs_memory_provider.h
1.59 KB
Del
OK
pfs_metadata_provider.h
1.85 KB
Del
OK
pfs_socket_provider.h
2.21 KB
Del
OK
pfs_stage_provider.h
1.52 KB
Del
OK
pfs_statement_provider.h
4.25 KB
Del
OK
pfs_table_provider.h
2.56 KB
Del
OK
pfs_thread_provider.h
5.43 KB
Del
OK
pfs_transaction_provider.h
2.78 KB
Del
OK
privilege.h
27.9 KB
Del
OK
probes_mysql.h
973 B
Del
OK
probes_mysql_dtrace.h
32.23 KB
Del
OK
probes_mysql_nodtrace.h
4.89 KB
Del
OK
procedure.h
6.57 KB
Del
OK
protocol.h
12.32 KB
Del
OK
proxy_protocol.h
548 B
Del
OK
queues.h
3.46 KB
Del
OK
records.h
3.03 KB
Del
OK
repl_failsafe.h
1.55 KB
Del
OK
replication.h
15.73 KB
Del
OK
rijndael.h
1.67 KB
Del
OK
rowid_filter.h
15.13 KB
Del
OK
rpl_constants.h
3.28 KB
Del
OK
rpl_filter.h
4.43 KB
Del
OK
rpl_gtid.h
13.31 KB
Del
OK
rpl_injector.h
9.43 KB
Del
OK
rpl_mi.h
13.65 KB
Del
OK
rpl_parallel.h
13.57 KB
Del
OK
rpl_record.h
1.55 KB
Del
OK
rpl_record_old.h
1.37 KB
Del
OK
rpl_reporting.h
2.96 KB
Del
OK
rpl_rli.h
31.8 KB
Del
OK
rpl_tblmap.h
3.1 KB
Del
OK
rpl_utility.h
9.4 KB
Del
OK
scheduler.h
2.99 KB
Del
OK
scope.h
1.76 KB
Del
OK
select_handler.h
2.18 KB
Del
OK
semisync.h
2.23 KB
Del
OK
semisync_master.h
22.7 KB
Del
OK
semisync_master_ack_receiver.h
5.73 KB
Del
OK
semisync_slave.h
3.47 KB
Del
OK
service_versions.h
2 KB
Del
OK
session_tracker.h
13.96 KB
Del
OK
set_var.h
16.1 KB
Del
OK
slave.h
11.99 KB
Del
OK
source_revision.h
67 B
Del
OK
sp.h
22.02 KB
Del
OK
sp_cache.h
2 KB
Del
OK
sp_head.h
63.05 KB
Del
OK
sp_pcontext.h
24.31 KB
Del
OK
sp_rcontext.h
14 KB
Del
OK
span.h
3.84 KB
Del
OK
spatial.h
21.82 KB
Del
OK
sql_acl.h
13.8 KB
Del
OK
sql_admin.h
2.78 KB
Del
OK
sql_alloc.h
1.83 KB
Del
OK
sql_alter.h
11.86 KB
Del
OK
sql_analyse.h
11.23 KB
Del
OK
sql_analyze_stmt.h
11.48 KB
Del
OK
sql_array.h
6.79 KB
Del
OK
sql_audit.h
13.62 KB
Del
OK
sql_base.h
24.83 KB
Del
OK
sql_basic_types.h
9.28 KB
Del
OK
sql_binlog.h
895 B
Del
OK
sql_bitmap.h
7.66 KB
Del
OK
sql_bootstrap.h
1.63 KB
Del
OK
sql_cache.h
21.15 KB
Del
OK
sql_callback.h
1.51 KB
Del
OK
sql_class.h
250.08 KB
Del
OK
sql_cmd.h
9.13 KB
Del
OK
sql_connect.h
3.99 KB
Del
OK
sql_const.h
10.94 KB
Del
OK
sql_crypt.h
1.4 KB
Del
OK
sql_cte.h
16.15 KB
Del
OK
sql_cursor.h
2.26 KB
Del
OK
sql_db.h
2.16 KB
Del
OK
sql_debug.h
4.65 KB
Del
OK
sql_delete.h
1.31 KB
Del
OK
sql_derived.h
1.26 KB
Del
OK
sql_digest.h
3.73 KB
Del
OK
sql_digest_stream.h
1.53 KB
Del
OK
sql_do.h
954 B
Del
OK
sql_error.h
38.12 KB
Del
OK
sql_explain.h
27.1 KB
Del
OK
sql_expression_cache.h
4.26 KB
Del
OK
sql_get_diagnostics.h
7.68 KB
Del
OK
sql_handler.h
2.84 KB
Del
OK
sql_help.h
920 B
Del
OK
sql_hset.h
3.56 KB
Del
OK
sql_i_s.h
7.97 KB
Del
OK
sql_insert.h
2.39 KB
Del
OK
sql_join_cache.h
47.44 KB
Del
OK
sql_lex.h
166.31 KB
Del
OK
sql_lifo_buffer.h
9.45 KB
Del
OK
sql_limit.h
2.38 KB
Del
OK
sql_list.h
21.56 KB
Del
OK
sql_load.h
1.25 KB
Del
OK
sql_locale.h
2.64 KB
Del
OK
sql_manager.h
960 B
Del
OK
sql_mode.h
6.58 KB
Del
OK
sql_parse.h
8.26 KB
Del
OK
sql_partition.h
11.75 KB
Del
OK
sql_partition_admin.h
5.8 KB
Del
OK
sql_plist.h
7.55 KB
Del
OK
sql_plugin.h
7.39 KB
Del
OK
sql_plugin_compat.h
2.18 KB
Del
OK
sql_prepare.h
11.14 KB
Del
OK
sql_priv.h
17.67 KB
Del
OK
sql_profile.h
7.63 KB
Del
OK
sql_reload.h
1.01 KB
Del
OK
sql_rename.h
982 B
Del
OK
sql_repl.h
2.96 KB
Del
OK
sql_schema.h
3.23 KB
Del
OK
sql_select.h
86.56 KB
Del
OK
sql_sequence.h
5.06 KB
Del
OK
sql_servers.h
1.74 KB
Del
OK
sql_show.h
9.39 KB
Del
OK
sql_signal.h
3.28 KB
Del
OK
sql_sort.h
21.39 KB
Del
OK
sql_statistics.h
11.96 KB
Del
OK
sql_string.h
36.43 KB
Del
OK
sql_table.h
11.07 KB
Del
OK
sql_tablespace.h
956 B
Del
OK
sql_test.h
1.55 KB
Del
OK
sql_time.h
8.18 KB
Del
OK
sql_trigger.h
10.76 KB
Del
OK
sql_truncate.h
2.03 KB
Del
OK
sql_tvc.h
2.36 KB
Del
OK
sql_type.h
286 KB
Del
OK
sql_type_geom.h
18.53 KB
Del
OK
sql_type_int.h
9.73 KB
Del
OK
sql_type_json.h
6 KB
Del
OK
sql_type_real.h
1.23 KB
Del
OK
sql_type_string.h
1.59 KB
Del
OK
sql_udf.h
4.74 KB
Del
OK
sql_union.h
1.04 KB
Del
OK
sql_update.h
1.88 KB
Del
OK
sql_view.h
2.33 KB
Del
OK
sql_window.h
6.65 KB
Del
OK
ssl_compat.h
3.07 KB
Del
OK
strfunc.h
2.22 KB
Del
OK
structs.h
25.13 KB
Del
OK
sys_vars_shared.h
2.67 KB
Del
OK
t_ctype.h
5.51 KB
Del
OK
table.h
112.29 KB
Del
OK
table_cache.h
4.13 KB
Del
OK
thr_alarm.h
2.87 KB
Del
OK
thr_lock.h
6.7 KB
Del
OK
thr_malloc.h
1.17 KB
Del
OK
thr_timer.h
1.53 KB
Del
OK
thread_cache.h
5.77 KB
Del
OK
thread_pool_priv.h
4 KB
Del
OK
threadpool.h
4.51 KB
Del
OK
threadpool_generic.h
3.83 KB
Del
OK
transaction.h
1.43 KB
Del
OK
tzfile.h
4.9 KB
Del
OK
tztime.h
3.32 KB
Del
OK
uniques.h
4.1 KB
Del
OK
unireg.h
7.43 KB
Del
OK
vers_string.h
2.47 KB
Del
OK
violite.h
9.71 KB
Del
OK
waiting_threads.h
4.43 KB
Del
OK
welcome_copyright_notice.h
1.19 KB
Del
OK
win_tzname_data.h
6.35 KB
Del
OK
winservice.h
1.17 KB
Del
OK
wqueue.h
1.53 KB
Del
OK
wsrep.h
3.23 KB
Del
OK
wsrep_applier.h
2.64 KB
Del
OK
wsrep_binlog.h
3.36 KB
Del
OK
wsrep_client_service.h
2.5 KB
Del
OK
wsrep_client_state.h
1.53 KB
Del
OK
wsrep_condition_variable.h
1.45 KB
Del
OK
wsrep_high_priority_service.h
4.8 KB
Del
OK
wsrep_mutex.h
1.19 KB
Del
OK
wsrep_mysqld.h
19.88 KB
Del
OK
wsrep_mysqld_c.h
1.2 KB
Del
OK
wsrep_on.h
1.68 KB
Del
OK
wsrep_priv.h
1.6 KB
Del
OK
wsrep_schema.h
4.54 KB
Del
OK
wsrep_server_service.h
3.55 KB
Del
OK
wsrep_server_state.h
2.23 KB
Del
OK
wsrep_sst.h
3.86 KB
Del
OK
wsrep_storage_service.h
1.77 KB
Del
OK
wsrep_thd.h
10.58 KB
Del
OK
wsrep_trans_observer.h
17.81 KB
Del
OK
wsrep_types.h
997 B
Del
OK
wsrep_utils.h
9.07 KB
Del
OK
wsrep_var.h
4.17 KB
Del
OK
wsrep_xid.h
1.42 KB
Del
OK
xa.h
1.69 KB
Del
OK
Edit: partition_info.h
#ifndef PARTITION_INFO_INCLUDED #define PARTITION_INFO_INCLUDED /* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ #ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif #include "sql_class.h" #include "partition_element.h" #include "sql_partition.h" class partition_info; struct TABLE_LIST; /* Some function typedefs */ 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 bool (*check_constants_func)(THD *thd, partition_info *part_info); struct st_ddl_log_memory_entry; #define MAX_PART_NAME_SIZE 8 struct Vers_part_info : public Sql_alloc { Vers_part_info() : limit(0), now_part(NULL), hist_part(NULL) { interval.type= INTERVAL_LAST; } Vers_part_info(Vers_part_info &src) : interval(src.interval), limit(src.limit), now_part(NULL), hist_part(NULL) { } bool initialized() { if (now_part) { DBUG_ASSERT(now_part->id != UINT_MAX32); DBUG_ASSERT(now_part->type == partition_element::CURRENT); if (hist_part) { DBUG_ASSERT(hist_part->id != UINT_MAX32); DBUG_ASSERT(hist_part->type == partition_element::HISTORY); } return true; } return false; } struct { my_time_t start; INTERVAL step; enum interval_type type; bool is_set() { return type < INTERVAL_LAST; } } interval; ulonglong limit; partition_element *now_part; partition_element *hist_part; }; /* See generate_partition_syntax() for details of how the data is used in partition expression. */ class partition_info : public Sql_alloc { public: /* * Here comes a set of definitions needed for partitioned table handlers. */ List<partition_element> partitions; List<partition_element> temp_partitions; /* These are mutually exclusive with part_expr/subpart_expr depending on what is specified in partitioning filter: expression or column list. */ List<const char> part_field_list; List<const char> subpart_field_list; /* If there is no subpartitioning, use only this func to get partition ids. If there is subpartitioning, use the this func to get partition id when you have both partition and subpartition fields. */ get_part_id_func get_partition_id; /* Get partition id when we don't have subpartition fields */ get_part_id_func get_part_partition_id; /* Get subpartition id when we have don't have partition fields by we do have subpartition ids. Mikael said that for given constant tuple {subpart_field1, ..., subpart_fieldN} the subpartition id will be the same in all subpartitions */ get_subpart_id_func get_subpartition_id; /* When we have various string fields we might need some preparation before and clean-up after calling the get_part_id_func's. We need one such method for get_part_partition_id and one for get_subpartition_id. */ get_part_id_func get_part_partition_id_charset; get_subpart_id_func get_subpartition_id_charset; check_constants_func check_constants; /* NULL-terminated array of fields used in partitioned expression */ Field **part_field_array; Field **subpart_field_array; Field **part_charset_field_array; Field **subpart_charset_field_array; /* Array of all fields used in partition and subpartition expression, without duplicates, NULL-terminated. */ Field **full_part_field_array; /* Set of all fields used in partition and subpartition expression. Required for testing of partition fields in write_set when updating. We need to set all bits in read_set because the row may need to be inserted in a different [sub]partition. */ MY_BITMAP full_part_field_set; /* When we have a field that requires transformation before calling the partition functions we must allocate field buffers for the field of the fields in the partition function. */ uchar **part_field_buffers; uchar **subpart_field_buffers; uchar **restore_part_field_ptrs; uchar **restore_subpart_field_ptrs; Item *part_expr; Item *subpart_expr; Item *item_free_list; struct st_ddl_log_memory_entry *first_log_entry; struct st_ddl_log_memory_entry *exec_log_entry; struct st_ddl_log_memory_entry *frm_log_entry; /* Bitmaps of partitions used by the current query. * read_partitions - partitions to be used for reading. * lock_partitions - partitions that must be locked (read or write). Usually read_partitions is the same set as lock_partitions, but in case of UPDATE the WHERE clause can limit the read_partitions set, but not neccesarily the lock_partitions set. Usage pattern: * Initialized in ha_partition::open(). * read+lock_partitions is set according to explicit PARTITION, WL#5217, in open_and_lock_tables(). * Bits in read_partitions can be cleared in prune_partitions() in the optimizing step. (WL#4443 is about allowing prune_partitions() to affect lock_partitions and be done before locking too). * When the partition enabled handler get an external_lock call it locks all partitions in lock_partitions (and remembers which partitions it locked, so that it can unlock them later). In case of LOCK TABLES it will lock all partitions, and keep them locked while lock_partitions can change for each statement under LOCK TABLES. * Freed at the same time item_free_list is freed. */ MY_BITMAP read_partitions; MY_BITMAP lock_partitions; bool bitmaps_are_initialized; union { longlong *range_int_array; LIST_PART_ENTRY *list_array; part_column_list_val *range_col_array; part_column_list_val *list_col_array; }; Vers_part_info *vers_info; /******************************************** * INTERVAL ANALYSIS ********************************************/ /* Partitioning interval analysis function for partitioning, or NULL if interval analysis is not supported for this kind of partitioning. */ get_partitions_in_range_iter get_part_iter_for_interval; /* Partitioning interval analysis function for subpartitioning, or NULL if interval analysis is not supported for this kind of partitioning. */ get_partitions_in_range_iter get_subpart_iter_for_interval; /******************************************** * INTERVAL ANALYSIS ENDS ********************************************/ longlong err_value; char* part_info_string; partition_element *curr_part_elem; // part or sub part partition_element *current_partition; // partition part_elem_value *curr_list_val; uint curr_list_object; uint num_columns; TABLE *table; /* These key_map's are used for Partitioning to enable quick decisions on whether we can derive more information about which partition to scan just by looking at what index is used. */ key_map all_fields_in_PF, all_fields_in_PPF, all_fields_in_SPF; key_map some_fields_in_PF; handlerton *default_engine_type; partition_type part_type; partition_type subpart_type; uint part_info_len; uint num_parts; uint num_subparts; uint count_curr_subparts; // used during parsing uint num_list_values; uint num_part_fields; uint num_subpart_fields; uint num_full_part_fields; uint has_null_part_id; uint32 default_partition_id; /* This variable is used to calculate the partition id when using LINEAR KEY/HASH. This functionality is kept in the MySQL Server but mainly of use to handlers supporting partitioning. */ uint16 linear_hash_mask; /* 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) */ enum enum_key_algorithm { KEY_ALGORITHM_NONE= 0, KEY_ALGORITHM_51= 1, KEY_ALGORITHM_55= 2 }; enum_key_algorithm key_algorithm; /* Only the number of partitions defined (uses default names and options). */ bool use_default_partitions; bool use_default_num_partitions; /* Only the number of subpartitions defined (uses default names etc.). */ bool use_default_subpartitions; bool use_default_num_subpartitions; bool default_partitions_setup; bool defined_max_value; inline bool has_default_partititon() { return (part_type == LIST_PARTITION && defined_max_value); } bool list_of_part_fields; // KEY or COLUMNS PARTITIONING bool list_of_subpart_fields; // KEY SUBPARTITIONING bool linear_hash_ind; // LINEAR HASH/KEY bool fixed; bool is_auto_partitioned; bool has_null_value; bool column_list; // COLUMNS PARTITIONING, 5.5+ partition_info() : get_partition_id(NULL), get_part_partition_id(NULL), get_subpartition_id(NULL), part_field_array(NULL), subpart_field_array(NULL), part_charset_field_array(NULL), subpart_charset_field_array(NULL), full_part_field_array(NULL), part_field_buffers(NULL), subpart_field_buffers(NULL), restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL), part_expr(NULL), subpart_expr(NULL), item_free_list(NULL), first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL), bitmaps_are_initialized(FALSE), list_array(NULL), vers_info(NULL), err_value(0), part_info_string(NULL), curr_part_elem(NULL), current_partition(NULL), curr_list_object(0), num_columns(0), table(NULL), default_engine_type(NULL), part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION), part_info_len(0), num_parts(0), num_subparts(0), count_curr_subparts(0), num_list_values(0), num_part_fields(0), num_subpart_fields(0), num_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0), key_algorithm(KEY_ALGORITHM_NONE), use_default_partitions(TRUE), use_default_num_partitions(TRUE), use_default_subpartitions(TRUE), use_default_num_subpartitions(TRUE), default_partitions_setup(FALSE), defined_max_value(FALSE), list_of_part_fields(FALSE), list_of_subpart_fields(FALSE), linear_hash_ind(FALSE), fixed(FALSE), is_auto_partitioned(FALSE), has_null_value(FALSE), column_list(FALSE) { all_fields_in_PF.clear_all(); all_fields_in_PPF.clear_all(); all_fields_in_SPF.clear_all(); some_fields_in_PF.clear_all(); partitions.empty(); temp_partitions.empty(); part_field_list.empty(); subpart_field_list.empty(); } ~partition_info() = default; partition_info *get_clone(THD *thd, bool empty_data_and_index_file= FALSE); bool set_named_partition_bitmap(const char *part_name, size_t length); bool set_partition_bitmaps(List<String> *partition_names); /* Answers the question if subpartitioning is used for a certain table */ bool is_sub_partitioned() { return (subpart_type == NOT_A_PARTITION ? FALSE : TRUE); } /* Returns the total number of partitions on the leaf level */ uint get_tot_partitions() { return num_parts * (is_sub_partitioned() ? num_subparts : 1); } bool set_up_defaults_for_partitioning(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no); const char *find_duplicate_field(); char *find_duplicate_name(); bool check_engine_mix(handlerton *engine_type, bool default_engine); bool check_partition_info(THD *thd, handlerton **eng_type, handler *file, HA_CREATE_INFO *info, partition_info *add_or_reorg_part= NULL); void print_no_partition_found(TABLE *table, myf errflag); void print_debug(const char *str, uint*); Item* get_column_item(Item *item, Field *field); int fix_partition_values(THD *thd, part_elem_value *val, partition_element *part_elem); bool fix_column_value_functions(THD *thd, part_elem_value *val, uint part_id); bool fix_parser_data(THD *thd); int add_max_value(THD *thd); void init_col_val(part_column_list_val *col_val, Item *item); int reorganize_into_single_field_col_val(THD *thd); part_column_list_val *add_column_value(THD *thd); bool set_part_expr(THD *thd, Item *item_ptr, bool is_subpart); bool set_up_charset_field_preps(THD *thd); bool check_partition_field_length(); bool init_column_part(THD *thd); bool add_column_list_value(THD *thd, Item *item); partition_element *get_part_elem(const char *partition_name, char *file_name, size_t file_name_size, uint32 *part_id); void report_part_expr_error(bool use_subpart_expr); bool has_same_partitioning(partition_info *new_part_info); bool error_if_requires_values() const; private: bool set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no); bool set_up_default_subpartitions(THD *thd, handler *file, HA_CREATE_INFO *info); char *create_default_partition_names(THD *thd, uint part_no, uint num_parts, uint start_no); char *create_default_subpartition_name(THD *thd, uint subpart_no, const char *part_name); bool prune_partition_bitmaps(List<String> *partition_names); // set_read_partitions() in 8.0 bool add_named_partition(const char *part_name, size_t length); public: bool has_unique_name(partition_element *element); bool field_in_partition_expr(Field *field) const; bool vers_init_info(THD *thd); bool vers_set_interval(THD *thd, Item *interval, interval_type int_type, Item *starts, const char *table_name); bool vers_set_limit(ulonglong limit) { DBUG_ASSERT(part_type == VERSIONING_PARTITION); vers_info->limit= limit; return !limit; } bool vers_require_hist_part(THD *thd) const { return part_type == VERSIONING_PARTITION && thd->lex->vers_history_generating(); } int vers_set_hist_part(THD *thd); void vers_check_limit(THD *thd); bool vers_fix_field_list(THD *thd); void vers_update_el_ids(); partition_element *get_partition(uint part_id) { List_iterator<partition_element> it(partitions); partition_element *el; while ((el= it++)) { if (el->id == part_id) return el; } return NULL; } uint next_part_no(uint new_parts) const; }; uint32 get_next_partition_id_range(struct st_partition_iter* part_iter); bool check_partition_dirs(partition_info *part_info); /* Initialize the iterator to return a single partition with given part_id */ static inline void init_single_partition_iterator(uint32 part_id, PARTITION_ITERATOR *part_iter) { part_iter->part_nums.start= part_iter->part_nums.cur= part_id; part_iter->part_nums.end= part_id+1; part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE; part_iter->ret_default_part= part_iter->ret_default_part_orig= FALSE; part_iter->get_next= get_next_partition_id_range; } /* Initialize the iterator to enumerate all partitions */ static inline void init_all_partitions_iterator(partition_info *part_info, PARTITION_ITERATOR *part_iter) { part_iter->part_nums.start= part_iter->part_nums.cur= 0; part_iter->part_nums.end= part_info->num_parts; part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE; part_iter->ret_default_part= part_iter->ret_default_part_orig= FALSE; part_iter->get_next= get_next_partition_id_range; } /** @brief Update part_field_list by row_end field name @returns true on error; false on success */ inline bool partition_info::vers_fix_field_list(THD * thd) { if (!table->versioned()) { // frm must be corrupted, normally CREATE/ALTER TABLE checks for that my_error(ER_FILE_CORRUPT, MYF(0), table->s->path.str); return true; } DBUG_ASSERT(part_type == VERSIONING_PARTITION); DBUG_ASSERT(table->versioned(VERS_TIMESTAMP)); Field *row_end= table->vers_end_field(); // needed in handle_list_of_fields() row_end->flags|= GET_FIXED_FIELDS_FLAG; Name_resolution_context *context= &thd->lex->current_select->context; Item *row_end_item= new (thd->mem_root) Item_field(thd, context, row_end); Item *row_end_ts= new (thd->mem_root) Item_func_unix_timestamp(thd, row_end_item); set_part_expr(thd, row_end_ts, false); return false; } /** @brief Update partition_element's id @returns true on error; false on success */ inline void partition_info::vers_update_el_ids() { DBUG_ASSERT(part_type == VERSIONING_PARTITION); DBUG_ASSERT(table->versioned(VERS_TIMESTAMP)); List_iterator<partition_element> it(partitions); partition_element *el; for(uint32 id= 0; ((el= it++)); id++) { DBUG_ASSERT(el->type != partition_element::CONVENTIONAL); /* Newly added element is inserted before AS_OF_NOW. */ if (el->id == UINT_MAX32 || el->type == partition_element::CURRENT) { el->id= id; if (el->type == partition_element::CURRENT) break; } } } inline bool make_partition_name(char *move_ptr, uint i) { int res= snprintf(move_ptr, MAX_PART_NAME_SIZE + 1, "p%u", i); return res < 0 || res > MAX_PART_NAME_SIZE; } #ifdef WITH_PARTITION_STORAGE_ENGINE inline uint partition_info::next_part_no(uint new_parts) const { if (part_type != VERSIONING_PARTITION) return num_parts; DBUG_ASSERT(new_parts > 0); /* Choose first non-occupied name suffix */ uint32 suffix= num_parts - 1; DBUG_ASSERT(suffix > 0); char part_name[MAX_PART_NAME_SIZE + 1]; List_iterator_fast<partition_element> it(table->part_info->partitions); for (uint cur_part= 0; cur_part < new_parts; ++cur_part, ++suffix) { uint32 cur_suffix= suffix; if (make_partition_name(part_name, suffix)) return 0; partition_element *el; it.rewind(); while ((el= it++)) { if (0 == my_strcasecmp(&my_charset_latin1, el->partition_name, part_name)) { if (make_partition_name(part_name, ++suffix)) return 0; it.rewind(); } } if (cur_part > 0 && suffix > cur_suffix) cur_part= 0; } return suffix - new_parts; } #endif #endif /* PARTITION_INFO_INCLUDED */
Save