summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-13 16:05:09 +0200
committerunknown <monty@mysql.com>2004-02-13 16:05:09 +0200
commit0a95bda23a349639bd51c4b2c71da56ebd13d31f (patch)
tree0fed6c37f6c17ba97ac09f0dbecdf6846b11a97b /client/mysqlbinlog.cc
parent82e82a88e7704330ea1ac5c7d885c1cee56c6618 (diff)
downloadmariadb-git-0a95bda23a349639bd51c4b2c71da56ebd13d31f.tar.gz
Always use libtool with "--preserve-dup-deps"
Always use all LOAD DATA options in replication. Fixed problem in mysqlbinlog where LOAD DATA options could be overwritten. client/mysqlbinlog.cc: Ensure that we don't call init_dynamic_array() before my_init() has been done configure.in: Always use libtool with "--preserve-dup-deps" to prevent link problems with g++ mysql-test/r/mysqlbinlog.result: new results mysql-test/r/range.result: new results mysql-test/t/range.test: add missing DROP TABLE sql/log_event.cc: Always use all LOAD DATA options. This is needed to handle commands of type "FIELDS TERMINATED BY ''" Allocate memory for Create_file_log_event options as these may be overwritten in mysqlbinlog sql/log_event.h: Free buffer
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r--client/mysqlbinlog.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 90c3cfc98f6..71819070a85 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -103,17 +103,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)
{
@@ -350,7 +351,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))
@@ -376,7 +377,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;
}
@@ -458,6 +459,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, ...)
@@ -469,12 +474,13 @@ static void die(const char* fmt, ...)
fprintf(stderr, "\n");
va_end(args);
cleanup();
+ my_end(0);
exit(1);
}
static void print_version()
{
- printf("%s Ver 2.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
+ printf("%s Ver 2.5 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -935,6 +941,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