summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-16 10:15:52 +0200
committerunknown <monty@mysql.com>2004-02-16 10:15:52 +0200
commitd00fbce3083f11d071300447e11dab124debb2b7 (patch)
treef9bef14abcf4ef1e6145cb3c16e63c9a56e221e9 /client
parenta07e48eca04b1564da9868f229ba5d958994db69 (diff)
parent40ad9154930ca5d42649b776f84989cc372b060c (diff)
downloadmariadb-git-d00fbce3083f11d071300447e11dab124debb2b7.tar.gz
Merge with 4.0 to get fix for mysqlbinlog
mysql-test/r/mysqlbinlog.result: Auto merged mysql-test/r/select_found.result: Auto merged mysql-test/t/select_found.test: Auto merged sql/log_event.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_load.cc: Auto merged support-files/mysql.spec.sh: Auto merged client/mysqlbinlog.cc: Merge with 4.0 configure.in: Merge with 4.0 mysql-test/r/range.result: Use local file mysql-test/t/range.test: Use local file sql/share/english/errmsg.txt: Use local file
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc31
1 files changed, 19 insertions, 12 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 27ad91c8e8a..82a57961c11 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -102,17 +102,18 @@ class Load_log_processor
}
public:
- Load_log_processor()
- {
- init_dynamic_array(&file_names,sizeof(Create_file_log_event*),
- 100,100 CALLER_INFO);
- }
-
+ Load_log_processor() {}
~Load_log_processor()
- {
- destroy();
- delete_dynamic(&file_names);
- }
+ {
+ destroy();
+ delete_dynamic(&file_names);
+ }
+
+ int init()
+ {
+ return init_dynamic_array(&file_names,sizeof(Create_file_log_event*),
+ 100,100 CALLER_INFO);
+ }
void init_by_dir_name(const char *dir)
{
@@ -345,7 +346,7 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
below.
*/
- ce->print(result_file, short_form, last_db, true);
+ ce->print(result_file, short_form, last_db, TRUE);
if (!old_format)
{
if (load_processor.process(ce))
@@ -371,7 +372,7 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
*/
if (ce)
{
- ce->print(result_file, short_form, last_db,true);
+ ce->print(result_file, short_form, last_db, TRUE);
my_free((char*)ce->fname,MYF(MY_WME));
delete ce;
}
@@ -459,6 +460,10 @@ void sql_print_error(const char *format,...)
static void cleanup()
{
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((char*) database, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((char*) host, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((char*) user, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((char*) dirname_for_local_load, MYF(MY_ALLOW_ZERO_PTR));
}
static void die(const char* fmt, ...)
@@ -885,6 +890,8 @@ int main(int argc, char** argv)
dirname_for_local_load= my_tmpdir(&tmpdir);
}
+ if (load_processor.init())
+ exit(1);
if (dirname_for_local_load)
load_processor.init_by_dir_name(dirname_for_local_load);
else