diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index f4a0f58511b..dd16e535eda 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -840,7 +840,6 @@ static int findopt(char *optpat, uint length, { uint count; const struct my_option *opt= *opt_res; - my_bool is_prefix= FALSE; DBUG_ENTER("findopt"); for (count= 0; opt->name; opt++) @@ -856,8 +855,6 @@ static int findopt(char *optpat, uint length, /* We only need to know one prev */ count= 1; *ffname= opt->name; - if (opt->name[length]) - is_prefix= TRUE; } else if (strcmp(*ffname, opt->name)) { diff --git a/sql/handler.cc b/sql/handler.cc index 028b4488573..9cadfb2cf3f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1297,7 +1297,9 @@ int ha_commit_trans(THD *thd, bool all) */ err= ht->prepare(ht, thd, all); status_var_increment(thd->status_var.ha_prepare_count); + if (err) + { #ifdef WITH_WSREP if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) { @@ -1309,9 +1311,14 @@ int ha_commit_trans(THD *thd, bool all) } } else + { /* not wsrep hton, bail to native mysql behavior */ #endif my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); +#ifdef WITH_WSREP + } /* End of else */ +#endif + } if (err) goto err; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0e993418b99..7933d95de68 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -8220,7 +8220,7 @@ static inline wsrep_status_t wsrep_apply_rbr( if (!ev) { WSREP_ERROR("applier could not read binlog event, seqno: %lld, len: %ld", - (long long)thd->wsrep_trx_seqno, buf_len); + (long long)thd->wsrep_trx_seqno, (long int) buf_len); rcode= 1; goto error; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6613b5c8da2..7a5b84488d7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6368,10 +6368,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, error= 0; break; } -#ifdef WITH_WSREP - bool do_log_write(true); -#endif /* WITH_WSREP */ - if (error == HA_ERR_WRONG_COMMAND) + + if (error == HA_ERR_WRONG_COMMAND) { error= 0; push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 9075ee212fb..5d353439484 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -2231,7 +2231,7 @@ lock_rec_lock_slow( { trx_t* trx; #ifdef WITH_WSREP - lock_t *c_lock; + lock_t *c_lock= 0; #endif lock_t* lock; diff --git a/storage/xtradb/lock/lock0lock.c b/storage/xtradb/lock/lock0lock.c index 2bf7309152a..227f353f309 100644 --- a/storage/xtradb/lock/lock0lock.c +++ b/storage/xtradb/lock/lock0lock.c @@ -2211,7 +2211,7 @@ lock_rec_lock_slow( { trx_t* trx; #ifdef WITH_WSREP - lock_t *c_lock; + lock_t *c_lock= 0; #endif lock_t* lock;