summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event_old.cc6
-rw-r--r--sql/slave.cc5
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_audit.cc3
-rw-r--r--storage/connect/filamzip.cpp2
-rw-r--r--storage/connect/ha_connect.cc2
-rw-r--r--storage/connect/tabext.h2
-rw-r--r--storage/innobase/dict/dict0dict.cc5
-rw-r--r--storage/innobase/handler/ha_innodb.cc11
-rw-r--r--storage/sphinx/ha_sphinx.cc2
-rw-r--r--storage/spider/spd_table.cc1
-rw-r--r--storage/xtradb/handler/ha_innodb.cc11
14 files changed, 23 insertions, 37 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 3a08ea26b1d..3d787df804d 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1405,7 +1405,7 @@ void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net)
DBUG_ASSERT(stmt != 0);
stmt->last_errno= net->last_errno;
- if (net->last_error && net->last_error[0])
+ if (net->last_error[0])
strmov(stmt->last_error, net->last_error);
strmov(stmt->sqlstate, net->sqlstate);
diff --git a/sql/log.cc b/sql/log.cc
index e99eefe4970..b80d65e20db 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1294,7 +1294,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
/* fill in user_host value: the format is "%s[%s] @ %s [%s]" */
user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
- sctx->priv_user ? sctx->priv_user : "", "[",
+ sctx->priv_user, "[",
sctx->user ? sctx->user : (thd->slave_thread ? "SQL_SLAVE" : ""), "] @ ",
sctx->host ? sctx->host : "", " [",
sctx->ip ? sctx->ip : "", "]", NullS) -
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 8bdb81f5283..73869e82f72 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1681,8 +1681,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
default:
rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
"Error in %s event: row application failed. %s",
- get_type_str(),
- thd->net.last_error ? thd->net.last_error : "");
+ get_type_str(), thd->net.last_error);
thd->is_slave_error= 1;
break;
}
@@ -1721,8 +1720,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
get_type_str(), table->s->db.str,
- table->s->table_name.str,
- thd->net.last_error ? thd->net.last_error : "");
+ table->s->table_name.str, thd->net.last_error);
/*
If one day we honour --skip-slave-errors in row-based replication, and
diff --git a/sql/slave.cc b/sql/slave.cc
index 8801e9e9ab5..3dd17fd7276 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -5647,8 +5647,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
TODO: handling `when' for SHOW SLAVE STATUS' snds behind
*/
- if ((memcmp(mi->master_log_name, hb.get_log_ident(), hb.get_ident_len())
- && mi->master_log_name != NULL)
+ if (memcmp(mi->master_log_name, hb.get_log_ident(), hb.get_ident_len())
|| mi->master_log_pos > hb.log_pos)
{
/* missed events of heartbeat from the past */
@@ -6153,7 +6152,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
/* we disallow empty users */
- if (mi->user == NULL || mi->user[0] == 0)
+ if (mi->user[0] == 0)
{
mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL,
ER(ER_SLAVE_FATAL_ERROR),
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ac833e01ba7..c7e47c84db0 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -10639,12 +10639,6 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
/* global privileges */
grant->privilege= sctx->master_access;
- if (!sctx->priv_user)
- {
- DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
- DBUG_VOID_RETURN; // it is slave
- }
-
if (!thd->db || strcmp(db, thd->db))
{
/* db privileges */
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index b659054a50b..60a75cb06e7 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -369,8 +369,7 @@ int initialize_audit_plugin(st_plugin_int *plugin)
{
st_mysql_audit *data= (st_mysql_audit*) plugin->plugin->info;
- if (!data->class_mask || !data->event_notify ||
- !data->class_mask[0])
+ if (!data->event_notify || !data->class_mask[0])
{
sql_print_error("Plugin '%s' has invalid data.",
plugin->name.str);
diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp
index 3d157da5e87..fa857837427 100644
--- a/storage/connect/filamzip.cpp
+++ b/storage/connect/filamzip.cpp
@@ -341,7 +341,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
bool ZIPUTIL::addEntry(PGLOBAL g, char *entry)
{
//?? we dont need the stinking time
- zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ zip_fileinfo zi = { {0, 0, 0, 0, 0, 0}, 0, 0, 0 };
getTime(zi.tmz_date);
target = entry;
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index d1ab18f52d5..1f2bd0e5992 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -1192,7 +1192,7 @@ char *ha_connect::GetRealString(const char *s)
{
char *sv;
- if (IsPartitioned() && s && partname && *partname) {
+ if (IsPartitioned() && s && *partname) {
sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
sprintf(sv, s, partname);
PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
diff --git a/storage/connect/tabext.h b/storage/connect/tabext.h
index 2ef20c89f2c..5133bd9dd5f 100644
--- a/storage/connect/tabext.h
+++ b/storage/connect/tabext.h
@@ -7,7 +7,7 @@
/***********************************************************************/
#ifndef __TABEXT_H
-#define __TABEXTF_H
+#define __TABEXT_H
#include "reldef.h"
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 6fd8afd2aee..b6ca02fa164 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -6251,6 +6251,7 @@ dict_set_corrupted_index_cache_only(
dict_table_t* table) /*!< in/out: table */
{
ut_ad(index != NULL);
+ ut_ad(table != NULL);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
@@ -6260,9 +6261,7 @@ dict_set_corrupted_index_cache_only(
if (dict_index_is_clust(index)) {
dict_table_t* corrupt_table;
- corrupt_table = (table != NULL) ? table : index->table;
- ut_ad((index->table != NULL) || (table != NULL)
- || index->table == table);
+ corrupt_table = table;
if (corrupt_table) {
corrupt_table->corrupted = TRUE;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 91a507ef1b9..1538471db4f 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2000,12 +2000,11 @@ innobase_get_stmt(
{
const char* query = NULL;
LEX_STRING *stmt = NULL;
- if (thd) {
- stmt = thd_query_string(thd);
- if (stmt) {
- *length = stmt->length;
- query = stmt->str;
- }
+ ut_ad(thd != NULL);
+ stmt = thd_query_string(thd);
+ if (stmt) {
+ *length = stmt->length;
+ query = stmt->str;
}
return (query);
}
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index ff3b63465eb..3f035c7bc7d 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -911,7 +911,7 @@ bool sphinx_show_status ( THD * thd )
}
// show last error or warning (either in addition to stats, or on their own)
- if ( pTls && pTls->m_pHeadTable && pTls->m_pHeadTable->m_tStats.m_sLastMessage && pTls->m_pHeadTable->m_tStats.m_sLastMessage[0] )
+ if ( pTls && pTls->m_pHeadTable && pTls->m_pHeadTable->m_tStats.m_sLastMessage[0] )
{
const char * sMessageType = pTls->m_pHeadTable->m_tStats.m_bLastError ? "error" : "warning";
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index ead335c07ea..66f558ecd91 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -517,7 +517,6 @@ int spider_free_share_alloc(
) {
int roop_count;
DBUG_ENTER("spider_free_share_alloc");
- if (share->dbton_bitmap)
{
for (roop_count = SPIDER_DBTON_SIZE - 1; roop_count >= 0; roop_count--)
{
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 9433ee4c7c5..12ae71508c7 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -2326,12 +2326,11 @@ innobase_get_stmt(
{
const char* query = NULL;
LEX_STRING *stmt = NULL;
- if (thd) {
- stmt = thd_query_string(thd);
- if (stmt) {
- *length = stmt->length;
- query = stmt->str;
- }
+ ut_ad(thd != NULL);
+ stmt = thd_query_string(thd);
+ if (stmt) {
+ *length = stmt->length;
+ query = stmt->str;
}
return (query);
}