diff options
author | unknown <ram@mysql.r18.ru> | 2003-07-05 01:06:18 +0500 |
---|---|---|
committer | unknown <ram@mysql.r18.ru> | 2003-07-05 01:06:18 +0500 |
commit | 4e4ab26f53bada8aaebbe7650a08f3e9ecf15107 (patch) | |
tree | 0131b4955a232667237d9aa13b0e9f189dbb48e5 /sql | |
parent | 30341167c50dd59ecdd11100b0d5e2fec14ca02b (diff) | |
parent | cdb44cd45529dfece3e98b4941201cb228070159 (diff) | |
download | mariadb-git-4e4ab26f53bada8aaebbe7650a08f3e9ecf15107.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.r18.ru:/usr/home/ram/work/4.0
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 ae4a429e35f..5f3d4263642 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1289,7 +1289,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 DATA "); + if (check_fname_outside_temp_buf()) + fprintf(file, "LOCAL "); + fprintf(file, "INFILE '%-*s' ", fname_len, fname); if (sql_ex.opt_flags & REPLACE_FLAG ) fprintf(file," REPLACE "); @@ -1550,14 +1553,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 #ifndef MYSQL_CLIENT diff --git a/sql/log_event.h b/sql/log_event.h index a55efffa319..0a807bd524d 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -404,6 +404,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; @@ -636,6 +643,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); |