fixed bug #1378 "mysqlbinlog for remote host is broken"

parent 65058069
This diff is collapsed.
...@@ -54,6 +54,12 @@ insert into t1 values ("abirvalg"); ...@@ -54,6 +54,12 @@ insert into t1 values ("abirvalg");
SET INSERT_ID=1; SET INSERT_ID=1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
insert into t2 values (); insert into t2 values ();
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-6-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
...@@ -63,18 +69,7 @@ SET TIMESTAMP=1000000000; ...@@ -63,18 +69,7 @@ SET TIMESTAMP=1000000000;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
--- --database -- --- --database --
use test;
SET TIMESTAMP=1000000000;
create table t1 (word varchar(20));
SET TIMESTAMP=1000000000;
create table t2 (id int auto_increment not null primary key);
SET TIMESTAMP=1000000000;
insert into t1 values ("abirvalg");
SET INSERT_ID=1; SET INSERT_ID=1;
SET TIMESTAMP=1000000000;
insert into t2 values ();
SET TIMESTAMP=1000000000;
insert into t1 values ("Alas");
--- --position -- --- --position --
use test; use test;
......
...@@ -64,10 +64,6 @@ select "--- --position --" as ""; ...@@ -64,10 +64,6 @@ select "--- --position --" as "";
# These are tests for remote binlog. # These are tests for remote binlog.
# They should return the same as previous test. # They should return the same as previous test.
# But now they are not. V. Vagin should fix this.
# We test all the same options second time since code for remote case is
# essentially different. If code for both cases will be unified we'll be
# able to throw out most of this.
--disable_query_log --disable_query_log
select "--- Remote --" as ""; select "--- Remote --" as "";
......
...@@ -1189,7 +1189,7 @@ Load_log_event::Load_log_event(THD* thd_arg, sql_exchange* ex, ...@@ -1189,7 +1189,7 @@ Load_log_event::Load_log_event(THD* thd_arg, sql_exchange* ex,
num_fields(0),fields(0), num_fields(0),fields(0),
field_lens(0),field_block_len(0), field_lens(0),field_block_len(0),
table_name(table_name_arg ? table_name_arg : ""), table_name(table_name_arg ? table_name_arg : ""),
db(db_arg), fname(ex->file_name) db(db_arg), fname(ex->file_name), local_fname(FALSE)
{ {
time_t end_time; time_t end_time;
time(&end_time); time(&end_time);
...@@ -1265,7 +1265,7 @@ Load_log_event::Load_log_event(const char* buf, int event_len, ...@@ -1265,7 +1265,7 @@ Load_log_event::Load_log_event(const char* buf, int event_len,
bool old_format) bool old_format)
:Log_event(buf, old_format),num_fields(0),fields(0), :Log_event(buf, old_format),num_fields(0),fields(0),
field_lens(0),field_block_len(0), field_lens(0),field_block_len(0),
table_name(0),db(0),fname(0) table_name(0),db(0),fname(0),local_fname(FALSE)
{ {
if (!event_len) // derived class, will call copy_log_event() itself if (!event_len) // derived class, will call copy_log_event() itself
return; return;
......
...@@ -411,17 +411,19 @@ class Load_log_event: public Log_event ...@@ -411,17 +411,19 @@ class Load_log_event: public Log_event
const char* fname; const char* fname;
uint32 skip_lines; uint32 skip_lines;
sql_ex_info sql_ex; sql_ex_info sql_ex;
bool local_fname;
/* fname doesn't point to memory inside Log_event::temp_buf */ /* fname doesn't point to memory inside Log_event::temp_buf */
void set_fname_outside_temp_buf(const char *afname, uint alen) void set_fname_outside_temp_buf(const char *afname, uint alen)
{ {
fname= afname; fname= afname;
fname_len= alen; fname_len= alen;
local_fname= true;
} }
/* fname doesn't point to memory inside Log_event::temp_buf */ /* fname doesn't point to memory inside Log_event::temp_buf */
int check_fname_outside_temp_buf() int check_fname_outside_temp_buf()
{ {
return fname < temp_buf || fname > temp_buf+ cached_event_len; return local_fname;
} }
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment