diff options
author | Staale Smedseng <staale.smedseng@sun.com> | 2009-06-09 14:55:30 +0200 |
---|---|---|
committer | Staale Smedseng <staale.smedseng@sun.com> | 2009-06-09 14:55:30 +0200 |
commit | a092ed1afe3c3c7889810f45d591cfb2633c87f9 (patch) | |
tree | 6cee8c2084e348d45fc326e9557d2f4148c4ab1a /sql/opt_range.cc | |
parent | 0b7fecf9e486990d173cc87b2c94aee06b0f7dbb (diff) | |
download | mariadb-git-a092ed1afe3c3c7889810f45d591cfb2633c87f9.tar.gz |
Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
Compiling MySQL with gcc 4.3.2 and later produces a number of
warnings, many of which are new with the recent compiler
versions.
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number
of the warnings, predominantly "suggest using parentheses
around && in ||", and empty for and while bodies.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c3a43776429..d52db41d64c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2032,7 +2032,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, quick=0; needed_reg.clear_all(); quick_keys.clear_all(); - if ((specialflag & SPECIAL_SAFE_MODE) && ! force_quick_range || + if (((specialflag & SPECIAL_SAFE_MODE) && ! force_quick_range) || !limit) DBUG_RETURN(0); /* purecov: inspected */ if (keys_to_use.is_clear_all()) @@ -2462,8 +2462,8 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, DBUG_PRINT("info", ("index_merge scans cost %g", imerge_cost)); if (imerge_too_expensive || (imerge_cost > read_time) || - (non_cpk_scan_records+cpk_scan_records >= param->table->file->records) && - read_time != DBL_MAX) + ((non_cpk_scan_records+cpk_scan_records >= param->table->file->records) && + read_time != DBL_MAX)) { /* Bail out if it is obvious that both index_merge and ROR-union will be @@ -6490,7 +6490,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, goto err; quick->records= records; - if (cp_buffer_from_ref(thd,ref) && thd->is_fatal_error || + if ((cp_buffer_from_ref(thd,ref) && thd->is_fatal_error) || !(range= new(alloc) QUICK_RANGE())) goto err; // out of memory @@ -7342,7 +7342,7 @@ int QUICK_RANGE_SELECT::cmp_prev(QUICK_RANGE *range_arg) cmp= key_cmp(key_part_info, (byte*) range_arg->min_key, range_arg->min_length); - if (cmp > 0 || cmp == 0 && !(range_arg->flag & NEAR_MIN)) + if (cmp > 0 || (cmp == 0 && !(range_arg->flag & NEAR_MIN))) return 0; return 1; // outside of range } @@ -9395,7 +9395,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() /* Compare the found key with max_key. */ int cmp_res= key_cmp(index_info->key_part, max_key, real_prefix_len + min_max_arg_len); - if (!((cur_range->flag & NEAR_MAX) && (cmp_res == -1) || + if (!(((cur_range->flag & NEAR_MAX) && (cmp_res == -1)) || (cmp_res <= 0))) { result = HA_ERR_KEY_NOT_FOUND; @@ -9511,7 +9511,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() /* Compare the found key with min_key. */ int cmp_res= key_cmp(index_info->key_part, min_key, real_prefix_len + min_max_arg_len); - if (!((cur_range->flag & NEAR_MIN) && (cmp_res == 1) || + if (!(((cur_range->flag & NEAR_MIN) && (cmp_res == 1)) || (cmp_res >= 0))) continue; } |