diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-02-18 12:24:51 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-23 15:33:23 +0100 |
commit | c4c81a5b048149c267d92764183cc3dd69def818 (patch) | |
tree | b636a1ad8e9fed21ed40ce6e1a7c9d7f1dadd23c /sql/partition_info.h | |
parent | f38ef430138fcd67fa8fe354c48c8807e06aaf19 (diff) | |
download | mariadb-git-c4c81a5b048149c267d92764183cc3dd69def818.tar.gz |
cleanup: partition_info::check_constants
partition_info had a bunch of function pointers to avoid if()'s
when invoking part_type specific functionality (like get_part_id, etc).
But check_range_constants() and check_list_constants() were still
invoked conditionally, with if()'s.
Create partition_info::check_constants function pointer, get rid
of if()'s
Also remove alloc argument of check_range_constants(), added
in 26a3ff0a22e. Broken system versioning will be fixed in
following commits.
Diffstat (limited to 'sql/partition_info.h')
-rw-r--r-- | sql/partition_info.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sql/partition_info.h b/sql/partition_info.h index f2d185cdfaf..1170aa53e7d 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -27,11 +27,10 @@ class partition_info; struct TABLE_LIST; /* Some function typedefs */ -typedef int (*get_part_id_func)(partition_info *part_info, - uint32 *part_id, +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_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; @@ -114,6 +113,8 @@ public: 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; @@ -345,8 +346,6 @@ public: const char *find_duplicate_field(); char *find_duplicate_name(); bool check_engine_mix(handlerton *engine_type, bool default_engine); - bool check_range_constants(THD *thd, bool alloc= true); - bool check_list_constants(THD *thd); bool check_partition_info(THD *thd, handlerton **eng_type, handler *file, HA_CREATE_INFO *info, partition_info *add_or_reorg_part= NULL); @@ -366,7 +365,6 @@ public: part_column_list_val *add_column_value(THD *thd); bool set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart); - static int compare_column_values(const void *a, const void *b); bool set_up_charset_field_preps(THD *thd); bool check_partition_field_length(); bool init_column_part(THD *thd); @@ -377,7 +375,6 @@ public: bool has_same_partitioning(partition_info *new_part_info); bool error_if_requires_values() const; private: - static int list_part_cmp(const void* a, const void* b); 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, @@ -545,7 +542,7 @@ public: } MEM_ROOT *old_root= thd->mem_root; thd->mem_root= &table->mem_root; - result= check_range_constants(thd, false); + //result= check_range_constants(thd, false); thd->mem_root= old_root; vers_info->stat_serial= table->s->stat_serial; mysql_rwlock_unlock(&table->s->LOCK_stat_serial); |