diff options
author | vva@eagle.mysql.r18.ru <> | 2003-01-17 21:59:03 +0400 |
---|---|---|
committer | vva@eagle.mysql.r18.ru <> | 2003-01-17 21:59:03 +0400 |
commit | 1b25ee3579ca48e3792f3226a77934baaef1a128 (patch) | |
tree | 4a4c82bbfd62e7afa2bfdaa5069b918c5222e4b7 /sql | |
parent | 2d332844eb3d18651cf21867d845161e0ca86a2f (diff) | |
parent | 4b5a313c1a90e7b5d70c5e9dc3ef09f34a386fe4 (diff) | |
download | mariadb-git-1b25ee3579ca48e3792f3226a77934baaef1a128.tar.gz |
Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/4.1
into eagle.mysql.r18.ru:/home/vva/work/BINLOG_LOADDATA/4.1.clear
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 29 | ||||
-rw-r--r-- | sql/log_event.h | 8 |
2 files changed, 33 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index d025f8a57a7..459edcacd23 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1366,7 +1366,10 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if (db && db[0] && !same_db) fprintf(file, "use %s;\n", db); - fprintf(file, "LOAD DATA INFILE '%-*s' ", fname_len, fname); + fprintf(file, "LOAD "); + if (check_fname_outside_temp_buf()) + fprintf(file, "LOCAL "); + fprintf(file, "DATA INFILE '%-*s' ", fname_len, fname); if (sql_ex.opt_flags && REPLACE_FLAG ) fprintf(file," REPLACE "); @@ -2282,14 +2285,32 @@ Create_file_log_event::Create_file_log_event(const char* buf, int len, ****************************************************************************/ #ifdef MYSQL_CLIENT -void Create_file_log_event::print(FILE* file, bool short_form, - char* last_db) +void Create_file_log_event::print(FILE* file, bool short_form, + char* last_db, bool enable_local) { if (short_form) + { + if (enable_local && check_fname_outside_temp_buf()) + Load_log_event::print(file, 1, last_db); return; - Load_log_event::print(file, 1, last_db); + } + + if (enable_local) + { + if (!check_fname_outside_temp_buf()) + fprintf(file, "#"); + Load_log_event::print(file, 1, last_db); + fprintf(file, "#"); + } + fprintf(file, " file_id: %d block_len: %d\n", file_id, block_len); } + +void Create_file_log_event::print(FILE* file, bool short_form, + char* last_db) +{ + print(file,short_form,last_db,0); +} #endif // MYSQL_CLIENT /***************************************************************************** diff --git a/sql/log_event.h b/sql/log_event.h index 80c448e1550..8046d0abb92 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -447,6 +447,13 @@ public: uint32 skip_lines; sql_ex_info sql_ex; + /* fname doesn't point to memory inside Log_event::temp_buf */ + void set_fname_outside_temp_buf(const char *afname, uint alen) + {fname=afname;fname_len=alen;} + /* fname doesn't point to memory inside Log_event::temp_buf */ + int check_fname_outside_temp_buf() + {return fname<temp_buf || fname>temp_buf+cached_event_len;} + #ifndef MYSQL_CLIENT String field_lens_buf; String fields_buf; @@ -690,6 +697,7 @@ public: int exec_event(struct st_relay_log_info* rli); #else void print(FILE* file, bool short_form = 0, char* last_db = 0); + void print(FILE* file, bool short_form, char* last_db, bool enable_local); #endif Create_file_log_event(const char* buf, int event_len, bool old_format); |