summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2006-02-14 22:36:11 +0100
committerunknown <serg@serg.mylan>2006-02-14 22:36:11 +0100
commitd3ee9abf2a15d96b6779b33ebe7606e7d53b8cd1 (patch)
tree1fd1c53fca7673d384fa493bf7a237ffa408bf38 /sql
parent8017e9c4e726f8ab6b8b2c71f81e0e0036c21fcd (diff)
downloadmariadb-git-d3ee9abf2a15d96b6779b33ebe7606e7d53b8cd1.tar.gz
dbug changes:
1. dbug state is now local to a thread 2. new macros: DBUG_EXPLAIN, DBUG_EXPLAIN_INITIAL, DBUG_SET, DBUG_SET_INITIAL, DBUG_EVALUATE, DBUG_EVALUATE_IF 3. macros are do{}while(0) wrapped 4. incremental modifications to the dbug state (e.g. "+d,info:-t") 5. dbug code cleanup, style fixes 6. _db_on_ and DEBUGGER_ON/OFF removed 7. rest of MySQL code fixed because of 3 (missing ;) and 6 8. dbug manual updated 9. server variable @@debug (global and local) to control dbug from SQL! a. -#T to print timestamps in the log BitKeeper/deleted/.del-readme.prof~2f3bae1550a0038d: Delete: dbug/readme.prof client/mysqlslap.c: typo fixed configure.in: test for sleep() too dbug/dbug.c: thread local dbug settings DBUG_EXPLAIN,DBUG_EXPLAIN_INITIAL,DBUG_SET,DBUG_SET_INITIAL style changes to be more in line with MySQL code cleanup (many mallocs removed) incremental modification of dbug state (e.g. DBUG_PUSH("+t:-d,info")) DBUG_SET, _db_explain_ -#T dbug/monty.doc: obsolete and duplicate docs removed dbug/user.r: new features documented include/my_dbug.h: correct do{}while wrapping thread local dbug settings DBUG_EXPLAIN,DBUG_EXPLAIN_INITIAL,DBUG_SET,DBUG_SET_INITIAL DBUG_EVALUATE,DBUG_EVALUATE_IF libmysql/libmysql.c: remove _db_on_ and DEBUGGER_ON/OFF mysys/my_init.c: missed DBUG_RETURN mysys/my_thr_init.c: bugfix - transaction id's are unsigned mysys/testhash.c: remove _db_on_ and DEBUGGER_ON/OFF sql/ha_myisammrg.cc: missed ; sql/ha_ndbcluster.cc: remove _db_on_ and DEBUGGER_ON/OFF missed ; sql/ha_ndbcluster_binlog.cc: remove _db_on_ and DEBUGGER_ON/OFF missed ; sql/item_cmpfunc.cc: missed ; sql/lock.cc: missed DBUG_RETURN sql/log_event.cc: missed ; sql/mysqld.cc: remove _db_on_ and DEBUGGER_ON/OFF missed ; DBUG_SET_INITIAL sql/opt_range.cc: remove _db_on_ and DEBUGGER_ON/OFF sql/set_var.cc: class sys_var_thd_dbug and "debug" server variable sql/set_var.h: class sys_var_thd_dbug and "debug" server variable sql/slave.cc: missed ; sql/sql_cache.cc: missed ; sql/sql_plugin.cc: missed ; sql/sql_select.cc: remove _db_on_ and DEBUGGER_ON/OFF storage/heap/hp_test2.c: remove _db_on_ and DEBUGGER_ON/OFF storage/myisam/ft_eval.c: remove _db_on_ and DEBUGGER_ON/OFF storage/myisam/ft_test1.c: remove _db_on_ and DEBUGGER_ON/OFF storage/myisam/mi_open.c: remove _db_on_ and DEBUGGER_ON/OFF missed ; storage/myisam/mi_test1.c: remove _db_on_ and DEBUGGER_ON/OFF storage/myisam/mi_test2.c: remove _db_on_ and DEBUGGER_ON/OFF storage/myisam/mi_test3.c: remove _db_on_ and DEBUGGER_ON/OFF storage/ndb/src/ndbapi/DictCache.cpp: missed ; storage/ndb/src/ndbapi/NdbTransaction.cpp: missed ; tests/mysql_client_test.c: remove _db_on_ and DEBUGGER_ON/OFF
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisammrg.cc2
-rw-r--r--sql/ha_ndbcluster.cc17
-rw-r--r--sql/ha_ndbcluster_binlog.cc33
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/mysqld.cc20
-rw-r--r--sql/opt_range.cc8
-rw-r--r--sql/set_var.cc35
-rw-r--r--sql/set_var.h22
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_cache.cc6
-rw-r--r--sql/sql_plugin.cc6
-rw-r--r--sql/sql_select.cc4
14 files changed, 100 insertions, 61 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index cc40ca0b92b..32b67cd23e5 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -116,7 +116,7 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
DBUG_PRINT("info", ("ha_myisammrg::open exit %d", my_errno));
return (my_errno ? my_errno : -1);
}
- DBUG_PRINT("info", ("ha_myisammrg::open myrg_extrafunc..."))
+ DBUG_PRINT("info", ("ha_myisammrg::open myrg_extrafunc..."));
myrg_extrafunc(file, query_cache_invalidate_by_MyISAM_filename_ref);
if (!(test_if_locked == HA_OPEN_WAIT_IF_LOCKED ||
test_if_locked == HA_OPEN_ABORT_IF_LOCKED))
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 361401e22d6..69b4675c290 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -2773,7 +2773,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
ndb_blob->getDefined(isNull);
if (isNull == 1)
{
- DBUG_PRINT("info",("[%u] NULL", col_no))
+ DBUG_PRINT("info",("[%u] NULL", col_no));
field->set_null(row_offset);
}
else if (isNull == -1)
@@ -2811,15 +2811,18 @@ void ha_ndbcluster::unpack_record(byte *buf)
const NDBCOL *hidden_col= tab->getColumn(hidden_no);
const NdbRecAttr* rec= m_value[hidden_no].rec;
DBUG_ASSERT(rec);
- DBUG_PRINT("hidden", ("%d: %s \"%llu\"", hidden_no,
+ DBUG_PRINT("hidden", ("%d: %s \"%llu\"", hidden_no,
hidden_col->getName(), rec->u_64_value()));
- }
- //print_results();
+ }
+ //DBUG_EXECUTE("value", print_results(););
#endif
}
/*
Utility function to print/dump the fetched field
+ to avoid unnecessary work, wrap in DBUG_EXECUTE as in:
+
+ DBUG_EXECUTE("value", print_results(););
*/
void ha_ndbcluster::print_results()
@@ -2827,8 +2830,6 @@ void ha_ndbcluster::print_results()
DBUG_ENTER("print_results");
#ifndef DBUG_OFF
- if (!_db_on_)
- DBUG_VOID_RETURN;
char buf_type[MAX_FIELD_WIDTH], buf_val[MAX_FIELD_WIDTH];
String type(buf_type, sizeof(buf_type), &my_charset_bin);
@@ -6413,7 +6414,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
if (!is_autocommit)
{
- DBUG_PRINT("exit", ("Can't register table during transaction"))
+ DBUG_PRINT("exit", ("Can't register table during transaction"));
DBUG_RETURN(FALSE);
}
@@ -6421,7 +6422,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
if (ndb_get_commitcount(thd, m_dbname, m_tabname, &commit_count))
{
*engine_data= 0;
- DBUG_PRINT("exit", ("Error, could not get commitcount"))
+ DBUG_PRINT("exit", ("Error, could not get commitcount"));
DBUG_RETURN(FALSE);
}
*engine_data= commit_count;
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 0fa9daa66b4..1239bf50641 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -100,24 +100,21 @@ static TABLE_LIST binlog_tables;
#ifndef DBUG_OFF
static void print_records(TABLE *table, const char *record)
{
- if (_db_on_)
+ for (uint j= 0; j < table->s->fields; j++)
{
- for (uint j= 0; j < table->s->fields; j++)
+ char buf[40];
+ int pos= 0;
+ Field *field= table->field[j];
+ const byte* field_ptr= field->ptr - table->record[0] + record;
+ int pack_len= field->pack_length();
+ int n= pack_len < 10 ? pack_len : 10;
+
+ for (int i= 0; i < n && pos < 20; i++)
{
- char buf[40];
- int pos= 0;
- Field *field= table->field[j];
- const byte* field_ptr= field->ptr - table->record[0] + record;
- int pack_len= field->pack_length();
- int n= pack_len < 10 ? pack_len : 10;
-
- for (int i= 0; i < n && pos < 20; i++)
- {
- pos+= sprintf(&buf[pos]," %x", (int) (unsigned char) field_ptr[i]);
- }
- buf[pos]= 0;
- DBUG_PRINT("info",("[%u]field_ptr[0->%d]: %s", j, n, buf));
+ pos+= sprintf(&buf[pos]," %x", (int) (unsigned char) field_ptr[i]);
}
+ buf[pos]= 0;
+ DBUG_PRINT("info",("[%u]field_ptr[0->%d]: %s", j, n, buf));
}
}
#else
@@ -2483,7 +2480,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
DBUG_ASSERT(ret == 0);
}
ndb_unpack_record(table, share->ndb_value[n], &b, table->record[n]);
- print_records(table, table->record[n]);
+ DBUG_EXECUTE("info", print_records(table, table->record[n]););
trans.delete_row(::server_id, injector::transaction::table(table, true),
&b, n_fields, table->record[n]);
}
@@ -2502,7 +2499,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
}
ndb_unpack_record(table, share->ndb_value[0],
&b, table->record[0]);
- print_records(table, table->record[0]);
+ DBUG_EXECUTE("info", print_records(table, table->record[0]););
if (table->s->primary_key != MAX_KEY)
{
/*
@@ -2527,7 +2524,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
DBUG_ASSERT(ret == 0);
}
ndb_unpack_record(table, share->ndb_value[1], &b, table->record[1]);
- print_records(table, table->record[1]);
+ DBUG_EXECUTE("info", print_records(table, table->record[1]););
trans.update_row(::server_id,
injector::transaction::table(table, true),
&b, n_fields,
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index e2eb60892f4..2abf9984464 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2860,7 +2860,7 @@ longlong Item_is_not_null_test::val_int()
}
if (args[0]->is_null())
{
- DBUG_PRINT("info", ("null"))
+ DBUG_PRINT("info", ("null"));
owner->was_null|= 1;
DBUG_RETURN(0);
}
diff --git a/sql/lock.cc b/sql/lock.cc
index 5f1141cc841..9cd0dcce610 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -622,7 +622,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
table_ptr[i], count,
(thd == logger.get_general_log_thd()) ||
(thd == logger.get_slow_log_thd())))
- return 0;
+ DBUG_RETURN(0);
}
if (!(sql_lock= (MYSQL_LOCK*)
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 64a692d394d..2427825e646 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5654,7 +5654,7 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
m_data_size= TABLE_MAP_HEADER_LEN;
- DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", m_data_size= 6;)
+ DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", m_data_size= 6;);
m_data_size+= m_dblen + 2; // Include length and terminating \0
m_data_size+= m_tbllen + 2; // Include length and terminating \0
m_data_size+= 1 + m_colcnt; // COLCNT and column types
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index be476c11533..1cdb7f53096 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1089,12 +1089,8 @@ pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
extern "C" sig_handler print_signal_warning(int sig)
{
- if (!DBUG_IN_USE)
- {
- if (global_system_variables.log_warnings)
- sql_print_warning("Got signal %d from thread %d",
- sig,my_thread_id());
- }
+ if (global_system_variables.log_warnings)
+ sql_print_warning("Got signal %d from thread %d", sig,my_thread_id());
#ifdef DONT_REMEMBER_SIGNAL
my_sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
@@ -1717,7 +1713,7 @@ void end_thread(THD *thd, bool put_in_cache)
! abort_loop && !kill_cached_threads)
{
/* Don't kill the thread, just put it in cache for reuse */
- DBUG_PRINT("info", ("Adding thread to cache"))
+ DBUG_PRINT("info", ("Adding thread to cache"));
cached_thread_count++;
while (!abort_loop && ! wake_thread && ! kill_cached_threads)
(void) pthread_cond_wait(&COND_thread_cache, &LOCK_thread_count);
@@ -1738,13 +1734,13 @@ void end_thread(THD *thd, bool put_in_cache)
}
}
- DBUG_PRINT("info", ("sending a broadcast"))
+ DBUG_PRINT("info", ("sending a broadcast"));
/* Tell main we are ready */
(void) pthread_mutex_unlock(&LOCK_thread_count);
/* It's safe to broadcast outside a lock (COND... is not deleted here) */
(void) pthread_cond_broadcast(&COND_thread_count);
- DBUG_PRINT("info", ("unlocked thread_count mutex"))
+ DBUG_PRINT("info", ("unlocked thread_count mutex"));
#ifdef ONE_THREAD
if (!(test_flags & TEST_NO_THREADS)) // For debugging under Linux
#endif
@@ -3467,8 +3463,6 @@ int win_main(int argc, char **argv)
int main(int argc, char **argv)
#endif
{
- DEBUGGER_OFF;
-
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;
if (!rpl_filter || !binlog_filter)
@@ -7065,7 +7059,6 @@ static void mysql_init_variables(void)
max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
global_system_variables.old_passwords= 0;
global_system_variables.old_alter_table= 0;
-
/*
Default behavior for 4.1 and 5.0 is to treat NULL values as unequal
when collecting index statistics for MyISAM tables.
@@ -7172,7 +7165,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
switch(optid) {
case '#':
#ifndef DBUG_OFF
- DBUG_PUSH(argument ? argument : default_dbug_option);
+ DBUG_SET(argument ? argument : default_dbug_option);
+ DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
#endif
opt_endinfo=1; /* unireg: memory allocation */
break;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 887690aecc1..9fe3212a0f8 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -10162,8 +10162,6 @@ static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map,
int idx;
char buff[1024];
DBUG_ENTER("print_sel_tree");
- if (! _db_on_)
- DBUG_VOID_RETURN;
String tmp(buff,sizeof(buff),&my_charset_bin);
tmp.length(0);
@@ -10192,9 +10190,7 @@ static void print_ror_scans_arr(TABLE *table, const char *msg,
struct st_ror_scan_info **start,
struct st_ror_scan_info **end)
{
- DBUG_ENTER("print_ror_scans");
- if (! _db_on_)
- DBUG_VOID_RETURN;
+ DBUG_ENTER("print_ror_scans_arr");
char buff[1024];
String tmp(buff,sizeof(buff),&my_charset_bin);
@@ -10258,7 +10254,7 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg)
{
char buf[MAX_KEY/8+1];
DBUG_ENTER("print_quick");
- if (! _db_on_ || !quick)
+ if (!quick)
DBUG_VOID_RETURN;
DBUG_LOCK_FILE;
diff --git a/sql/set_var.cc b/sql/set_var.cc
index a6c2fca7fc5..efdd44d7caa 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -205,6 +205,9 @@ sys_var_long_ptr sys_concurrent_insert("concurrent_insert",
&myisam_concurrent_insert);
sys_var_long_ptr sys_connect_timeout("connect_timeout",
&connect_timeout);
+#ifndef DBUG_OFF
+sys_var_thd_dbug sys_dbug("debug");
+#endif
sys_var_enum sys_delay_key_write("delay_key_write",
&delay_key_write_options,
&delay_key_write_typelib,
@@ -722,13 +725,16 @@ SHOW_VAR init_vars[]= {
{"datadir", mysql_real_data_home, SHOW_CHAR},
{sys_date_format.name, (char*) &sys_date_format, SHOW_SYS},
{sys_datetime_format.name, (char*) &sys_datetime_format, SHOW_SYS},
+#ifndef DBUG_OFF
+ {sys_dbug.name, (char*) &sys_dbug, SHOW_SYS},
+#endif
{sys_default_week_format.name, (char*) &sys_default_week_format, SHOW_SYS},
{sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS},
{sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS},
{sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
{sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
{sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
- {sys_engine_condition_pushdown.name,
+ {sys_engine_condition_pushdown.name,
(char*) &sys_engine_condition_pushdown, SHOW_SYS},
{sys_event_executor.name, (char*) &sys_event_executor, SHOW_SYS},
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
@@ -3461,6 +3467,33 @@ bool sys_var_trust_routine_creators::update(THD *thd, set_var *var)
return sys_var_bool_ptr::update(thd, var);
}
+/* even session variable here requires SUPER, because of -#o,file */
+bool sys_var_thd_dbug::check(THD *thd, set_var *var)
+{
+ return check_global_access(thd, SUPER_ACL);
+}
+
+bool sys_var_thd_dbug::update(THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ DBUG_SET_INITIAL(var ? var->value->str_value.c_ptr() : "");
+ else
+ {
+ DBUG_POP();
+ DBUG_PUSH(var ? var->value->str_value.c_ptr() : "");
+ }
+ return 0;
+}
+
+byte *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b)
+{
+ char buf[256];
+ if (type == OPT_GLOBAL)
+ DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
+ else
+ DBUG_EXPLAIN(buf, sizeof(buf));
+ (byte*) thd->strdup(buf);
+}
/****************************************************************************
Used templates
diff --git a/sql/set_var.h b/sql/set_var.h
index 34873947483..9b640517e64 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -45,7 +45,7 @@ public:
struct my_option *option_limits; /* Updated by by set_var_init() */
uint name_length; /* Updated by by set_var_init() */
const char *name;
-
+
sys_after_update_func after_update;
bool no_support_one_shot;
sys_var(const char *name_arg)
@@ -413,7 +413,7 @@ class sys_var_thd_bit :public sys_var_thd
public:
ulong bit_flag;
bool reverse;
- sys_var_thd_bit(const char *name_arg,
+ sys_var_thd_bit(const char *name_arg,
sys_check_func c_func, sys_update_func u_func,
ulong bit, bool reverse_arg=0)
:sys_var_thd(name_arg), check_func(c_func), update_func(u_func),
@@ -427,6 +427,24 @@ public:
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
+class sys_var_thd_dbug :public sys_var_thd
+{
+public:
+ sys_var_thd_dbug(const char *name_arg) :sys_var_thd(name_arg) {}
+ bool check_update_type(Item_result type) { return type != STRING_RESULT; }
+ bool check(THD *thd, set_var *var);
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type)
+ {
+ char buf[256];
+ DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
+ DBUG_SET(buf);
+ }
+ byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
+};
+
+
/* some variables that require special handling */
diff --git a/sql/slave.cc b/sql/slave.cc
index 763db31c05d..e60521af3a0 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2920,7 +2920,7 @@ static int has_temporary_error(THD *thd)
MYSQL_ERROR *err;
while ((err= it++))
{
- DBUG_PRINT("info", ("has warning %d %s", err->code, err->msg))
+ DBUG_PRINT("info", ("has warning %d %s", err->code, err->msg));
switch (err->code)
{
case ER_GET_TEMPORARY_ERRMSG:
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index aec370e104a..5b060aa13c6 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -316,13 +316,13 @@ TODO list:
#define MUTEX_UNLOCK(M) {DBUG_PRINT("lock", ("mutex unlock 0x%lx",\
(ulong)(M))); pthread_mutex_unlock(M);}
#define RW_WLOCK(M) {DBUG_PRINT("lock", ("rwlock wlock 0x%lx",(ulong)(M))); \
- if (!rw_wrlock(M)) DBUG_PRINT("lock", ("rwlock wlock ok")) \
+ if (!rw_wrlock(M)) DBUG_PRINT("lock", ("rwlock wlock ok")); \
else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); }
#define RW_RLOCK(M) {DBUG_PRINT("lock", ("rwlock rlock 0x%lx", (ulong)(M))); \
- if (!rw_rdlock(M)) DBUG_PRINT("lock", ("rwlock rlock ok")) \
+ if (!rw_rdlock(M)) DBUG_PRINT("lock", ("rwlock rlock ok")); \
else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); }
#define RW_UNLOCK(M) {DBUG_PRINT("lock", ("rwlock unlock 0x%lx",(ulong)(M))); \
- if (!rw_unlock(M)) DBUG_PRINT("lock", ("rwlock unlock ok")) \
+ if (!rw_unlock(M)) DBUG_PRINT("lock", ("rwlock unlock ok")); \
else DBUG_PRINT("lock", ("rwlock unlock FAILED %d", errno)); }
#define STRUCT_LOCK(M) {DBUG_PRINT("lock", ("%d struct lock...",__LINE__)); \
pthread_mutex_lock(M);DBUG_PRINT("lock", ("struct lock OK"));}
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 9fee7abb619..ecada58dace 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -518,7 +518,7 @@ static int plugin_initialize(struct st_plugin_int *plugin)
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
DBUG_PRINT("warning", ("Plugin '%s' init function returned error.",
- plugin->name.str))
+ plugin->name.str));
goto err;
}
}
@@ -531,7 +531,7 @@ static int plugin_initialize(struct st_plugin_int *plugin)
sql_print_error("Plugin '%s' handlerton init returned error.",
plugin->name.str);
DBUG_PRINT("warning", ("Plugin '%s' handlerton init returned error.",
- plugin->name.str))
+ plugin->name.str));
goto err;
}
break;
@@ -580,7 +580,7 @@ static void plugin_call_deinitializer(void)
if (tmp->plugin->deinit())
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- tmp->name.str))
+ tmp->name.str));
}
}
tmp->state= PLUGIN_IS_UNINITIALIZED;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 47aa53d25e2..e4ac532d679 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13197,7 +13197,7 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
for (i= 0; (item= it++); i++)
{
Field *field;
-
+
if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM)
item_field= item;
else
@@ -13216,7 +13216,7 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
DBUG_RETURN(TRUE); // Fatal error
item_field->name= item->name;
#ifndef DBUG_OFF
- if (_db_on_ && !item_field->name)
+ if (!item_field->name)
{
char buff[256];
String str(buff,sizeof(buff),&my_charset_bin);