1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Set --debug-check if one uses DBUG_PUSH in all clients

Fixed bug in query cache that made it impossible to run mysqld with --debug
Fixed memory leaks in mysqldump and mysqltest
Memory leaks associated with wrong usage of mysqltest is not fixed. To find these, run
mysql-test-run --debug mysqltest


client/mysql_upgrade.c:
  Set --debug-check if one uses DBUG_PUSH
client/mysqlcheck.c:
  Set --debug-check if one uses DBUG_PUSH
client/mysqldump.c:
  Set --debug-check if one uses DBUG_PUSH
  Fixed several memory leaks
client/mysqlimport.c:
  Set --debug-check if one uses DBUG_PUSH
client/mysqlshow.c:
  Set --debug-check if one uses DBUG_PUSH
client/mysqlslap.c:
  Set --debug-check if one uses DBUG_PUSH
client/mysqltest.c:
  Set --debug-check if one uses DBUG_PUSH
  Fixed some memory leaks
  Removed MY_CHECK_ERROR argument to my_end() as mysqltest.test otherwise shows MANY memory leaks
dbug/dbug.c:
  Fixed compiler warning
  Force flush of out_file on end
  Removed some wrong dbug_flush(0) commands that could cause crashes
mysys/my_init.c:
  Don't write memory usage if MY_GIVE_INFO is not given
sql/sql_cache.cc:
  Fixed bug in query cache that made it impossible to run mysqld with --debug
This commit is contained in:
unknown
2007-08-02 07:49:29 +03:00
parent 0c9a3e597d
commit f9ea427508
10 changed files with 72 additions and 33 deletions

View File

@ -1184,7 +1184,7 @@ void _db_dump_(uint _line_, const char *keyword,
fprintf(cs->stack->out_file, "%s: ", cs->func);
}
sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%ld)\n",
keyword,(ulong) memory, length);
keyword, (ulong) memory, (long) length);
(void) fputs(dbuff,cs->stack->out_file);
pos=0;
@ -1449,6 +1449,7 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state)
FreeList(state->p_functions);
if (!is_shared(state, out_file))
DBUGCloseFile(cs, state->out_file);
(void) fflush(cs->stack->out_file);
if (state->prof_file)
DBUGCloseFile(cs, state->prof_file);
if (free_state)
@ -1882,7 +1883,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
dbug_flush(0);
(void) Delay(cs->stack->delay);
}
else
@ -1892,7 +1892,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
dbug_flush(0);
}
else
{
@ -1931,7 +1930,7 @@ static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
pthread_mutex_lock(&THR_LOCK_dbug);
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
perror("");
dbug_flush(0);
dbug_flush(cs);
}
}