diff options
author | unknown <mikael@c-7308e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-06-05 14:55:22 -0400 |
---|---|---|
committer | unknown <mikael@c-7308e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-06-05 14:55:22 -0400 |
commit | e05d2d06cb4adfe27dc4c0c4cb8f445332e9ab80 (patch) | |
tree | 291b3146c2532a98644faadc8882a4c060ad2931 /sql/partition_info.cc | |
parent | 9d371277668f5dfe51feec9ed58b5712859b8fbb (diff) | |
download | mariadb-git-e05d2d06cb4adfe27dc4c0c4cb8f445332e9ab80.tar.gz |
BUG#16002: Handle unsigned integer partition functions
mysql-test/r/partition.result:
Added new test cases
mysql-test/r/partition_error.result:
Fixed test case
mysql-test/t/partition.test:
Added new test cases
mysql-test/t/partition_error.test:
Fixed test case
sql/ha_partition.cc:
Review fixes
sql/partition_element.h:
Review fixes
sql/partition_info.cc:
Review fixes
sql/share/errmsg.txt:
Review fixes
sql/sql_partition.cc:
Review fixes
sql/sql_yacc.yy:
Enabled possibility to use (MAXVALUE) as well as MAXVALUE.
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 97cac37c00e..a6ca1e0107e 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -485,10 +485,9 @@ bool partition_info::check_range_constants() else { ulonglong upart_range_value_int; - if ((i != (no_parts - 1)) || !defined_max_value) - upart_range_value_int= part_def->range_value; - else - upart_range_value_int= ULONGLONG_MAX; + if ((i == (no_parts - 1)) && defined_max_value) + part_def->range_value= ULONGLONG_MAX; + upart_range_value_int= part_def->range_value; if (likely(current_largest_uint < upart_range_value_int)) { current_largest_uint= upart_range_value_int; @@ -572,7 +571,6 @@ bool partition_info::check_list_constants() uint i; uint list_index= 0; part_elem_value *list_value; - bool not_first; bool result= TRUE; longlong curr_value, prev_value; partition_element* part_def; @@ -638,6 +636,7 @@ bool partition_info::check_list_constants() if (fixed) { + bool first= TRUE; if (!part_expr->unsigned_flag) qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY), &list_part_cmp); @@ -645,15 +644,14 @@ bool partition_info::check_list_constants() qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY), &list_part_cmp_unsigned); - not_first= FALSE; i= prev_value= 0; //prev_value initialised to quiet compiler do { curr_value= list_array[i].list_value; - if (likely(!not_first || prev_value != curr_value)) + if (likely(first || prev_value != curr_value)) { prev_value= curr_value; - not_first= TRUE; + first= FALSE; } else { |