diff options
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 5cfb46a99ab..8a8a03cb4e4 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2743,7 +2743,8 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info, uint min_list_index= 0, max_list_index= part_info->no_list_values - 1; longlong list_value; /* Get the partitioning function value for the endpoint */ - longlong part_func_value= part_val_int(part_info->part_expr); + longlong part_func_value= + part_info->part_expr->val_int_endpoint(left_endpoint, &include_endpoint); bool unsigned_flag= part_info->part_expr->unsigned_flag; DBUG_ENTER("get_list_array_idx_for_endpoint"); @@ -2887,7 +2888,9 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, uint max_partition= part_info->no_parts - 1; uint min_part_id= 0, max_part_id= max_partition, loc_part_id; /* Get the partitioning function value for the endpoint */ - longlong part_func_value= part_val_int(part_info->part_expr); + longlong part_func_value= + part_info->part_expr->val_int_endpoint(left_endpoint, &include_endpoint); + bool unsigned_flag= part_info->part_expr->unsigned_flag; DBUG_ENTER("get_partition_id_range_for_endpoint"); @@ -6590,8 +6593,6 @@ void make_used_partitions_str(partition_info *part_info, String *parts_str) #ifdef WITH_PARTITION_STORAGE_ENGINE static void set_up_range_analysis_info(partition_info *part_info) { - enum_monotonicity_info minfo; - /* Set the catch-all default */ part_info->get_part_iter_for_interval= NULL; part_info->get_subpart_iter_for_interval= NULL; @@ -6603,11 +6604,8 @@ static void set_up_range_analysis_info(partition_info *part_info) switch (part_info->part_type) { case RANGE_PARTITION: case LIST_PARTITION: - minfo= part_info->part_expr->get_monotonicity_info(); - if (minfo != NON_MONOTONIC) + if (part_info->part_expr->get_monotonicity_info() != NON_MONOTONIC) { - part_info->range_analysis_include_bounds= - test(minfo == MONOTONIC_INCREASING); part_info->get_part_iter_for_interval= get_part_iter_for_interval_via_mapping; goto setup_subparts; @@ -6775,8 +6773,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info, index-in-ordered-array-of-list-constants (for LIST) space. */ store_key_image_to_rec(field, min_value, field_len); - bool include_endp= part_info->range_analysis_include_bounds || - !test(flags & NEAR_MIN); + bool include_endp= !test(flags & NEAR_MIN); part_iter->part_nums.start= get_endpoint(part_info, 1, include_endp); part_iter->part_nums.cur= part_iter->part_nums.start; if (part_iter->part_nums.start == max_endpoint_val) @@ -6790,8 +6787,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info, else { store_key_image_to_rec(field, max_value, field_len); - bool include_endp= part_info->range_analysis_include_bounds || - !test(flags & NEAR_MAX); + bool include_endp= !test(flags & NEAR_MAX); part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp); if (part_iter->part_nums.start == part_iter->part_nums.end && !part_iter->ret_null_part) |