Commit b5d307e8 authored by Davi Arnaut's avatar Davi Arnaut

Fix for compiler warnings:

Rename method as to not hide a base.
Reorder attributes initialization.
Remove unused variable.
Rework code to silence a warning due to assignment used as truth value.
parent a5618bfa
......@@ -1765,19 +1765,19 @@ String *Item_func_encode::val_str(String *str)
null_value= 0;
res= copy_if_not_alloced(str, res, res->length());
transform(res);
crypto_transform(res);
sql_crypt.reinit();
return res;
}
void Item_func_encode::transform(String *res)
void Item_func_encode::crypto_transform(String *res)
{
sql_crypt.encode((char*) res->ptr(),res->length());
res->set_charset(&my_charset_bin);
}
void Item_func_decode::transform(String *res)
void Item_func_decode::crypto_transform(String *res)
{
sql_crypt.decode((char*) res->ptr(),res->length());
}
......
......@@ -363,7 +363,7 @@ public:
void fix_length_and_dec();
const char *func_name() const { return "encode"; }
protected:
virtual void transform(String *);
virtual void crypto_transform(String *);
private:
/** Provide a seed for the PRNG sequence. */
bool seed();
......@@ -376,7 +376,7 @@ public:
Item_func_decode(Item *a, Item *seed): Item_func_encode(a, seed) {}
const char *func_name() const { return "decode"; }
protected:
void transform(String *);
void crypto_transform(String *);
};
......
......@@ -2386,8 +2386,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
auto_increment_offset(thd_arg->variables.auto_increment_offset),
lc_time_names_number(thd_arg->variables.lc_time_names->number),
charset_database_number(0),
master_data_written(0),
table_map_for_update((ulonglong)thd_arg->table_map_for_update)
table_map_for_update((ulonglong)thd_arg->table_map_for_update),
master_data_written(0)
{
time_t end_time;
......
......@@ -114,8 +114,8 @@ int injector::transaction::write_row (server_id_type sid, table tbl,
{
DBUG_ENTER("injector::transaction::write_row(...)");
int error= 0;
if (error= check_state(ROW_STATE))
int error= check_state(ROW_STATE);
if (error)
DBUG_RETURN(error);
server_id_type save_id= m_thd->server_id;
......@@ -133,8 +133,8 @@ int injector::transaction::delete_row(server_id_type sid, table tbl,
{
DBUG_ENTER("injector::transaction::delete_row(...)");
int error= 0;
if (error= check_state(ROW_STATE))
int error= check_state(ROW_STATE);
if (error)
DBUG_RETURN(error);
server_id_type save_id= m_thd->server_id;
......@@ -152,8 +152,8 @@ int injector::transaction::update_row(server_id_type sid, table tbl,
{
DBUG_ENTER("injector::transaction::update_row(...)");
int error= 0;
if (error= check_state(ROW_STATE))
int error= check_state(ROW_STATE);
if (error)
DBUG_RETURN(error);
server_id_type save_id= m_thd->server_id;
......
......@@ -382,7 +382,6 @@ int prepare_record(TABLE *const table,
*/
for (Field **field_ptr= table->field+skip; *field_ptr; ++field_ptr)
{
uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
Field *const f= *field_ptr;
if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM))
......
......@@ -828,7 +828,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
qinfo.db_len = strlen(db);
/* These DDL methods and logging protected with LOCK_mysql_create_db */
if (error= mysql_bin_log.write(&qinfo))
if ((error= mysql_bin_log.write(&qinfo)))
goto exit;
}
my_ok(thd, result);
......
......@@ -3988,7 +3988,7 @@ end_with_restore_list:
*/
if (!lex->no_write_to_binlog && write_to_binlog)
{
if (res= write_bin_log(thd, FALSE, thd->query(), thd->query_length()))
if ((res= write_bin_log(thd, FALSE, thd->query(), thd->query_length())))
break;
}
my_ok(thd);
......
......@@ -6561,7 +6561,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
thd->clear_error();
Query_log_event qinfo(thd, thd->query(), thd->query_length(),
0, FALSE, 0);
if (error= mysql_bin_log.write(&qinfo))
if ((error= mysql_bin_log.write(&qinfo)))
goto view_err_unlock;
}
my_ok(thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment