From 49a4ed2b3f01b1138934a7dc6d4eff8c529c3efd Mon Sep 17 00:00:00 2001 From: Mattias Jonsson <mattias.jonsson@sun.com> Date: Wed, 21 Oct 2009 17:45:34 +0200 Subject: [PATCH] WL#3352, minor code formatting fixes after code review sql/opt_range.cc: WL#3352 code review fixes Corrected indenting and added range_par parameter for easier reading/formatting. sql/partition_element.h: WL#3352, changed formatting of copyright header sql/sql_partition.cc: WL#3352, fixed indenting and changed MAX_VALUE to MAXVALUE sql/sql_partition.h: WL#3352, fixed copyright header and indenting of function header --- sql/opt_range.cc | 28 ++++++++++++++-------------- sql/partition_element.h | 2 +- sql/sql_partition.cc | 6 +++--- sql/sql_partition.h | 20 ++++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 356cfe5e39..5e6bdfceaf 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -480,9 +480,9 @@ public: (*range_key_flag)|= key_tree->max_flag; if (key_tree->next_key_part && key_tree->part != last_part && - key_tree->next_key_part->part == key_tree->part+1 && - !(*range_key_flag & (NO_MAX_RANGE | NEAR_MAX)) && - key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) + key_tree->next_key_part->part == key_tree->part+1 && + !(*range_key_flag & (NO_MAX_RANGE | NEAR_MAX)) && + key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) res+= key_tree->next_key_part->store_max_key(key, range_key, range_key_flag, @@ -3137,8 +3137,9 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) bool set_full_part_if_bad_ret= FALSE; bool ignore_part_fields= ppar->ignore_part_fields; bool did_set_ignore_part_fields= FALSE; + RANGE_OPT_PARAM *range_par= &(ppar->range_param); - if (check_stack_overrun(ppar->range_param.thd, 3*STACK_MIN_SIZE, NULL)) + if (check_stack_overrun(range_par->thd, 3*STACK_MIN_SIZE, NULL)) return -1; if (key_tree->left != &null_element) @@ -3234,11 +3235,11 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) else flag= key_tree->min_flag | key_tree->max_flag; - if (tmp_min_key != ppar->range_param.min_key) + if (tmp_min_key != range_par->min_key) flag&= ~NO_MIN_RANGE; else flag|= NO_MIN_RANGE; - if (tmp_max_key != ppar->range_param.max_key) + if (tmp_max_key != range_par->max_key) flag&= ~NO_MAX_RANGE; else flag|= NO_MAX_RANGE; @@ -3265,10 +3266,10 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) get_part_iter_for_interval(ppar->part_info, FALSE, store_length_array, - ppar->range_param.min_key, - ppar->range_param.max_key, - tmp_min_key - ppar->range_param.min_key, - tmp_max_key - ppar->range_param.max_key, + range_par->min_key, + range_par->max_key, + tmp_min_key - range_par->min_key, + tmp_max_key - range_par->max_key, flag, &ppar->part_iter); if (!res) @@ -3304,8 +3305,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) { PARTITION_ITERATOR subpart_iter; DBUG_EXECUTE("info", dbug_print_segment_range(key_tree, - ppar->range_param. - key_parts);); + range_par->key_parts);); res= ppar->part_info-> get_subpart_iter_for_interval(ppar->part_info, TRUE, @@ -7653,13 +7653,13 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree, tmp_min_keypart+= key_tree->next_key_part->store_min_key(param->key[idx], &tmp_min_key, - &tmp_min_flag, + &tmp_min_flag, MAX_KEY); if (!tmp_max_flag) tmp_max_keypart+= key_tree->next_key_part->store_max_key(param->key[idx], &tmp_max_key, - &tmp_max_flag, + &tmp_max_flag, MAX_KEY); min_key_length= (uint) (tmp_min_key - param->min_key); max_key_length= (uint) (tmp_max_key - param->max_key); diff --git a/sql/partition_element.h b/sql/partition_element.h index bd18457fd5..34c209f8a5 100644 --- a/sql/partition_element.h +++ b/sql/partition_element.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2008 MySQL AB, Sun Microsystems Inc. 2008-2009 +/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. 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 diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index f37fcebf61..0871dd8620 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3025,7 +3025,7 @@ int get_partition_id_range_col(partition_info *part_info, { loc_part_id= (max_part_id + min_part_id + 1) >> 1; if (cmp_rec_and_tuple(range_col_array + loc_part_id*num_columns, - num_columns) >= 0) + num_columns) >= 0) min_part_id= loc_part_id + 1; else max_part_id= loc_part_id - 1; @@ -6827,12 +6827,12 @@ uint32 store_tuple_to_record(Field **pfield, /* RANGE(columns) partitioning: compare value bound and probe tuple. - The value bound always is a full tuple (but may include the MAX_VALUE + The value bound always is a full tuple (but may include the MAXVALUE special value). The probe tuple may be a prefix of partitioning tuple. The tail_is_min parameter specifies whether the suffix components should be assumed to - hold MAX_VALUE + hold MAXVALUE */ static int cmp_rec_and_tuple(part_column_list_val *val, uint32 nvals_in_rec) diff --git a/sql/sql_partition.h b/sql/sql_partition.h index 47e5df0443..ca0439506f 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2008 MySQL AB, Sun Microsystems Inc. 2008-2009 +/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. 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 @@ -172,16 +172,16 @@ typedef struct st_partition_iter SYNOPSIS get_partitions_in_range_iter() - part_info Partitioning info + part_info Partitioning info is_subpart - 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 + 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 DESCRIPTION Functions with this signature are used to perform "Partitioning Interval -- 2.30.9