diff options
author | sasha@mysql.sashanet.com <> | 2002-03-26 22:19:23 -0700 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2002-03-26 22:19:23 -0700 |
commit | f28f8d086d3f5e1ede685b86ce64da5641437bcf (patch) | |
tree | ab4d73690dcb8e3ef54e70015f1838cf17a2577a /dbug | |
parent | 2e6b48afd31008809439900db2d577ea0ff9d90f (diff) | |
download | mariadb-git-f28f8d086d3f5e1ede685b86ce64da5641437bcf.tar.gz |
coverted my_thread_init() /end to use my_malloc()/my_free() to help track
down replication corruption
Diffstat (limited to 'dbug')
-rw-r--r-- | dbug/dbug.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 9e1e51d2404..8f214bfbe7c 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -21,7 +21,8 @@ * all copies and derivative works. Thank you. * * * * The author makes no warranty of any kind with respect to this * - * product and explicitly disclaims any implied warranties of mer- * + * product and explicitly disclaims any implied warranties of mer- *ct_lex.table_list.first=0; + thd->lex.selec * chantability or fitness for any particular purpose. * * * ****************************************************************************** @@ -58,7 +59,7 @@ * seismo!bpa!sjuvax!bbanerje * * Michael Widenius: - * DBUG_DUMP - To dump a pice of memory. + * DBUG_DUMP - To dump a block of memory. * PUSH_FLAG "O" - To be used insted of "o" if we don't * want flushing (for slow systems) * PUSH_FLAG "A" - as 'O', but we will append to the out file instead @@ -707,7 +708,13 @@ char ***_sframep_ __attribute__((unused))) int save_errno=errno; if (!init_done) _db_push_ (_DBUG_START_CONDITION_); - state=code_state(); + /* Sasha: the test below is so we could call functions with DBUG_ENTER + before my_thread_init(). I needed this because I suspected corruption + of a block allocated by my_thread_init() itself, so I wanted to use + my_malloc()/my_free() in my_thread_init()/my_thread_end() + */ + if (!(state=code_state())) + return; *_sfunc_ = state->func; *_sfile_ = state->file; @@ -855,6 +862,9 @@ uint _line_, const char *keyword) { CODE_STATE *state=code_state(); + /* Sasha: pre-my_thread_init() safety */ + if (!state) + return; state->u_line = _line_; state->u_keyword = (char*) keyword; } @@ -890,7 +900,9 @@ void _db_doprnt_ (const char *format,...) { va_list args; CODE_STATE *state; - state=code_state(); + /* Sasha: pre-my_thread_init() safety */ + if (!(state=code_state())) + return; va_start(args,format); @@ -942,7 +954,9 @@ uint length) int pos; char dbuff[90]; CODE_STATE *state; - state=code_state(); + /* Sasha: pre-my_thread_init() safety */ + if (!(state=code_state())) + return; if (_db_keyword_ ((char*) keyword)) { @@ -1224,7 +1238,9 @@ const char *keyword) if (!init_done) _db_push_ (""); - state=code_state(); + /* Sasha: pre-my_thread_init() safety */ + if (!(state=code_state())) + return FALSE; result = FALSE; if (DEBUGGING && state->level <= stack -> maxdepth && |