1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
unknown
2006-02-14 22:36:11 +01:00
parent 8017e9c4e7
commit d3ee9abf2a
35 changed files with 1781 additions and 1611 deletions

View File

@ -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;