Skip to content

Commit

Permalink
Fixed some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi authored and vuvova committed Aug 23, 2017
1 parent f71bed0 commit 9e1cc83
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions sql/item_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,7 @@ longlong Item_master_gtid_wait::val_int()
{
DBUG_ASSERT(fixed == 1);
longlong result= 0;
String *gtid_pos __attribute__((unused)) = args[0]->val_str(&value);

if (args[0]->null_value)
{
Expand All @@ -3660,7 +3661,6 @@ longlong Item_master_gtid_wait::val_int()

null_value=0;
#ifdef HAVE_REPLICATION
String *gtid_pos = args[0]->val_str(&value);
THD* thd= current_thd;
longlong timeout_us;

Expand All @@ -3670,7 +3670,9 @@ longlong Item_master_gtid_wait::val_int()
timeout_us= (longlong)-1;

result= rpl_global_gtid_waiting.wait_for_pos(thd, gtid_pos, timeout_us);
#endif
#else
null_value= 0;
#endif /* REPLICATION */
return result;
}

Expand Down
3 changes: 2 additions & 1 deletion sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,8 @@ bool do_command(THD *thd)
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
if (thd->wsrep_conflict_state == MUST_ABORT)
{
DBUG_PRINT("wsrep",("aborted for wsrep rollback: %lu", thd->real_id));
DBUG_PRINT("wsrep",("aborted for wsrep rollback: %lu",
(ulong) thd->real_id));
wsrep_client_rollback(thd);
}
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ static bool abort_replicated(THD *thd)
bool ret_code= false;
if (thd->wsrep_query_state== QUERY_COMMITTING)
{
WSREP_DEBUG("aborting replicated trx: %lu", thd->real_id);
WSREP_DEBUG("aborting replicated trx: %lu", (ulong) thd->real_id);

(void)wsrep_abort_thd(thd, thd, TRUE);
ret_code= true;
Expand Down
4 changes: 2 additions & 2 deletions storage/connect/jmgoconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
return RC_FX;

if (env->CallBooleanMethod(job, docaddid, updlist, jkey, val))
return NULL;
return 0;

env->DeleteLocalRef(jkey);
} // endfor colp
Expand All @@ -740,7 +740,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
jkey = env->NewStringUTF("$set");

if (env->CallBooleanMethod(job, docaddid, upd, jkey, updlist))
return NULL;
return 0;

env->DeleteLocalRef(jkey);

Expand Down
2 changes: 1 addition & 1 deletion storage/connect/myconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
unsigned int length[] = {0, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
PCSZ fmt;
char *fld, *colname, *chset, v, buf[128], uns[16], zero[16];
int i, n, nf, ncol = sizeof(buftyp) / sizeof(int);
int i, n, nf=0, ncol = sizeof(buftyp) / sizeof(int);
int len, type, prec, rc, k = 0;
bool b;
PQRYRES qrp;
Expand Down
2 changes: 2 additions & 0 deletions support-files/compiler_warnings.supp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
.*/storage/connect/xindex\.cpp: ignoring return value of
.*/storage/connect/value\.cpp: always false : 1000-1020
.*/storage/connect/json\.cpp: might be clobbered by
.*/storage/connect/filemdbf\.cpp: ignoring return value.*fwrite
.*/storage/connect/value\.cpp: .*comparison is always false due to limited range

#
# mroonga
Expand Down

0 comments on commit 9e1cc83

Please sign in to comment.