summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2009-01-31 23:22:44 +0200
committerMichael Widenius <monty@mysql.com>2009-01-31 23:22:44 +0200
commitbd4e65515f556b6bca45d06d81370d99cf649647 (patch)
treed52f87d228fdffdc4be98775856597a857a9d9dd /sql
parent37db97b0e25de1a1dc0d16bc9b88b0c3a2e9f9a2 (diff)
downloadmariadb-git-bd4e65515f556b6bca45d06d81370d99cf649647.tar.gz
Fixed compiler warnings found by gcc 4.3.2
- Added braces around expressions with &&, ||, & and | - Added empty line before ; for empty while and for loops - Added () around if with assignments - Removed const before function returning simple type Changed BUILD scripts to not build with NDB BUILD/SETUP.sh: By default, don't build ndb with --max in Maria tree. NDB is not kept up to date anyway in 5.1 client/mysql.cc: Added braces around && to get rid of compiler warnings sql/event_db_repository.cc: Added braces around && to get rid of compiler warnings sql/events.cc: Added braces around && to get rid of compiler warnings sql/field.cc: Added braces around && to get rid of compiler warnings Fixed for loops sql/field.h: Added braces around & to get rid of compiler warnings sql/field_conv.cc: Added braces around && to get rid of compiler warnings Fixed bug when copying between DATETIME fields and strict dates are used Removed not needeed else sql/gstream.cc: Added braces around && to get rid of compiler warnings sql/ha_ndbcluster.cc: Added braces around && to get rid of compiler warnings Added {} to get rid of compiler warnings sql/handler.cc: Added braces around && to get rid of compiler warnings sql/item.cc: Added braces around && to get rid of compiler warnings sql/item_cmpfunc.cc: Added braces around && to get rid of compiler warnings Removed some not needed space sql/item_func.cc: Added braces around && to get rid of compiler warnings sql/item_strfunc.cc: Added braces around && to get rid of compiler warnings sql/item_subselect.cc: Added braces around && to get rid of compiler warnings sql/item_sum.cc: Added braces around && to get rid of compiler warnings sql/item_timefunc.cc: Added braces around && to get rid of compiler warnings sql/item_xmlfunc.cc: Added empty line before ; for empty while and for loops sql/log.cc: Added braces around && to get rid of compiler warnings sql/log_event.cc: Added braces around && to get rid of compiler warnings Removed not needed else sql/log_event_old.cc: Added braces around && to get rid of compiler warnings sql/opt_range.cc: Added braces around && to get rid of compiler warnings sql/opt_sum.cc: Added braces around && to get rid of compiler warnings sql/set_var.cc: Added empty line before ; for empty while and for loops Added () around if with assignments sql/slave.cc: Added braces around && to get rid of compiler warnings Added empty line before ; for empty while and for loops sql/spatial.h: Added braces around && to get rid of compiler warnings sql/sql_acl.cc: Added braces around && to get rid of compiler warnings sql/sql_analyse.cc: Added empty line before ; for empty while and for loops sql/sql_base.cc: Added braces around && to get rid of compiler warnings sql/sql_connect.cc: Added braces around && to get rid of compiler warnings sql/sql_db.cc: Added braces around && to get rid of compiler warnings sql/sql_delete.cc: Added braces around && to get rid of compiler warnings sql/sql_help.cc: Added empty line before ; for empty while and for loops sql/sql_insert.cc: Added braces around && to get rid of compiler warnings Added () around if with assignments sql/sql_lex.cc: Cast char array references to uchar; Fixed wrong array referencing when using characters > ASCII 128 in SQL statments Added empty line before ; for empty while and for loops Trivial indent fixes Added braces around && to get rid of compiler warnings sql/sql_load.cc: Added braces around && to get rid of compiler warnings sql/sql_parse.cc: Added braces around && to get rid of compiler warnings sql/sql_partition.cc: Added braces around && to get rid of compiler warnings sql/sql_plugin.cc: Fixed bug in detecing if option variable should be readonly Added empty line before ; for empty while and for loops sql/sql_prepare.cc: Added braces around && to get rid of compiler warnings sql/sql_select.cc: Added braces around && to get rid of compiler warnings Added () around if with assignments Added empty line before ; for empty while and for loops sql/sql_show.cc: Added braces around && to get rid of compiler warnings sql/sql_table.cc: Added braces around && to get rid of compiler warnings sql/sql_trigger.cc: Added braces around && to get rid of compiler warnings sql/sql_update.cc: Added braces around && to get rid of compiler warnings sql/sql_yacc.yy: Added braces around && to get rid of compiler warnings sql/table.cc: Added braces around && to get rid of compiler warnings sql/table.h: Added braces around && to get rid of compiler warnings sql/time.cc: Added braces around && to get rid of compiler warnings sql/tztime.cc: Added braces around && to get rid of compiler warnings sql/uniques.cc: Added braces around && to get rid of compiler warnings storage/federated/ha_federated.cc: Fixed bug in testing of variable to ha_info() (Not critical) storage/heap/ha_heap.cc: Added braces around && to get rid of compiler warnings storage/maria/ha_maria.cc: Fixed bug: Mark that maria_log_dir_path is readonly Added braces around && to get rid of compiler warnings storage/ndb/include/ndbapi/NdbEventOperation.hpp: Removed const before function returning simple type storage/ndb/include/ndbapi/NdbOperation.hpp: Removed const before function returning simple type storage/ndb/src/ndbapi/Ndb.cpp: Added empty line before ; for empty while and for loops storage/ndb/src/ndbapi/NdbEventOperation.cpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbRecAttr.cpp: Added empty line before ; for empty while and for loops storage/ndb/src/ndbapi/TransporterFacade.hpp: Added braces around && to get rid of compiler warnings
Diffstat (limited to 'sql')
-rw-r--r--sql/event_db_repository.cc2
-rw-r--r--sql/events.cc2
-rw-r--r--sql/field.cc47
-rw-r--r--sql/field.h2
-rw-r--r--sql/field_conv.cc25
-rw-r--r--sql/gstream.cc2
-rw-r--r--sql/ha_ndbcluster.cc15
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/item.cc6
-rw-r--r--sql/item_cmpfunc.cc16
-rw-r--r--sql/item_func.cc4
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_subselect.cc8
-rw-r--r--sql/item_sum.cc12
-rw-r--r--sql/item_timefunc.cc11
-rw-r--r--sql/item_xmlfunc.cc9
-rw-r--r--sql/log.cc18
-rw-r--r--sql/log_event.cc15
-rw-r--r--sql/log_event_old.cc6
-rw-r--r--sql/opt_range.cc13
-rw-r--r--sql/opt_sum.cc4
-rw-r--r--sql/set_var.cc7
-rw-r--r--sql/slave.cc5
-rw-r--r--sql/spatial.h10
-rw-r--r--sql/sql_acl.cc33
-rw-r--r--sql/sql_analyse.cc3
-rw-r--r--sql/sql_base.cc34
-rw-r--r--sql/sql_connect.cc2
-rw-r--r--sql/sql_db.cc10
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_help.cc3
-rw-r--r--sql/sql_insert.cc9
-rw-r--r--sql/sql_lex.cc52
-rw-r--r--sql/sql_load.cc14
-rw-r--r--sql/sql_parse.cc6
-rw-r--r--sql/sql_partition.cc6
-rw-r--r--sql/sql_plugin.cc5
-rw-r--r--sql/sql_prepare.cc12
-rw-r--r--sql/sql_select.cc70
-rw-r--r--sql/sql_show.cc18
-rw-r--r--sql/sql_table.cc34
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_update.cc2
-rw-r--r--sql/sql_yacc.yy6
-rw-r--r--sql/table.cc79
-rw-r--r--sql/table.h4
-rw-r--r--sql/time.cc8
-rw-r--r--sql/tztime.cc4
-rw-r--r--sql/uniques.cc7
49 files changed, 351 insertions, 319 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index c26b740d24a..868e59a8777 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -711,7 +711,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
DBUG_ENTER("Event_db_repository::update_event");
/* None or both must be set */
- DBUG_ASSERT(new_dbname && new_name || new_dbname == new_name);
+ DBUG_ASSERT((new_dbname && new_name) || new_dbname == new_name);
/* Reset sql_mode during data dictionary operations. */
thd->variables.sql_mode= 0;
diff --git a/sql/events.cc b/sql/events.cc
index 73c76688eb7..d7443695f4a 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -932,7 +932,7 @@ Events::init(my_bool opt_noacl)
}
if (event_queue->init_queue(thd) || load_events_from_db(thd) ||
- opt_event_scheduler == EVENTS_ON && scheduler->start())
+ (opt_event_scheduler == EVENTS_ON && scheduler->start()))
{
sql_print_error("Event Scheduler: Error while loading from disk.");
res= TRUE; /* fatal error: request unireg_abort */
diff --git a/sql/field.cc b/sql/field.cc
index 637daee3acb..75f2fc7ac47 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1165,7 +1165,8 @@ bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len,
if (unsigned_flag)
{
- if (((ulonglong) *rnd > unsigned_max) && (*rnd= (longlong) unsigned_max) ||
+ if ((((ulonglong) *rnd > unsigned_max) &&
+ (*rnd= (longlong) unsigned_max)) ||
error == MY_ERRNO_ERANGE)
{
goto out_of_range;
@@ -1350,7 +1351,7 @@ void Field::copy_from_tmp(int row_offset)
if (null_ptr)
{
*null_ptr= (uchar) ((null_ptr[0] & (uchar) ~(uint) null_bit) |
- null_ptr[row_offset] & (uchar) null_bit);
+ (null_ptr[row_offset] & (uchar) null_bit));
}
}
@@ -4081,8 +4082,8 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
int error;
char *end;
double nr= my_strntod(cs,(char*) from,len,&end,&error);
- if (error || (!len || (uint) (end-from) != len &&
- table->in_use->count_cuted_fields))
+ if (error || (!len || ((uint) (end-from) != len &&
+ table->in_use->count_cuted_fields)))
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1);
@@ -4343,8 +4344,8 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
int error;
char *end;
double nr= my_strntod(cs,(char*) from, len, &end, &error);
- if (error || (!len || (uint) (end-from) != len &&
- table->in_use->count_cuted_fields))
+ if (error || (!len || ((uint) (end-from) != len &&
+ table->in_use->count_cuted_fields)))
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1);
@@ -5196,7 +5197,7 @@ int Field_time::store(longlong nr, bool unsigned_val)
MYSQL_TIMESTAMP_TIME, 1);
error= 1;
}
- else if (nr > (longlong) TIME_MAX_VALUE || nr < 0 && unsigned_val)
+ else if (nr > (longlong) TIME_MAX_VALUE || (nr < 0 && unsigned_val))
{
tmp= TIME_MAX_VALUE;
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -5361,7 +5362,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
int error;
longlong nr= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error);
- if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155 ||
+ if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155 ||
error == MY_ERRNO_ERANGE)
{
*ptr=0;
@@ -5405,7 +5406,7 @@ int Field_year::store(double nr)
int Field_year::store(longlong nr, bool unsigned_val)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
- if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155)
+ if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155)
{
*ptr= 0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
@@ -6427,16 +6428,22 @@ int Field_str::store(double nr)
/* Calculate the exponent from the 'e'-format conversion */
if (anr < 1.0 && anr > 0)
{
- for (exp= 0; anr < 1e-100; exp-= 100, anr*= 1e100);
- for (; anr < 1e-10; exp-= 10, anr*= 1e10);
- for (i= 1; anr < 1 / log_10[i]; exp--, i++);
+ for (exp= 0; anr < 1e-100; exp-= 100, anr*= 1e100)
+ ;
+ for (; anr < 1e-10; exp-= 10, anr*= 1e10)
+ ;
+ for (i= 1; anr < 1 / log_10[i]; exp--, i++)
+ ;
exp--;
}
else
{
- for (exp= 0; anr > 1e100; exp+= 100, anr/= 1e100);
- for (; anr > 1e10; exp+= 10, anr/= 1e10);
- for (i= 1; anr > log_10[i]; exp++, i++);
+ for (exp= 0; anr > 1e100; exp+= 100, anr/= 1e100)
+ ;
+ for (; anr > 1e10; exp+= 10, anr/= 1e10)
+ ;
+ for (i= 1; anr > log_10[i]; exp++, i++)
+ ;
}
max_length= local_char_length - neg;
@@ -8831,7 +8838,7 @@ bool Field_num::eq_def(Field *field)
Field_num *from_num= (Field_num*) field;
if (unsigned_flag != from_num->unsigned_flag ||
- zerofill && !from_num->zerofill && !zero_pack() ||
+ (zerofill && !from_num->zerofill && !zero_pack()) ||
dec != from_num->dec)
return 0;
return 1;
@@ -8972,7 +8979,8 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
ASSERT_COLUMN_MARKED_FOR_WRITE;
int delta;
- for (; length && !*from; from++, length--); // skip left 0's
+ for (; length && !*from; from++, length--) // skip left 0's
+ ;
delta= bytes_in_rec - length;
if (delta < -1 ||
@@ -9304,7 +9312,7 @@ Field_bit::unpack(uchar *to, const uchar *from, uint param_data,
and slave have the same sizes, then use the old unpack() method.
*/
if (param_data == 0 ||
- (from_bit_len == bit_len) && (from_len == bytes_in_rec))
+ ((from_bit_len == bit_len) && (from_len == bytes_in_rec)))
{
if (bit_len > 0)
{
@@ -9383,7 +9391,8 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
int delta;
uchar bits= (uchar) (field_length & 7);
- for (; length && !*from; from++, length--); // skip left 0's
+ for (; length && !*from; from++, length--) // skip left 0's
+ ;
delta= bytes_in_rec - length;
if (delta < 0 ||
diff --git a/sql/field.h b/sql/field.h
index 851bce2f07a..364d8fd22db 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -209,7 +209,7 @@ public:
memcpy(ptr, ptr + l_offset, pack_length());
if (null_ptr)
*null_ptr= ((*null_ptr & (uchar) ~null_bit) |
- null_ptr[l_offset] & null_bit);
+ (null_ptr[l_offset] & null_bit));
}
virtual bool binary() const { return 1; }
virtual bool zero_pack() const { return 1; }
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 11d0bb9cc82..ae690594718 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -99,7 +99,7 @@ static void do_field_to_null_str(Copy_field *copy)
static void do_outer_field_to_null_str(Copy_field *copy)
{
if (*copy->null_row ||
- copy->from_null_ptr && (*copy->from_null_ptr & copy->from_bit))
+ (copy->from_null_ptr && (*copy->from_null_ptr & copy->from_bit)))
{
bzero(copy->to_ptr,copy->from_length);
copy->to_null_ptr[0]=1; // Always bit 1
@@ -212,7 +212,7 @@ static void do_copy_null(Copy_field *copy)
static void do_outer_field_null(Copy_field *copy)
{
if (*copy->null_row ||
- copy->from_null_ptr && (*copy->from_null_ptr & copy->from_bit))
+ (copy->from_null_ptr && (*copy->from_null_ptr & copy->from_bit)))
{
*copy->to_null_ptr|=copy->to_bit;
copy->to_field->reset();
@@ -667,8 +667,8 @@ Copy_field::get_copy_func(Field *to,Field *from)
!compatible_db_low_byte_first ||
((to->table->in_use->variables.sql_mode &
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | MODE_INVALID_DATES)) &&
- to->type() == MYSQL_TYPE_DATE ||
- to->type() == MYSQL_TYPE_DATETIME))
+ (to->type() == MYSQL_TYPE_DATE ||
+ to->type() == MYSQL_TYPE_DATETIME)))
{
if (from->real_type() == MYSQL_TYPE_ENUM ||
from->real_type() == MYSQL_TYPE_SET)
@@ -684,8 +684,7 @@ Copy_field::get_copy_func(Field *to,Field *from)
if (from->real_type() == MYSQL_TYPE_ENUM &&
to->real_type() == MYSQL_TYPE_ENUM)
return do_field_enum;
- else
- return do_field_string;
+ return do_field_string;
}
}
else if (to->charset() != from->charset())
@@ -709,10 +708,8 @@ Copy_field::get_copy_func(Field *to,Field *from)
{
if (to->charset() == &my_charset_bin)
return do_expand_binary;
- else
- return do_expand_string;
+ return do_expand_string;
}
-
}
else if (to->real_type() != from->real_type() ||
to_length != from_length ||
@@ -738,7 +735,7 @@ Copy_field::get_copy_func(Field *to,Field *from)
}
}
}
- /* Eq fields */
+ /* Identical field types */
switch (to_length) {
case 1: return do_field_1;
case 2: return do_field_2;
@@ -764,14 +761,14 @@ int field_conv(Field *to,Field *from)
to->real_type() != MYSQL_TYPE_SET &&
to->real_type() != MYSQL_TYPE_BIT &&
(to->real_type() != MYSQL_TYPE_NEWDECIMAL ||
- (to->field_length == from->field_length &&
- (((Field_num*)to)->dec == ((Field_num*)from)->dec))) &&
+ ((to->field_length == from->field_length &&
+ (((Field_num*)to)->dec == ((Field_num*)from)->dec)))) &&
from->charset() == to->charset() &&
to->table->s->db_low_byte_first == from->table->s->db_low_byte_first &&
(!(to->table->in_use->variables.sql_mode &
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | MODE_INVALID_DATES)) ||
- to->type() != MYSQL_TYPE_DATE &&
- to->type() != MYSQL_TYPE_DATETIME) &&
+ (to->type() != MYSQL_TYPE_DATE &&
+ to->type() != MYSQL_TYPE_DATETIME)) &&
(from->real_type() != MYSQL_TYPE_VARCHAR ||
((Field_varstring*)from)->length_bytes ==
((Field_varstring*)to)->length_bytes))
diff --git a/sql/gstream.cc b/sql/gstream.cc
index 0c8011549f3..e2bb41b8541 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -75,7 +75,7 @@ bool Gis_read_stream::get_next_number(double *d)
skip_space();
if ((m_cur >= m_limit) ||
- (*m_cur < '0' || *m_cur > '9') && *m_cur != '-' && *m_cur != '+')
+ ((*m_cur < '0' || *m_cur > '9') && *m_cur != '-' && *m_cur != '+'))
{
set_error_msg("Numeric constant expected");
return 1;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index ea5b340c970..6fb16912f3a 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1293,10 +1293,12 @@ int ha_ndbcluster::open_indexes(Ndb *ndb, TABLE *tab, bool ignore_error)
for (i= 0; i < tab->s->keys; i++, key_info++, key_name++)
{
if ((error= add_index_handle(thd, dict, key_info, *key_name, i)))
+ {
if (ignore_error)
m_index[i].index= m_index[i].unique_index= NULL;
else
break;
+ }
m_index[i].null_in_unique_index= FALSE;
if (check_index_fields_not_null(key_info))
m_index[i].null_in_unique_index= TRUE;
@@ -6261,9 +6263,10 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
for (;;)
{
Ndb_tuple_id_range_guard g(m_share);
- if (m_skip_auto_increment &&
- ndb->readAutoIncrementValue(m_table, g.range, auto_value) ||
- ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size, increment, offset))
+ if ((m_skip_auto_increment &&
+ ndb->readAutoIncrementValue(m_table, g.range, auto_value)) ||
+ ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size,
+ increment, offset))
{
if (--retries &&
ndb->getNdbError().status == NdbError::TemporaryError)
@@ -9914,8 +9917,10 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
{
Field *field= table->field[i];
const NDBCOL *col= tab->getColumn(i);
- if (col->getStorageType() == NDB_STORAGETYPE_MEMORY && create_info->storage_media != HA_SM_MEMORY ||
- col->getStorageType() == NDB_STORAGETYPE_DISK && create_info->storage_media != HA_SM_DISK)
+ if ((col->getStorageType() == NDB_STORAGETYPE_MEMORY &&
+ create_info->storage_media != HA_SM_MEMORY) ||
+ (col->getStorageType() == NDB_STORAGETYPE_DISK &&
+ create_info->storage_media != HA_SM_DISK))
{
DBUG_PRINT("info", ("Column storage media is changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
diff --git a/sql/handler.cc b/sql/handler.cc
index aad50d12cdb..044e47b3f6d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2266,8 +2266,8 @@ int handler::update_auto_increment()
DBUG_ASSERT(next_insert_id >= auto_inc_interval_for_cur_row.minimum());
if ((nr= table->next_number_field->val_int()) != 0 ||
- table->auto_increment_field_not_null &&
- thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
+ (table->auto_increment_field_not_null &&
+ thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO))
{
/*
Update next_insert_id if we had already generated a value in this
diff --git a/sql/item.cc b/sql/item.cc
index d630ca7bc60..2882c3cc28a 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2624,7 +2624,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
if (value.time.year > 9999 || value.time.month > 12 ||
value.time.day > 31 ||
- time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 ||
+ (time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) ||
value.time.minute > 59 || value.time.second > 59)
{
char buff[MAX_DATE_STRING_REP_LENGTH];
@@ -4836,8 +4836,8 @@ int Item::save_in_field(Field *field, bool no_conversions)
{
int error;
if (result_type() == STRING_RESULT ||
- result_type() == REAL_RESULT &&
- field->result_type() == STRING_RESULT)
+ (result_type() == REAL_RESULT &&
+ field->result_type() == STRING_RESULT))
{
String *result;
CHARSET_INFO *cs= collation.collation;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 66c6e748387..adcc2e352db 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1478,8 +1478,8 @@ longlong Item_func_truth::val_int()
bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
{
- if (!args[0]->fixed && args[0]->fix_fields(thd, args) ||
- !cache && !(cache= Item_cache::get_cache(args[0])))
+ if ((!args[0]->fixed && args[0]->fix_fields(thd, args)) ||
+ (!cache && !(cache= Item_cache::get_cache(args[0]))))
return 1;
cache->setup(args[0]);
@@ -2990,19 +2990,19 @@ int cmp_longlong(void *cmp_arg,
One of the args is unsigned and is too big to fit into the
positive signed range. Report no match.
*/
- if (a->unsigned_flag && ((ulonglong) a->val) > (ulonglong) LONGLONG_MAX ||
- b->unsigned_flag && ((ulonglong) b->val) > (ulonglong) LONGLONG_MAX)
+ if ((a->unsigned_flag && ((ulonglong) a->val) > (ulonglong) LONGLONG_MAX)
+ ||
+ (b->unsigned_flag && ((ulonglong) b->val) > (ulonglong) LONGLONG_MAX))
return a->unsigned_flag ? 1 : -1;
/*
Although the signedness differs both args can fit into the signed
positive range. Make them signed and compare as usual.
*/
- return cmp_longs (a->val, b->val);
+ return cmp_longs(a->val, b->val);
}
if (a->unsigned_flag)
- return cmp_ulongs ((ulonglong) a->val, (ulonglong) b->val);
- else
- return cmp_longs (a->val, b->val);
+ return cmp_ulongs((ulonglong) a->val, (ulonglong) b->val);
+ return cmp_longs(a->val, b->val);
}
static int cmp_double(void *cmp_arg, double *a,double *b)
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 18d4367350c..1f3af312321 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4405,8 +4405,8 @@ int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions,
update();
if (result_type() == STRING_RESULT ||
- result_type() == REAL_RESULT &&
- field->result_type() == STRING_RESULT)
+ (result_type() == REAL_RESULT &&
+ field->result_type() == STRING_RESULT))
{
String *result;
CHARSET_INFO *cs= collation.collation;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bbcf76658bd..5f70bff595a 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -510,7 +510,7 @@ String *Item_func_des_encrypt::val_str(String *str)
tail= (8-(res_length) % 8); // 1..8 marking extra length
res_length+=tail;
code= ER_OUT_OF_RESOURCES;
- if (tail && res->append(append_str, tail) || tmp_value.alloc(res_length+1))
+ if ((tail && res->append(append_str, tail)) || tmp_value.alloc(res_length+1))
goto error;
(*res)[res_length-1]=tail; // save extra length
tmp_value.length(res_length+1);
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index dcb2a364996..04d4acc16a3 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1314,8 +1314,8 @@ Item_in_subselect::row_value_transformer(JOIN *join)
Item *item_having_part2= 0;
for (uint i= 0; i < cols_num; i++)
{
- DBUG_ASSERT(left_expr->fixed &&
- select_lex->ref_pointer_array[i]->fixed ||
+ DBUG_ASSERT((left_expr->fixed &&
+ select_lex->ref_pointer_array[i]->fixed) ||
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
Item_ref::OUTER_REF));
@@ -1392,8 +1392,8 @@ Item_in_subselect::row_value_transformer(JOIN *join)
for (uint i= 0; i < cols_num; i++)
{
Item *item, *item_isnull;
- DBUG_ASSERT(left_expr->fixed &&
- select_lex->ref_pointer_array[i]->fixed ||
+ DBUG_ASSERT((left_expr->fixed &&
+ select_lex->ref_pointer_array[i]->fixed) ||
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
Item_ref::OUTER_REF));
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c2b3b954634..1b399ede327 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -654,8 +654,8 @@ 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 +981,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;
@@ -2640,8 +2640,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
enum enum_field_types f_type= f->type();
tree_key_length+= f->pack_length();
if ((f_type == MYSQL_TYPE_VARCHAR) ||
- !f->binary() && (f_type == MYSQL_TYPE_STRING ||
- f_type == MYSQL_TYPE_VAR_STRING))
+ (!f->binary() && (f_type == MYSQL_TYPE_STRING ||
+ f_type == MYSQL_TYPE_VAR_STRING)))
{
all_binary= FALSE;
break;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 843a48ae118..a584f983516 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -446,7 +446,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
strict_week_number= (*ptr=='V' || *ptr=='v');
tmp= (char*) val + min(val_len, 2);
if ((week_number= (int) my_strtoll10(val, &tmp, &error)) < 0 ||
- strict_week_number && !week_number ||
+ (strict_week_number && !week_number) ||
week_number > 53)
goto err;
val= tmp;
@@ -542,10 +542,11 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
%V,%v require %X,%x resprectively,
%U,%u should be used with %Y and not %X or %x
*/
- if (strict_week_number &&
- (strict_week_number_year < 0 ||
- strict_week_number_year_type != sunday_first_n_first_week_non_iso) ||
- !strict_week_number && strict_week_number_year >= 0)
+ if ((strict_week_number &&
+ (strict_week_number_year < 0 ||
+ strict_week_number_year_type !=
+ sunday_first_n_first_week_non_iso)) ||
+ (!strict_week_number && strict_week_number_year >= 0))
goto err;
/* Number of days since year 0 till 1st Jan of this year */
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 0e13830a3b1..8494b4308eb 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1354,7 +1354,8 @@ my_xpath_lex_scan(MY_XPATH *xpath,
MY_XPATH_LEX *lex, const char *beg, const char *end)
{
int ch, ctype, length;
- for ( ; beg < end && *beg == ' ' ; beg++); // skip leading spaces
+ for ( ; beg < end && *beg == ' ' ; beg++) // skip leading spaces
+ ;
lex->beg= beg;
if (beg >= end)
@@ -1423,7 +1424,8 @@ my_xpath_lex_scan(MY_XPATH *xpath,
if (my_xdigit(ch)) // a sequence of digits
{
- for ( ; beg < end && my_xdigit(*beg) ; beg++);
+ for ( ; beg < end && my_xdigit(*beg) ; beg++)
+ ;
lex->end= beg;
lex->term= MY_XPATH_LEX_DIGITS;
return;
@@ -1431,7 +1433,8 @@ my_xpath_lex_scan(MY_XPATH *xpath,
if (ch == '"' || ch == '\'') // a string: either '...' or "..."
{
- for ( ; beg < end && *beg != ch ; beg++);
+ for ( ; beg < end && *beg != ch ; beg++)
+ ;
if (beg < end)
{
lex->end= beg+1;
diff --git a/sql/log.cc b/sql/log.cc
index c77882b5672..aa027108490 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1546,11 +1546,11 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
YESNO(thd->transaction.stmt.modified_non_trans_table)));
if (thd->options & OPTION_BIN_LOG)
{
- if (in_transaction &&
- (all ||
- (!trx_data->at_least_one_stmt &&
- thd->transaction.stmt.modified_non_trans_table)) ||
- !in_transaction && !all)
+ if ((in_transaction &&
+ (all ||
+ (!trx_data->at_least_one_stmt &&
+ thd->transaction.stmt.modified_non_trans_table))) ||
+ (!in_transaction && !all))
{
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
@@ -1596,8 +1596,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
YESNO(all),
YESNO(thd->transaction.all.modified_non_trans_table),
YESNO(thd->transaction.stmt.modified_non_trans_table)));
- if (all && thd->transaction.all.modified_non_trans_table ||
- !all && thd->transaction.stmt.modified_non_trans_table ||
+ if ((all && thd->transaction.all.modified_non_trans_table) ||
+ (!all && thd->transaction.stmt.modified_non_trans_table) ||
(thd->options & OPTION_KEEP_LOG))
{
/*
@@ -1612,8 +1612,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
error= binlog_end_trans(thd, trx_data, &qev, all);
}
- else if (all && !thd->transaction.all.modified_non_trans_table ||
- !all && !thd->transaction.stmt.modified_non_trans_table)
+ else if ((all && !thd->transaction.all.modified_non_trans_table) ||
+ (!all && !thd->transaction.stmt.modified_non_trans_table))
{
/*
If we have modified only transactional tables, we can truncate
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 686a7e6434e..87fe707ac09 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -725,13 +725,12 @@ Log_event::do_shall_skip(Relay_log_info *rli)
(ulong) server_id, (ulong) ::server_id,
rli->replicate_same_server_id,
rli->slave_skip_counter));
- if (server_id == ::server_id && !rli->replicate_same_server_id ||
- rli->slave_skip_counter == 1 && rli->is_in_group())
+ if ((server_id == ::server_id && !rli->replicate_same_server_id) ||
+ (rli->slave_skip_counter == 1 && rli->is_in_group()))
return EVENT_SKIP_IGNORE;
- else if (rli->slave_skip_counter > 0)
+ if (rli->slave_skip_counter > 0)
return EVENT_SKIP_COUNT;
- else
- return EVENT_SKIP_NOT;
+ return EVENT_SKIP_NOT;
}
@@ -6758,8 +6757,8 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
solution, to be able to terminate a started statement in the
binary log: the extraneous events will be removed in the future.
*/
- DBUG_ASSERT(tbl_arg && tbl_arg->s && tid != ~0UL ||
- !tbl_arg && !cols && tid == ~0UL);
+ DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) ||
+ (!tbl_arg && !cols && tid == ~0UL));
if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS)
set_flags(NO_FOREIGN_KEY_CHECKS_F);
@@ -6951,7 +6950,7 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length)
#endif
DBUG_ASSERT(m_rows_buf <= m_rows_cur);
- DBUG_ASSERT(!m_rows_buf || m_rows_end && m_rows_buf < m_rows_end);
+ DBUG_ASSERT(!m_rows_buf || (m_rows_end && m_rows_buf < m_rows_end));
DBUG_ASSERT(m_rows_cur <= m_rows_end);
/* The cast will always work since m_rows_cur <= m_rows_end */
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 6ee2a4549e6..cc4d24bc2dd 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1245,8 +1245,8 @@ Old_rows_log_event::Old_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
solution, to be able to terminate a started statement in the
binary log: the extraneous events will be removed in the future.
*/
- DBUG_ASSERT(tbl_arg && tbl_arg->s && tid != ~0UL ||
- !tbl_arg && !cols && tid == ~0UL);
+ DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) ||
+ (!tbl_arg && !cols && tid == ~0UL));
if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS)
set_flags(NO_FOREIGN_KEY_CHECKS_F);
@@ -1409,7 +1409,7 @@ int Old_rows_log_event::do_add_row_data(uchar *row_data, size_t length)
#endif
DBUG_ASSERT(m_rows_buf <= m_rows_cur);
- DBUG_ASSERT(!m_rows_buf || m_rows_end && m_rows_buf < m_rows_end);
+ DBUG_ASSERT(!m_rows_buf || (m_rows_end && m_rows_buf < m_rows_end));
DBUG_ASSERT(m_rows_cur <= m_rows_end);
/* The cast will always work since m_rows_cur <= m_rows_end */
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bafc368e415..c9311cdf398 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3754,8 +3754,9 @@ 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->stats.records) &&
- read_time != DBL_MAX)
+ ((non_cpk_scan_records+cpk_scan_records >=
+ param->table->file->stats.records) &&
+ read_time != DBL_MAX))
{
/*
Bail out if it is obvious that both index_merge and ROR-union will be
@@ -7927,7 +7928,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
goto err;
quick->records= records;
- if (cp_buffer_from_ref(thd, table, ref) && thd->is_fatal_error ||
+ if ((cp_buffer_from_ref(thd, table, ref) && thd->is_fatal_error) ||
!(range= new(alloc) QUICK_RANGE()))
goto err; // out of memory
@@ -8803,7 +8804,7 @@ int QUICK_RANGE_SELECT::cmp_prev(QUICK_RANGE *range_arg)
cmp= key_cmp(key_part_info, 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
}
@@ -10856,7 +10857,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;
@@ -10974,7 +10975,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;
}
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index f0f856c3c6a..f03915bf38f 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -744,8 +744,8 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
}
else if (eq_type)
{
- if (!is_null && !cond->val_int() ||
- is_null && !test(part->field->is_null()))
+ if ((!is_null && !cond->val_int()) ||
+ (is_null && !test(part->field->is_null())))
return 0; // Impossible test
}
else if (is_field_part)
diff --git a/sql/set_var.cc b/sql/set_var.cc
index b74142f6a62..640c0fe7291 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -3263,7 +3263,8 @@ int set_var_init()
uint count= 0;
DBUG_ENTER("set_var_init");
- for (sys_var *var=vars.first; var; var= var->next, count++);
+ for (sys_var *var=vars.first; var; var= var->next, count++)
+ ;
if (hash_init(&system_variable_hash, system_charset_info, count, 0,
0, (hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
@@ -4000,10 +4001,10 @@ bool sys_var_opt_readonly::update(THD *thd, set_var *var)
can cause to wait on a read lock, it's required for the client application
to unlock everything, and acceptable for the server to wait on all locks.
*/
- if (result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE))
+ if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE)))
goto end_with_read_lock;
- if (result= make_global_read_lock_block_commit(thd))
+ if ((result= make_global_read_lock_block_commit(thd)))
goto end_with_read_lock;
/* Change the opt_readonly system variable, safe because the lock is held */
diff --git a/sql/slave.cc b/sql/slave.cc
index 43b70f29a68..62aeec03ebb 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -773,7 +773,8 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
up to and including newline.
*/
int c;
- while (((c=my_b_get(f)) != '\n' && c != my_b_EOF));
+ while (((c=my_b_get(f)) != '\n' && c != my_b_EOF))
+ ;
}
DBUG_RETURN(0);
}
@@ -2187,7 +2188,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
"the slave_transaction_retries variable.",
slave_trans_retries);
}
- else if (exec_res && !temp_err ||
+ else if ((exec_res && !temp_err) ||
(opt_using_transactions &&
rli->group_relay_log_pos == rli->event_relay_log_pos))
{
diff --git a/sql/spatial.h b/sql/spatial.h
index f806861290e..69a1f24506e 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -116,12 +116,12 @@ struct MBR
int touches(const MBR *mbr)
{
/* The following should be safe, even if we compare doubles */
- return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
- ((mbr->ymin >= ymin) && (mbr->ymin <= ymax) ||
- (mbr->ymax >= ymin) && (mbr->ymax <= ymax))) ||
+ return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
+ (((mbr->ymin >= ymin) && (mbr->ymin <= ymax)) ||
+ ((mbr->ymax >= ymin) && (mbr->ymax <= ymax)))) ||
(((mbr->ymin == ymax) || (mbr->ymax == ymin)) &&
- ((mbr->xmin >= xmin) && (mbr->xmin <= xmax) ||
- (mbr->xmax >= xmin) && (mbr->xmax <= xmax))));
+ (((mbr->xmin >= xmin) && (mbr->xmin <= xmax)) ||
+ ((mbr->xmax >= xmin) && (mbr->xmax <= xmax)))));
}
int within(const MBR *mbr)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f91971717be..ed41ff90cbc 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1185,12 +1185,12 @@ static void acl_update_user(const char *user, const char *host,
for (uint i=0 ; i < acl_users.elements ; i++)
{
ACL_USER *acl_user=dynamic_element(&acl_users,i,ACL_USER*);
- if (!acl_user->user && !user[0] ||
- acl_user->user && !strcmp(user,acl_user->user))
+ if ((!acl_user->user && !user[0]) ||
+ (acl_user->user && !strcmp(user,acl_user->user)))
{
- if (!acl_user->host.hostname && !host[0] ||
- acl_user->host.hostname &&
- !my_strcasecmp(system_charset_info, host, acl_user->host.hostname))
+ if ((!acl_user->host.hostname && !host[0]) ||
+ (acl_user->host.hostname &&
+ !my_strcasecmp(system_charset_info, host, acl_user->host.hostname)))
{
acl_user->access=privileges;
if (mqh->specified_limits & USER_RESOURCES::QUERIES_PER_HOUR)
@@ -1268,16 +1268,15 @@ static void acl_update_db(const char *user, const char *host, const char *db,
for (uint i=0 ; i < acl_dbs.elements ; i++)
{
ACL_DB *acl_db=dynamic_element(&acl_dbs,i,ACL_DB*);
- if (!acl_db->user && !user[0] ||
- acl_db->user &&
- !strcmp(user,acl_db->user))
+ if ((!acl_db->user && !user[0]) ||
+ (acl_db->user && !strcmp(user,acl_db->user)))
{
- if (!acl_db->host.hostname && !host[0] ||
- acl_db->host.hostname &&
- !strcmp(host, acl_db->host.hostname))
+ if ((!acl_db->host.hostname && !host[0]) ||
+ (acl_db->host.hostname &&
+ !strcmp(host, acl_db->host.hostname)))
{
- if (!acl_db->db && !db[0] ||
- acl_db->db && !strcmp(db,acl_db->db))
+ if ((!acl_db->db && !db[0]) ||
+ (acl_db->db && !strcmp(db,acl_db->db)))
{
if (privileges)
acl_db->access=privileges;
@@ -1486,8 +1485,8 @@ bool acl_check_host(const char *host, const char *ip)
return 0;
VOID(pthread_mutex_lock(&acl_cache->lock));
- if (host && hash_search(&acl_check_hosts,(uchar*) host,strlen(host)) ||
- ip && hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip)))
+ if ((host && hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) ||
+ (ip && hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip))))
{
VOID(pthread_mutex_unlock(&acl_cache->lock));
return 0; // Found host
@@ -1703,8 +1702,8 @@ find_acl_user(const char *host, const char *user, my_bool exact)
host,
acl_user->host.hostname ? acl_user->host.hostname :
""));
- if (!acl_user->user && !user[0] ||
- acl_user->user && !strcmp(user,acl_user->user))
+ if ((!acl_user->user && !user[0]) ||
+ (acl_user->user && !strcmp(user,acl_user->user)))
{
if (exact ? !my_strcasecmp(system_charset_info, host,
acl_user->host.hostname ?
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 9ca6e0a0a2b..2c6937d29b7 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -246,7 +246,8 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
}
DBUG_RETURN(0);
}
- for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
+ for (str++; *(end - 1) == '0'; end--) // jump over zeros at the end
+ ;
if (str == end) // number was something like '123.000'
{
char *endpos= (char*) str;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4affca4434d..bf45bb648bd 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -473,8 +473,8 @@ static TABLE_SHARE
@todo Rework alternative ways to deal with ER_NO_SUCH TABLE.
*/
- if (share || thd->is_error() && thd->main_da.sql_errno() != ER_NO_SUCH_TABLE)
-
+ if (share ||
+ (thd->is_error() && thd->main_da.sql_errno() != ER_NO_SUCH_TABLE))
DBUG_RETURN(share);
/* Table didn't exist. Check if some engine can provide it */
@@ -2625,8 +2625,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
distance > 0 - we have lock mode higher then we require
distance == 0 - we have lock mode exactly which we need
*/
- if (best_distance < 0 && distance > best_distance ||
- distance >= 0 && distance < best_distance)
+ if ((best_distance < 0 && distance > best_distance) ||
+ (distance >= 0 && distance < best_distance))
{
best_distance= distance;
best_table= table;
@@ -7409,7 +7409,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
thd->lex->current_select->cur_pos_in_select_list= 0;
while ((item= it++))
{
- if (!item->fixed && item->fix_fields(thd, it.ref()) ||
+ if ((!item->fixed && item->fix_fields(thd, it.ref())) ||
(item= *(it.ref()))->check_cols(1))
{
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
@@ -7723,8 +7723,8 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
DBUG_ASSERT(tables->is_leaf_for_name_resolution());
- if (table_name && my_strcasecmp(table_alias_charset, table_name,
- tables->alias) ||
+ if ((table_name && my_strcasecmp(table_alias_charset, table_name,
+ tables->alias)) ||
(db_name && strcmp(tables->db,db_name)))
continue;
@@ -7755,8 +7755,8 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
information_schema table, or a nested table reference. See the comment
for TABLE_LIST.
*/
- if (!(table && !tables->view && (table->grant.privilege & SELECT_ACL) ||
- tables->view && (tables->grant.privilege & SELECT_ACL)) &&
+ if (!((table && !tables->view && (table->grant.privilege & SELECT_ACL)) ||
+ (tables->view && (tables->grant.privilege & SELECT_ACL))) &&
!any_privileges)
{
field_iterator.set(tables);
@@ -7810,7 +7810,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
*/
if (any_privileges)
{
- DBUG_ASSERT(tables->field_translation == NULL && table ||
+ DBUG_ASSERT((tables->field_translation == NULL && table) ||
tables->is_natural_join);
DBUG_ASSERT(item->type() == Item::FIELD_ITEM);
Item_field *fld= (Item_field*) item;
@@ -7949,7 +7949,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
if (*conds)
{
thd->where="where clause";
- if (!(*conds)->fixed && (*conds)->fix_fields(thd, conds) ||
+ if ((!(*conds)->fixed && (*conds)->fix_fields(thd, conds)) ||
(*conds)->check_cols(1))
goto err_no_arena;
}
@@ -7969,8 +7969,8 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
{
/* Make a join an a expression */
thd->where="on clause";
- if (!embedded->on_expr->fixed &&
- embedded->on_expr->fix_fields(thd, &embedded->on_expr) ||
+ if ((!embedded->on_expr->fixed &&
+ embedded->on_expr->fix_fields(thd, &embedded->on_expr)) ||
embedded->on_expr->check_cols(1))
goto err_no_arena;
select_lex->cond_count++;
@@ -8125,8 +8125,8 @@ fill_record_n_invoke_before_triggers(THD *thd, List<Item> &fields,
enum trg_event_type event)
{
return (fill_record(thd, fields, values, ignore_errors) ||
- triggers && triggers->process_triggers(thd, event,
- TRG_ACTION_BEFORE, TRUE));
+ (triggers && triggers->process_triggers(thd, event,
+ TRG_ACTION_BEFORE, TRUE)));
}
@@ -8220,8 +8220,8 @@ fill_record_n_invoke_before_triggers(THD *thd, Field **ptr,
enum trg_event_type event)
{
return (fill_record(thd, ptr, values, ignore_errors) ||
- triggers && triggers->process_triggers(thd, event,
- TRG_ACTION_BEFORE, TRUE));
+ (triggers && triggers->process_triggers(thd, event,
+ TRG_ACTION_BEFORE, TRUE)));
}
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index d9fb586eb77..931ac5d1336 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -985,7 +985,7 @@ static void end_connection(THD *thd)
if (thd->user_connect)
decrease_user_connections(thd->user_connect);
- if (thd->killed || net->error && net->vio != 0)
+ if (thd->killed || (net->error && net->vio != 0))
{
statistic_increment(aborted_threads,&LOCK_status);
}
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index c538dfb08bc..83d78ab9852 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1444,13 +1444,9 @@ static inline bool
cmp_db_names(const char *db1_name,
const char *db2_name)
{
- return
- /* db1 is NULL and db2 is NULL */
- !db1_name && !db2_name ||
-
- /* db1 is not-NULL, db2 is not-NULL, db1 == db2. */
- db1_name && db2_name &&
- my_strcasecmp(system_charset_info, db1_name, db2_name) == 0;
+ return ((!db1_name && !db2_name) || /* db1 is NULL and db2 is NULL */
+ (db1_name && db2_name &&
+ my_strcasecmp(system_charset_info, db1_name, db2_name) == 0));
}
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 47d2d69ef35..6a400a4f197 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -760,7 +760,7 @@ void multi_delete::abort()
/* the error was handled or nothing deleted and no side effects return */
if (error_handled ||
- !thd->transaction.stmt.modified_non_trans_table && !deleted)
+ (!thd->transaction.stmt.modified_non_trans_table && !deleted))
DBUG_VOID_RETURN;
/* Something already deleted so we have to invalidate cache */
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index f51ad318568..7eff6a5e0fa 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -526,7 +526,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol,
String **end= pointers + names->elements;
List_iterator<String> it(*names);
- for (pos= pointers; pos!=end; (*pos++= it++));
+ for (pos= pointers; pos!=end; (*pos++= it++))
+ ;
my_qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index b10a7789079..0c3ea8bd731 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -413,7 +413,7 @@ void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
bool is_multi_insert)
{
if (duplic == DUP_UPDATE ||
- duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT)
+ (duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT))
{
*lock_type= TL_WRITE_DEFAULT;
return;
@@ -882,8 +882,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
*/
query_cache_invalidate3(thd, table_list, 1);
}
- if (changed && error <= 0 || thd->transaction.stmt.modified_non_trans_table
- || was_insert_delayed)
+ if ((changed && error <= 0) ||
+ thd->transaction.stmt.modified_non_trans_table ||
+ was_insert_delayed)
{
if (mysql_bin_log.is_open())
{
@@ -3187,7 +3188,7 @@ bool select_insert::send_eof()
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- if (changed= (info.copied || info.deleted || info.updated))
+ if ((changed= (info.copied || info.deleted || info.updated)))
{
/*
We must invalidate the table in the query cache before binlog writing
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 983d53a041d..82b4481200b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -801,7 +801,8 @@ int MYSQLlex(void *arg, void *yythd)
its value in a query for the binlog, the query must stay
grammatically correct.
*/
- if (c == '?' && lip->stmt_prepare_mode && !ident_map[lip->yyPeek()])
+ if (c == '?' && lip->stmt_prepare_mode &&
+ !ident_map[(uchar) lip->yyPeek()])
return(PARAM_MARKER);
}
@@ -869,7 +870,10 @@ int MYSQLlex(void *arg, void *yythd)
else
#endif
{
- for (result_state= c; ident_map[c= lip->yyGet()]; result_state|= c);
+ for (result_state= c;
+ ident_map[(uchar) (c= lip->yyGet())];
+ result_state|= c)
+ ;
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
@@ -881,9 +885,11 @@ int MYSQLlex(void *arg, void *yythd)
If we find a space then this can't be an identifier. We notice this
below by checking start != lex->ptr.
*/
- for (; state_map[c] == MY_LEX_SKIP ; c= lip->yyGet());
+ for (; state_map[(uchar) c] == MY_LEX_SKIP ; c= lip->yyGet())
+ ;
}
- if (start == lip->get_ptr() && c == '.' && ident_map[lip->yyPeek()])
+ if (start == lip->get_ptr() && c == '.' &&
+ ident_map[(uchar) lip->yyPeek()])
lip->next_state=MY_LEX_IDENT_SEP;
else
{ // '(' must follow directly if function
@@ -926,12 +932,12 @@ int MYSQLlex(void *arg, void *yythd)
return(result_state); // IDENT or IDENT_QUOTED
- case MY_LEX_IDENT_SEP: // Found ident and now '.'
+ case MY_LEX_IDENT_SEP: // Found ident and now '.'
yylval->lex_str.str= (char*) lip->get_ptr();
yylval->lex_str.length= 1;
- c= lip->yyGet(); // should be '.'
- lip->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword)
- if (!ident_map[lip->yyPeek()]) // Probably ` or "
+ c= lip->yyGet(); // should be '.'
+ lip->next_state= MY_LEX_IDENT_START; // Next is ident (not keyword)
+ if (!ident_map[(uchar) lip->yyPeek()]) // Probably ` or "
lip->next_state= MY_LEX_START;
return((int) c);
@@ -954,7 +960,8 @@ int MYSQLlex(void *arg, void *yythd)
}
else if (c == 'b')
{
- while ((c= lip->yyGet()) == '0' || c == '1');
+ while ((c= lip->yyGet()) == '0' || c == '1')
+ ;
if ((lip->yyLength() >= 3) && !ident_map[c])
{
/* Skip '0b' */
@@ -1013,11 +1020,12 @@ int MYSQLlex(void *arg, void *yythd)
else
#endif
{
- for (result_state=0; ident_map[c= lip->yyGet()]; result_state|= c);
+ for (result_state=0; ident_map[c= lip->yyGet()]; result_state|= c)
+ ;
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
- if (c == '.' && ident_map[lip->yyPeek()])
+ if (c == '.' && ident_map[(uchar) lip->yyPeek()])
lip->next_state=MY_LEX_IDENT_SEP;// Next is '.'
yylval->lex_str= get_token(lip, 0, lip->yyLength());
@@ -1113,7 +1121,8 @@ int MYSQLlex(void *arg, void *yythd)
case MY_LEX_BIN_NUMBER: // Found b'bin-string'
lip->yySkip(); // Accept opening '
- while ((c= lip->yyGet()) == '0' || c == '1');
+ while ((c= lip->yyGet()) == '0' || c == '1')
+ ;
if (c != '\'')
return(ABORT_SYM); // Illegal hex constant
lip->yySkip(); // Accept closing '
@@ -1124,8 +1133,8 @@ int MYSQLlex(void *arg, void *yythd)
return (BIN_NUM);
case MY_LEX_CMP_OP: // Incomplete comparison operator
- if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP ||
- state_map[lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
+ if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP ||
+ state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
lip->yySkip();
if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
{
@@ -1136,11 +1145,11 @@ int MYSQLlex(void *arg, void *yythd)
break;
case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator
- if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP ||
- state_map[lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
+ if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP ||
+ state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
{
lip->yySkip();
- if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP)
+ if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP)
lip->yySkip();
}
if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
@@ -1351,7 +1360,7 @@ int MYSQLlex(void *arg, void *yythd)
}
break;
case MY_LEX_USER_END: // end '@' of user@hostname
- switch (state_map[lip->yyPeek()]) {
+ switch (state_map[(uchar) lip->yyPeek()]) {
case MY_LEX_STRING:
case MY_LEX_USER_VARIABLE_DELIMITER:
case MY_LEX_STRING_OR_DELIMITER:
@@ -1376,7 +1385,7 @@ int MYSQLlex(void *arg, void *yythd)
yylval->lex_str.str=(char*) lip->get_ptr();
yylval->lex_str.length=1;
lip->yySkip(); // Skip '@'
- lip->next_state= (state_map[lip->yyPeek()] ==
+ lip->next_state= (state_map[(uchar) lip->yyPeek()] ==
MY_LEX_USER_VARIABLE_DELIMITER ?
MY_LEX_OPERATOR_OR_IDENT :
MY_LEX_IDENT_OR_KEYWORD);
@@ -1388,7 +1397,8 @@ int MYSQLlex(void *arg, void *yythd)
[(global | local | session) .]variable_name
*/
- for (result_state= 0; ident_map[c= lip->yyGet()]; result_state|= c);
+ for (result_state= 0; ident_map[c= lip->yyGet()]; result_state|= c)
+ ;
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
@@ -2002,7 +2012,7 @@ void st_select_lex::print_limit(THD *thd,
item->substype() == Item_subselect::ALL_SUBS))
{
DBUG_ASSERT(!item->fixed ||
- select_limit->val_int() == LL(1) && offset_limit == 0);
+ (select_limit->val_int() == LL(1) && offset_limit == 0));
return;
}
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index cae8f682a09..7e199266db9 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -719,12 +719,11 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
real_item= item->real_item();
- if (!read_info.enclosed &&
- (enclosed_length && length == 4 &&
- !memcmp(pos, STRING_WITH_LEN("NULL"))) ||
+ if ((!read_info.enclosed &&
+ (enclosed_length && length == 4 &&
+ !memcmp(pos, STRING_WITH_LEN("NULL")))) ||
(length == 1 && read_info.found_null))
{
-
if (real_item->type() == Item::FIELD_ITEM)
{
Field *field= ((Item_field *)real_item)->field;
@@ -1120,9 +1119,10 @@ int READ_INFO::read_field()
}
// End of enclosed field if followed by field_term or line_term
if (chr == my_b_EOF ||
- chr == line_term_char && terminator(line_term_ptr,
- line_term_length))
- { // Maybe unexpected linefeed
+ (chr == line_term_char && terminator(line_term_ptr,
+ line_term_length)))
+ {
+ /* Maybe unexpected linefeed */
enclosed=1;
found_end_of_line=1;
row_start=buffer+1;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1391e6bc827..4b9f3b4241a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5069,7 +5069,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if (schema_db)
{
- if (!(sctx->master_access & FILE_ACL) && (want_access & FILE_ACL) ||
+ if ((!(sctx->master_access & FILE_ACL) && (want_access & FILE_ACL)) ||
(want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
{
if (!no_errors)
@@ -5103,7 +5103,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
DBUG_RETURN(FALSE);
}
if (((want_access & ~sctx->master_access) & ~(DB_ACLS | EXTRA_ACL)) ||
- ! db && dont_check_global_grants)
+ (! db && dont_check_global_grants))
{ // We can never grant this
DBUG_PRINT("error",("No possible access"));
if (!no_errors)
@@ -7670,7 +7670,7 @@ bool parse_sql(THD *thd,
/* Check that if MYSQLparse() failed, thd->is_error() is set. */
DBUG_ASSERT(!mysql_parse_status ||
- mysql_parse_status && thd->is_error());
+ (mysql_parse_status && thd->is_error()));
/* Reset parser state. */
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 5ed64ea8fd5..dea6030e378 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -7013,9 +7013,9 @@ static uint32 get_next_partition_via_walking(PARTITION_ITERATOR *part_iter)
longlong dummy;
field->store(part_iter->field_vals.cur++,
((Field_num*)field)->unsigned_flag);
- if (part_iter->part_info->is_sub_partitioned() &&
- !part_iter->part_info->get_part_partition_id(part_iter->part_info,
- &part_id, &dummy) ||
+ if ((part_iter->part_info->is_sub_partitioned() &&
+ !part_iter->part_info->get_part_partition_id(part_iter->part_info,
+ &part_id, &dummy)) ||
!part_iter->part_info->get_partition_id(part_iter->part_info,
&part_id, &dummy))
return part_id;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 436f889a56f..7d3b6f86b8c 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3004,7 +3004,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
if (!opt->update)
{
opt->update= update_func_str;
- if (!(opt->flags & PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_READONLY))
+ if (!(opt->flags & (PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_READONLY)))
{
opt->flags|= PLUGIN_VAR_READONLY;
sql_print_warning("Server variable %s of plugin %s was forced "
@@ -3109,7 +3109,8 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
uint count= EXTRA_OPTIONS;
DBUG_ENTER("construct_help_options");
- for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2);
+ for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2)
+ ;
if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count)))
DBUG_RETURN(NULL);
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 1a93d8d5099..19a782a514c 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1436,7 +1436,8 @@ static bool mysql_test_set_fields(Prepared_statement *stmt,
THD *thd= stmt->thd;
set_var_base *var;
- if (tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE) ||
+ if ((tables &&
+ check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE)) ||
open_normal_and_derived_tables(thd, tables, 0))
goto error;
@@ -1472,13 +1473,14 @@ static bool mysql_test_call_fields(Prepared_statement *stmt,
THD *thd= stmt->thd;
Item *item;
- if (tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE) ||
+ if ((tables &&
+ check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE)) ||
open_normal_and_derived_tables(thd, tables, 0))
goto err;
while ((item= it++))
{
- if (!item->fixed && item->fix_fields(thd, it.ref()) ||
+ if ((!item->fixed && item->fix_fields(thd, it.ref())) ||
item->check_cols(1))
goto err;
}
@@ -2844,7 +2846,7 @@ void Prepared_statement::setup_set_params()
Decide if we have to expand the query (because we must write it to logs or
because we want to look it up in the query cache) or not.
*/
- if (mysql_bin_log.is_open() && is_update_query(lex->sql_command) ||
+ if ((mysql_bin_log.is_open() && is_update_query(lex->sql_command)) ||
opt_log || opt_slow_log ||
query_cache_is_cacheable_query(lex))
{
@@ -3295,7 +3297,7 @@ Prepared_statement::reprepare()
&cur_db_changed))
return TRUE;
- error= (name.str && copy.set_name(&name) ||
+ error= ((name.str && copy.set_name(&name)) ||
copy.prepare(query, query_length) ||
validate_metadata(&copy));
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1c8b6a75cfe..828656005e7 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1361,7 +1361,7 @@ JOIN::optimize()
join_tab[const_tables].type != JT_ALL &&
join_tab[const_tables].type != JT_FT &&
join_tab[const_tables].type != JT_REF_OR_NULL &&
- (order && simple_order || group_list && simple_group))
+ ((order && simple_order) || (group_list && simple_group)))
{
if (add_ref_to_table_cond(thd,&join_tab[const_tables])) {
DBUG_RETURN(1);
@@ -1879,9 +1879,9 @@ JOIN::exec()
like SEC_TO_TIME(SUM(...)).
*/
- if (curr_join->group_list && (!test_if_subpart(curr_join->group_list,
- curr_join->order) ||
- curr_join->select_distinct) ||
+ if ((curr_join->group_list && (!test_if_subpart(curr_join->group_list,
+ curr_join->order) ||
+ curr_join->select_distinct)) ||
(curr_join->select_distinct &&
curr_join->tmp_table_param.using_indirect_summary_function))
{ /* Must copy to another table */
@@ -2352,9 +2352,9 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
}
else
{
- if (err= join->prepare(rref_pointer_array, tables, wild_num,
- conds, og_num, order, group, having, proc_param,
- select_lex, unit))
+ if ((err= join->prepare(rref_pointer_array, tables, wild_num,
+ conds, og_num, order, group, having,
+ proc_param, select_lex, unit)))
{
goto err;
}
@@ -2369,9 +2369,9 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
DBUG_RETURN(TRUE);
thd_proc_info(thd, "init");
thd->used_tables=0; // Updated by setup_fields
- if (err= join->prepare(rref_pointer_array, tables, wild_num,
- conds, og_num, order, group, having, proc_param,
- select_lex, unit))
+ if ((err= join->prepare(rref_pointer_array, tables, wild_num,
+ conds, og_num, order, group, having, proc_param,
+ select_lex, unit)))
{
goto err;
}
@@ -3824,7 +3824,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
if (use->key == prev->key && use->table == prev->table)
{
if (prev->keypart+1 < use->keypart ||
- prev->keypart == use->keypart && found_eq_constant)
+ (prev->keypart == use->keypart && found_eq_constant))
continue; /* remove */
}
else if (use->keypart != 0) // First found must be 0
@@ -5117,8 +5117,8 @@ best_extension_by_limited_search(JOIN *join,
{
if (best_record_count > current_record_count ||
best_read_time > current_read_time ||
- idx == join->const_tables && // 's' is the first table in the QEP
- s->table == join->sort_by_table)
+ (idx == join->const_tables && // 's' is the first table in the QEP
+ s->table == join->sort_by_table))
{
if (best_record_count >= current_record_count &&
best_read_time >= current_read_time &&
@@ -5244,7 +5244,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
double current_read_time=read_time+best;
if (best_record_count > current_record_count ||
best_read_time > current_read_time ||
- idx == join->const_tables && s->table == join->sort_by_table)
+ (idx == join->const_tables && s->table == join->sort_by_table))
{
if (best_record_count >= current_record_count &&
best_read_time >= current_read_time &&
@@ -6197,8 +6197,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
the index if we are using limit and this is the first table
*/
- if (cond &&
- (!tab->keys.is_subset(tab->const_keys) && i > 0) ||
+ if ((cond &&
+ (!tab->keys.is_subset(tab->const_keys) && i > 0)) ||
(!tab->const_keys.is_clear_all() && i == join->const_tables &&
join->unit->select_limit_cnt <
join->best_positions[i].records_read &&
@@ -7329,7 +7329,8 @@ static bool check_simple_equality(Item *left_item, Item *right_item,
left_item_equal->merge(right_item_equal);
/* Remove the merged multiple equality from the list */
List_iterator<Item_equal> li(cond_equal->current_level);
- while ((li++) != right_item_equal);
+ while ((li++) != right_item_equal)
+ ;
li.remove();
}
}
@@ -10004,9 +10005,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
reclength=1; // Dummy select
/* Use packed rows if there is blobs or a lot of space to gain */
if (blob_count ||
- string_total_length >= STRING_TOTAL_LENGTH_TO_PACK_ROWS &&
- (reclength / string_total_length <= RATIO_TO_PACK_ROWS ||
- string_total_length / string_count >= AVG_STRING_LENGTH_TO_PACK_ROWS))
+ (string_total_length >= STRING_TOTAL_LENGTH_TO_PACK_ROWS &&
+ (reclength / string_total_length <= RATIO_TO_PACK_ROWS ||
+ string_total_length / string_count >= AVG_STRING_LENGTH_TO_PACK_ROWS)))
use_packed_rows= 1;
share->reclength= reclength;
@@ -13274,9 +13275,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
if (keys.is_set(nr) &&
(direction= test_if_order_by_key(order, table, nr, &used_key_parts)))
{
- bool is_covering= table->covering_keys.is_set(nr) ||
- nr == table->s->primary_key &&
- table->file->primary_key_is_clustered();
+ bool is_covering= (table->covering_keys.is_set(nr) ||
+ (nr == table->s->primary_key &&
+ table->file->primary_key_is_clustered()));
/*
Don't use an index scan with ORDER BY without limit.
@@ -13289,7 +13290,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/
if (is_covering ||
select_limit != HA_POS_ERROR ||
- ref_key < 0 && (group || table->force_index))
+ (ref_key < 0 && (group || table->force_index)))
{
double rec_per_key;
double index_scan_time;
@@ -13354,12 +13355,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
index_scan_time= select_limit/rec_per_key *
min(rec_per_key, table->file->scan_time());
if (is_covering ||
- ref_key < 0 && (group || table->force_index) ||
+ (ref_key < 0 && (group || table->force_index)) ||
index_scan_time < read_time)
{
ha_rows quick_records= table_records;
- if (is_best_covering && !is_covering ||
- is_covering && ref_key_quick_rows < select_limit)
+ if ((is_best_covering && !is_covering) ||
+ (is_covering && ref_key_quick_rows < select_limit))
continue;
if (table->quick_keys.is_set(nr))
quick_records= table->quick_rows[nr];
@@ -13567,10 +13568,11 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
*/
if ((order != join->group_list ||
!(join->select_options & SELECT_BIG_RESULT) ||
- select && select->quick &&
- select->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX) &&
- test_if_skip_sort_order(tab,order,select_limit,0,
- is_order_by ? &table->keys_in_use_for_order_by :
+ (select && select->quick &&
+ select->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)) &&
+ test_if_skip_sort_order(tab,order,select_limit, 0,
+ is_order_by ?
+ &table->keys_in_use_for_order_by :
&table->keys_in_use_for_group_by))
DBUG_RETURN(0);
for (ORDER *ord= join->order; ord; ord= ord->next)
@@ -14390,8 +14392,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
/* Lookup the current GROUP field in the FROM clause. */
order_item_type= order_item->type();
from_field= (Field*) not_found_field;
- if (is_group_field &&
- order_item_type == Item::FIELD_ITEM ||
+ if ((is_group_field && order_item_type == Item::FIELD_ITEM) ||
order_item_type == Item::REF_ITEM)
{
from_field= find_field_in_tables(thd, (Item_ident*) order_item, tables,
@@ -14826,7 +14827,8 @@ get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables)
if (!map || (map & (RAND_TABLE_BIT | OUTER_REF_TABLE_BIT)))
DBUG_RETURN(0);
- for (; !(map & tables->table->map); tables= tables->next_leaf);
+ for (; !(map & tables->table->map); tables= tables->next_leaf)
+ ;
if (map != tables->table->map)
DBUG_RETURN(0); // More than one table
DBUG_PRINT("exit",("sort by table: %d",tables->table->tablenr));
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 21177dfd5bc..570a98b3aa3 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -587,7 +587,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
if (open_normal_and_derived_tables(thd, table_list, 0))
{
if (!table_list->view ||
- thd->is_error() && thd->main_da.sql_errno() != ER_VIEW_INVALID)
+ (thd->is_error() && thd->main_da.sql_errno() != ER_VIEW_INVALID))
DBUG_RETURN(TRUE);
/*
@@ -3207,10 +3207,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
if lookup value is empty string then
it's impossible table name or db name
*/
- if (lookup_field_vals.db_value.str &&
- !lookup_field_vals.db_value.str[0] ||
- lookup_field_vals.table_value.str &&
- !lookup_field_vals.table_value.str[0])
+ if ((lookup_field_vals.db_value.str &&
+ !lookup_field_vals.db_value.str[0]) ||
+ (lookup_field_vals.table_value.str &&
+ !lookup_field_vals.table_value.str[0]))
{
error= 0;
goto err;
@@ -4037,10 +4037,10 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
TYPE_ENUM_PROCEDURE))
return 0;
- if (lex->sql_command == SQLCOM_SHOW_STATUS_PROC &&
- proc_table->field[2]->val_int() == TYPE_ENUM_PROCEDURE ||
- lex->sql_command == SQLCOM_SHOW_STATUS_FUNC &&
- proc_table->field[2]->val_int() == TYPE_ENUM_FUNCTION ||
+ if ((lex->sql_command == SQLCOM_SHOW_STATUS_PROC &&
+ proc_table->field[2]->val_int() == TYPE_ENUM_PROCEDURE) ||
+ (lex->sql_command == SQLCOM_SHOW_STATUS_FUNC &&
+ proc_table->field[2]->val_int() == TYPE_ENUM_FUNCTION) ||
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
{
restore_record(table, s->default_values);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ce72e9fbe0f..e91a82a0b1d 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1675,13 +1675,13 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
FN_IS_TMP : 0);
}
if (drop_temporary ||
- (table_type == NULL &&
- (access(path, F_OK) &&
- ha_create_table_from_engine(thd, db, alias)) ||
+ ((table_type == NULL &&
+ (access(path, F_OK) &&
+ ha_create_table_from_engine(thd, db, alias))) ||
(!drop_view &&
mysql_frm_type(thd, path, &frm_db_type) != FRMTYPE_TABLE)))
{
- // Table was not found on disk and table can't be created from engine
+ /* Table was not found on disk and table can't be created from engine */
if (if_exists)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
@@ -1758,7 +1758,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (!dont_log_query)
{
if (!thd->current_stmt_binlog_row_based ||
- non_temp_tables_count > 0 && !tmp_table_deleted)
+ (non_temp_tables_count > 0 && !tmp_table_deleted))
{
/*
In this case, we are either using statement-based
@@ -2467,8 +2467,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
/* Don't pack rows in old tables if the user has requested this */
if ((sql_field->flags & BLOB_FLAG) ||
- sql_field->sql_type == MYSQL_TYPE_VARCHAR &&
- create_info->row_type != ROW_TYPE_FIXED)
+ (sql_field->sql_type == MYSQL_TYPE_VARCHAR &&
+ create_info->row_type != ROW_TYPE_FIXED))
(*db_options)|= HA_OPTION_PACK_RECORD;
it2.rewind();
}
@@ -2937,7 +2937,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->sql_type == MYSQL_TYPE_VARCHAR ||
sql_field->pack_flag & FIELDFLAG_BLOB)))
{
- if (column_nr == 0 && (sql_field->pack_flag & FIELDFLAG_BLOB) ||
+ if ((column_nr == 0 && (sql_field->pack_flag & FIELDFLAG_BLOB)) ||
sql_field->sql_type == MYSQL_TYPE_VARCHAR)
key_info->flags|= HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY;
else
@@ -5342,9 +5342,9 @@ compare_tables(TABLE *table,
/* Don't pack rows in old tables if the user has requested this. */
if (create_info->row_type == ROW_TYPE_DYNAMIC ||
- (tmp_new_field->flags & BLOB_FLAG) ||
- tmp_new_field->sql_type == MYSQL_TYPE_VARCHAR &&
- create_info->row_type != ROW_TYPE_FIXED)
+ (tmp_new_field->flags & BLOB_FLAG) ||
+ (tmp_new_field->sql_type == MYSQL_TYPE_VARCHAR &&
+ create_info->row_type != ROW_TYPE_FIXED))
create_info->table_options|= HA_OPTION_PACK_RECORD;
/* Check if field was renamed */
@@ -6958,12 +6958,12 @@ view_err:
}
else if (mysql_rename_table(new_db_type, new_db, tmp_name, new_db,
new_alias, FN_FROM_IS_TMP) ||
- (new_name != table_name || new_db != db) && // we also do rename
- (need_copy_table != ALTER_TABLE_METADATA_ONLY ||
- mysql_rename_table(save_old_db_type, db, table_name, new_db,
- new_alias, NO_FRM_RENAME)) &&
- Table_triggers_list::change_table_name(thd, db, table_name,
- new_db, new_alias))
+ ((new_name != table_name || new_db != db) && // we also do rename
+ (need_copy_table != ALTER_TABLE_METADATA_ONLY ||
+ mysql_rename_table(save_old_db_type, db, table_name, new_db,
+ new_alias, NO_FRM_RENAME)) &&
+ Table_triggers_list::change_table_name(thd, db, table_name,
+ new_db, new_alias)))
{
/* Try to get everything back. */
error=1;
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 5c8b1d96646..7fe487c87cf 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -344,7 +344,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
need second part of condition below, since check_access() function also
checks that db is specified.
*/
- if (!thd->lex->spname->m_db.length || create && !tables->db_length)
+ if (!thd->lex->spname->m_db.length || (create && !tables->db_length))
{
my_error(ER_NO_DB_ERROR, MYF(0));
DBUG_RETURN(TRUE);
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index d5d91d856fc..91d486fc38c 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1773,7 +1773,7 @@ void multi_update::abort()
{
/* the error was handled or nothing deleted and no side effects return */
if (error_handled ||
- !thd->transaction.stmt.modified_non_trans_table && !updated)
+ (!thd->transaction.stmt.modified_non_trans_table && !updated))
return;
/* Something already updated so we have to invalidate cache */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index ba9a15d941b..00099fa6a79 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5922,7 +5922,7 @@ alter_list_item:
MYSQL_YYABORT;
}
if (check_table_name($3->table.str,$3->table.length) ||
- $3->db.str && check_db_name(&$3->db))
+ ($3->db.str && check_db_name(&$3->db)))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
MYSQL_YYABORT;
@@ -6076,8 +6076,8 @@ slave_until:
| UNTIL_SYM slave_until_opts
{
LEX *lex=Lex;
- if ((lex->mi.log_file_name || lex->mi.pos) &&
- (lex->mi.relay_log_name || lex->mi.relay_log_pos) ||
+ if (((lex->mi.log_file_name || lex->mi.pos) &&
+ (lex->mi.relay_log_name || lex->mi.relay_log_pos)) ||
!((lex->mi.log_file_name && lex->mi.pos) ||
(lex->mi.relay_log_name && lex->mi.relay_log_pos)))
{
diff --git a/sql/table.cc b/sql/table.cc
index b3c786010dd..6355d46f4d5 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -453,33 +453,34 @@ inline bool is_system_table_name(const char *name, uint length)
return (
/* mysql.proc table */
- length == 4 &&
- my_tolower(ci, name[0]) == 'p' &&
- my_tolower(ci, name[1]) == 'r' &&
- my_tolower(ci, name[2]) == 'o' &&
- my_tolower(ci, name[3]) == 'c' ||
-
- length > 4 &&
- (
- /* one of mysql.help* tables */
- my_tolower(ci, name[0]) == 'h' &&
- my_tolower(ci, name[1]) == 'e' &&
- my_tolower(ci, name[2]) == 'l' &&
- my_tolower(ci, name[3]) == 'p' ||
-
- /* one of mysql.time_zone* tables */
- my_tolower(ci, name[0]) == 't' &&
- my_tolower(ci, name[1]) == 'i' &&
- my_tolower(ci, name[2]) == 'm' &&
- my_tolower(ci, name[3]) == 'e' ||
-
- /* mysql.event table */
- my_tolower(ci, name[0]) == 'e' &&
- my_tolower(ci, name[1]) == 'v' &&
- my_tolower(ci, name[2]) == 'e' &&
- my_tolower(ci, name[3]) == 'n' &&
- my_tolower(ci, name[4]) == 't'
- )
+ (length == 4 &&
+ my_tolower(ci, name[0]) == 'p' &&
+ my_tolower(ci, name[1]) == 'r' &&
+ my_tolower(ci, name[2]) == 'o' &&
+ my_tolower(ci, name[3]) == 'c') ||
+
+ (length > 4 &&
+ (
+ /* one of mysql.help* tables */
+ (my_tolower(ci, name[0]) == 'h' &&
+ my_tolower(ci, name[1]) == 'e' &&
+ my_tolower(ci, name[2]) == 'l' &&
+ my_tolower(ci, name[3]) == 'p') ||
+
+ /* one of mysql.time_zone* tables */
+ (my_tolower(ci, name[0]) == 't' &&
+ my_tolower(ci, name[1]) == 'i' &&
+ my_tolower(ci, name[2]) == 'm' &&
+ my_tolower(ci, name[3]) == 'e') ||
+
+ /* mysql.event table */
+ (my_tolower(ci, name[0]) == 'e' &&
+ my_tolower(ci, name[1]) == 'v' &&
+ my_tolower(ci, name[2]) == 'e' &&
+ my_tolower(ci, name[3]) == 'n' &&
+ my_tolower(ci, name[4]) == 't')
+ )
+ )
);
}
@@ -3314,8 +3315,8 @@ bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type)
{
const char *save_where= thd->where;
thd->where= "check option";
- if (!check_option->fixed &&
- check_option->fix_fields(thd, &check_option) ||
+ if ((!check_option->fixed &&
+ check_option->fix_fields(thd, &check_option)) ||
check_option->check_cols(1))
{
DBUG_RETURN(TRUE);
@@ -4030,16 +4031,16 @@ void Field_iterator_table_ref::set_field_iterator()
/* Necesary, but insufficient conditions. */
DBUG_ASSERT(table_ref->is_natural_join ||
table_ref->nested_join ||
- table_ref->join_columns &&
- /* This is a merge view. */
- ((table_ref->field_translation &&
- table_ref->join_columns->elements ==
- (ulong)(table_ref->field_translation_end -
- table_ref->field_translation)) ||
- /* This is stored table or a tmptable view. */
- (!table_ref->field_translation &&
- table_ref->join_columns->elements ==
- table_ref->table->s->fields)));
+ (table_ref->join_columns &&
+ /* This is a merge view. */
+ ((table_ref->field_translation &&
+ table_ref->join_columns->elements ==
+ (ulong)(table_ref->field_translation_end -
+ table_ref->field_translation)) ||
+ /* This is stored table or a tmptable view. */
+ (!table_ref->field_translation &&
+ table_ref->join_columns->elements ==
+ table_ref->table->s->fields))));
field_it= &natural_join_it;
DBUG_PRINT("info",("field_it for '%s' is Field_iterator_natural_join",
table_ref->alias));
diff --git a/sql/table.h b/sql/table.h
index 77bd7bb9e77..1cdc1381eb5 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1363,8 +1363,8 @@ struct TABLE_LIST
void cleanup_items();
bool placeholder()
{
- return derived || view || schema_table || create && !table->db_stat ||
- !table;
+ return (derived || view || schema_table || (create && !table->db_stat) ||
+ !table);
}
void print(THD *thd, String *str, enum_query_type query_type);
bool check_single_table(TABLE_LIST **table, table_map map,
diff --git a/sql/time.cc b/sql/time.cc
index 687bb09e0f0..44672eb4278 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -111,8 +111,8 @@ uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year)
if (l_time->month == 1 && l_time->day <= 7-weekday)
{
if (!week_year &&
- (first_weekday && weekday != 0 ||
- !first_weekday && weekday >= 4))
+ ((first_weekday && weekday != 0) ||
+ (!first_weekday && weekday >= 4)))
return 0;
week_year= 1;
(*year)--;
@@ -129,8 +129,8 @@ uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year)
if (week_year && days >= 52*7)
{
weekday= (weekday + calc_days_in_year(*year)) % 7;
- if (!first_weekday && weekday < 4 ||
- first_weekday && weekday == 0)
+ if ((!first_weekday && weekday < 4) ||
+ (first_weekday && weekday == 0))
{
(*year)++;
return 1;
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 53870915973..860a604b545 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -447,8 +447,8 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage)
}
if (end_t == MY_TIME_T_MAX ||
- (cur_off_and_corr > 0) &&
- (end_t >= MY_TIME_T_MAX - cur_off_and_corr))
+ ((cur_off_and_corr > 0) &&
+ (end_t >= MY_TIME_T_MAX - cur_off_and_corr)))
/* end of t space */
break;
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 0394eee9c6d..c2f16f2e05b 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -603,9 +603,10 @@ bool Unique::get(TABLE *table)
outfile=table->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE),
MYF(MY_ZEROFILL));
- if (!outfile || ! my_b_inited(outfile) &&
- open_cached_file(outfile,mysql_tmpdir,TEMP_PREFIX,READ_RECORD_BUFFER,
- MYF(MY_WME)))
+ if (!outfile ||
+ (! my_b_inited(outfile) &&
+ open_cached_file(outfile,mysql_tmpdir,TEMP_PREFIX,READ_RECORD_BUFFER,
+ MYF(MY_WME))))
return 1;
reinit_io_cache(outfile,WRITE_CACHE,0L,0,0);