summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-08-10 05:14:16 +0300
committerunknown <monty@mashka.mysql.fi>2003-08-10 05:14:16 +0300
commit20901edafba09c0ef2236411b40eac06a85d2030 (patch)
tree43bb560b036b4b6e3f297dee470076f69404781e /sql/log_event.cc
parent6db21de014d603477952c7a16449bcae40a70e5c (diff)
downloadmariadb-git-20901edafba09c0ef2236411b40eac06a85d2030.tar.gz
Remove wrong bug fix when calling create_sort_index.
Fix possible replication bug with LOAD DATA ... IGNORE LINES # mysql-test/r/rpl_log.result: Test of load data ... ignore # lines mysql-test/t/rpl_log.test: Test of load data ... ignore # lines sql/log_event.cc: Fix replication bug with LOAD DATA ... IGNORE LINES # (Note that the code that is probably not executed in 4.0) sql/sql_parse.cc: Indentation fix sql/sql_select.cc: Remove wrong bug fix (all tests passes) sql/sql_yacc.yy: Indentation cleanup
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index f7955be3b09..3451ffab65f 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -329,8 +329,14 @@ void Load_log_event::pack_info(String* packet)
pretty_print_str(&tmp, sql_ex.line_start, sql_ex.line_start_len);
}
- if ((int)skip_lines > 0)
- tmp.append( " IGNORE %ld LINES ", (long) skip_lines);
+ if ((long) skip_lines > 0)
+ {
+ char nr_buff[32], *end;
+ tmp.append( " IGNORE ");
+ end= longlong10_to_str((longlong) skip_lines, nr_buff, 10);
+ tmp.append(nr_buff, (uint) (end-nr_buff));
+ tmp.append( " LINES");
+ }
if (num_fields)
{
@@ -1338,8 +1344,8 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
pretty_print_str(file, sql_ex.line_start, sql_ex.line_start_len);
}
- if ((int)skip_lines > 0)
- fprintf(file, " IGNORE %ld LINES ", (long) skip_lines);
+ if ((long) skip_lines > 0)
+ fprintf(file, " IGNORE %ld LINES", (long) skip_lines);
if (num_fields)
{
@@ -1934,20 +1940,22 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
else if (sql_ex.opt_flags & IGNORE_FLAG)
handle_dup= DUP_IGNORE;
else
+ {
/*
- Note that when replication is running fine, if it was DUP_ERROR on the
+ When replication is running fine, if it was DUP_ERROR on the
master then we could choose DUP_IGNORE here, because if DUP_ERROR
suceeded on master, and data is identical on the master and slave,
then there should be no uniqueness errors on slave, so DUP_IGNORE is
the same as DUP_ERROR. But in the unlikely case of uniqueness errors
- (because the data on the master and slave happen to be different (user
- error or bug), we want LOAD DATA to print an error message on the
- slave to discover the problem.
+ (because the data on the master and slave happen to be different
+ (user error or bug), we want LOAD DATA to print an error message on
+ the slave to discover the problem.
If reading from net (a 3.23 master), mysql_load() will change this
to DUP_IGNORE.
*/
handle_dup= DUP_ERROR;
+ }
sql_exchange ex((char*)fname, sql_ex.opt_flags & DUMPFILE_FLAG);
String field_term(sql_ex.field_term,sql_ex.field_term_len);