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

Fixes for Opensolaris (to get buildbot green)

- Fixed memory leaks in mysqldump
- Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
- Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris


client/mysqldump.c:
  Fixed memory leaks
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
client/mysqltest.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
include/my_global.h:
  Added simple macro val_or_null() to simplify detecting of NULL strings for printf
sql/handler.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
sql/sql_db.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
  Removed testing of 'new_db_name' as this is guranteed never NULL
sql/sql_show.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
storage/csv/ha_tina.cc:
  Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris
  (OpenSolaris default malloc() can't handle a lot of reallocs() of strings that are growing one byte at a time)
  This did speed up logging to cvs with a magnitude for large strings.
This commit is contained in:
Michael Widenius
2010-06-23 03:48:11 +03:00
parent cfbee9359c
commit 5a2f40d48a
7 changed files with 21 additions and 13 deletions

View File

@ -1441,6 +1441,7 @@ static void free_resources()
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
my_free(current_host, MYF(MY_ALLOW_ZERO_PTR));
if (hash_inited(&ignore_table))
hash_free(&ignore_table);
if (extended_insert)
@ -4222,7 +4223,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root)
}
mysql_free_result(table_res);
}
DBUG_PRINT("exit", ("new_table_name: %s", name));
DBUG_PRINT("exit", ("new_table_name: %s", val_or_null(name)));
DBUG_RETURN(name);
}
@ -4818,6 +4819,7 @@ static my_bool get_view_structure(char *table, char* db)
field= mysql_fetch_field_direct(table_res, 0);
if (strcmp(field->name, "View") != 0)
{
mysql_free_result(table_res);
switch_character_set_results(mysql, default_charset);
verbose_msg("-- It's base table, skipped\n");
DBUG_RETURN(0);
@ -4827,8 +4829,10 @@ static my_bool get_view_structure(char *table, char* db)
if (path)
{
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
{
mysql_free_result(table_res);
DBUG_RETURN(1);
}
write_header(sql_file, db);
}