diff options
author | Michael Widenius <monty@askmonty.org> | 2010-06-23 03:48:11 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-06-23 03:48:11 +0300 |
commit | 5a2f40d48a6fda6b83f788a0f849299bd44b621e (patch) | |
tree | 0c1bb17e3c52203b6b3a4ace5ccbb77a5c23a40b /client | |
parent | cfbee9359c4282cbff7426d6e71994205964f2df (diff) | |
download | mariadb-git-5a2f40d48a6fda6b83f788a0f849299bd44b621e.tar.gz |
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 8 | ||||
-rw-r--r-- | client/mysqltest.cc | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 212baca6be8..a9fe3f8e1fa 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -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); } diff --git a/client/mysqltest.cc b/client/mysqltest.cc index e89f87758c6..a6bfc72070c 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -541,7 +541,7 @@ public: { DBUG_ENTER("LogFile::open"); DBUG_PRINT("enter", ("dir: '%s', name: '%s'", - dir, name)); + val_or_null(dir), val_or_null(name))); if (!name) { m_file= stdout; |