Commit 8b637b28 authored by Mats Kindahl's avatar Mats Kindahl

Fixning compiler warnings. Fixing build failure for valgrind platform.


include/my_global.h:
  Moving YESNO() macro here from log.cc (it prints either "yes" or "no" depending on a boolean value).
sql/log.cc:
  Moving YESNO() function to my_global.h.
sql/sql_class.cc:
  Adding default case to printout function to avoid warning.
  Only defining function for debug builds since it isn't used 
  in non-debug build (hence produce a warning).
sql/sql_class.h:
  Printing yes/no answer instead of memory address since the
  case produces an error/warning on valgrind platform.
parent 7207b18b
...@@ -1130,6 +1130,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */ ...@@ -1130,6 +1130,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define dbug_volatile #define dbug_volatile
#endif #endif
/* Some helper macros */
#define YESNO(X) ((X) ? "yes" : "no")
/* Defines for time function */ /* Defines for time function */
#define SCALE_SEC 100 #define SCALE_SEC 100
#define SCALE_USEC 10000 #define SCALE_USEC 10000
......
...@@ -1448,8 +1448,6 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all) ...@@ -1448,8 +1448,6 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all)
return 0; return 0;
} }
#define YESNO(X) ((X) ? "yes" : "no")
/** /**
This function is called once after each statement. This function is called once after each statement.
......
...@@ -3528,22 +3528,24 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end) ...@@ -3528,22 +3528,24 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end)
} }
#ifndef DBUG_OFF
static const char * static const char *
show_query_type(THD::enum_binlog_query_type qtype) show_query_type(THD::enum_binlog_query_type qtype)
{ {
switch (qtype) { switch (qtype) {
static char buf[64];
case THD::ROW_QUERY_TYPE: case THD::ROW_QUERY_TYPE:
return "ROW"; return "ROW";
case THD::STMT_QUERY_TYPE: case THD::STMT_QUERY_TYPE:
return "STMT"; return "STMT";
case THD::MYSQL_QUERY_TYPE: case THD::MYSQL_QUERY_TYPE:
return "MYSQL"; return "MYSQL";
} default:
static char buf[64];
sprintf(buf, "UNKNOWN#%d", qtype); sprintf(buf, "UNKNOWN#%d", qtype);
return buf; return buf;
}
} }
#endif
/* /*
......
...@@ -2100,8 +2100,8 @@ class THD :public Statement, ...@@ -2100,8 +2100,8 @@ class THD :public Statement,
Don't reset binlog format for NDB binlog injector thread. Don't reset binlog format for NDB binlog injector thread.
*/ */
DBUG_PRINT("debug", DBUG_PRINT("debug",
("temporary_tables: %d, in_sub_stmt: %d, system_thread: %s", ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s",
(int) temporary_tables, in_sub_stmt, YESNO(temporary_tables), YESNO(in_sub_stmt),
show_system_thread(system_thread))); show_system_thread(system_thread)));
if ((temporary_tables == NULL) && (in_sub_stmt == 0) && if ((temporary_tables == NULL) && (in_sub_stmt == 0) &&
(system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG)) (system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG))
......
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