summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2008-12-16 10:12:22 -0200
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2008-12-16 10:12:22 -0200
commit3ce026ec2f66a73be82a26055dd4761479a73811 (patch)
treec93d4234e3d8d278b91319b97e252f86a083eb0d /sql/item_sum.cc
parent0772b6a833a33304c753b7afa9b58b6b6c8f6464 (diff)
downloadmariadb-git-3ce026ec2f66a73be82a26055dd4761479a73811.tar.gz
Fix warnings and bug spotted by gcc-4.3.
Related to operator precedence and associativity. Make the expressions as explicit as possible. sql/field.h: Silence gcc-4.3 warning: be more explicit. sql/item.cc: Silence gcc-4.3 warning: be more explicit. sql/item_sum.cc: Silence gcc-4.3 warning: be more explicit. sql/log_event.cc: Silence gcc-4.3 warning: be more explicit. sql/spatial.h: Silence gcc-4.3 warning: be more explicit. sql/sql_lex.cc: Silence gcc-4.3 warning: be more explicit. sql/table.h: Silence gcc-4.3 warning: be more explicit. storage/federated/ha_federated.cc: Fix operator precedence bug. storage/heap/ha_heap.cc: Silence gcc-4.3 warning: be more explicit.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c2b3b954634..1821136cc9d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -654,8 +654,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
return TRUE;
// 'item' can be changed during fix_fields
- if (!item->fixed &&
- item->fix_fields(thd, args) ||
+ if ((!item->fixed && item->fix_fields(thd, args)) ||
(item= args[0])->check_cols(1))
return TRUE;
decimals=item->decimals;
@@ -981,8 +980,8 @@ void Item_sum_distinct::fix_length_and_dec()
integers each <= 2^32.
*/
if (table_field_type == MYSQL_TYPE_INT24 ||
- table_field_type >= MYSQL_TYPE_TINY &&
- table_field_type <= MYSQL_TYPE_LONG)
+ (table_field_type >= MYSQL_TYPE_TINY &&
+ table_field_type <= MYSQL_TYPE_LONG))
{
val.traits= Hybrid_type_traits_fast_decimal::instance();
break;