diff options
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r-- | sql/opt_sum.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 5747ea55087..7bb75c3175d 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2008-2011 Monty Program Ab 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 @@ -246,7 +247,6 @@ int opt_sum_query(THD *thd, table_map where_tables= 0; Item *item; int error; - DBUG_ENTER("opt_sum_query"); if (conds) @@ -392,7 +392,7 @@ int opt_sum_query(THD *thd, if (!error && reckey_in_range(is_max, &ref, item_field->field, conds, range_fl, prefix_len)) error= HA_ERR_KEY_NOT_FOUND; - table->set_keyread(FALSE); + table->disable_keyread(); table->file->ha_index_end(); if (error) { @@ -748,7 +748,7 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, since set_null will be ignored, and we will compare uninitialized data. */ if (!part->field->real_maybe_null()) - DBUG_RETURN(false); + DBUG_RETURN(FALSE); part->field->set_null(); *key_ptr= (uchar) 1; } @@ -836,7 +836,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, uint *range_fl, uint *prefix_len) { if (!(field->flags & PART_KEY_FLAG)) - return false; // Not key field + return FALSE; // Not key field DBUG_ENTER("find_key_for_maxmin"); @@ -863,7 +863,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1) { if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER)) - DBUG_RETURN(false); + DBUG_RETURN(FALSE); /* Check whether the index component is partial */ Field *part_field= table->field[part->fieldnr-1]; @@ -911,13 +911,13 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, converted (for example to upper case) */ if (field->part_of_key.is_set(idx)) - table->set_keyread(TRUE); - DBUG_RETURN(true); + table->enable_keyread(); + DBUG_RETURN(TRUE); } } } } - DBUG_RETURN(false); + DBUG_RETURN(FALSE); } @@ -999,15 +999,11 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond) SELECT MAX(b) FROM t1 WHERE a=const AND b<const */ if (max_fl != less_fl) - return cond->val_int() == 0; // Return 1 if WHERE is false + return cond->val_int() == 0; // Return 1 if WHERE is false return 0; } - case Item_func::EQ_FUNC: - case Item_func::EQUAL_FUNC: - break; - default: // Keep compiler happy - DBUG_ASSERT(1); // Impossible - break; + default: + break; // Ignore } return 0; } |