diff options
author | unknown <guilhem@mysql.com> | 2003-08-19 17:00:36 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-08-19 17:00:36 +0200 |
commit | d43a347db179f4601465debc3bfd3cfbb87d1528 (patch) | |
tree | 572706e4da26928b7adb044c7b188049dfa27b97 /sql/log_event.cc | |
parent | fe0e54643492c6b689664ed09206db58dca29967 (diff) | |
download | mariadb-git-d43a347db179f4601465debc3bfd3cfbb87d1528.tar.gz |
Use my_b_append instead of my_b_write on a SEQ_READ_APPEND cache, when we write
the first 4 bytes of the relay log. Indeed comments in mysys/mf_iocache.c
say we must always use my_b_append for such a cache.
This *could* avoid a very rare assertion failure which is:
030524 19:32:38 Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log '/
users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000001' position: 4
030524 19:32:38 next log '/users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000002' is currently active
mysqld: mf_iocache.c:701: _my_b_seq_read: Assertion `pos_in_file == info->end_of_file' failed.
and which seemed to happen always when the SQL thread and/or the I/O thread
were at position 4 in a relay log.
include/my_sys.h:
moving a function from log_event.cc so that it can be widely used
mysys/mf_iocache.c:
moving a function from log_event.cc so that it can be widely used
sql/log.cc:
my_b_write should not be used on a SEQ_READ_APPEND cache, one should use my_b_append
(otherwise there could be some locking problems).
sql/log_event.cc:
moved to mysys/mf_iocache.c for wider use.
A typo.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 591ebf2b5d8..2a1669737f8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -26,20 +26,6 @@ #include <assert.h> -inline int my_b_safe_write(IO_CACHE* file, const byte *buf, - int len) -{ - /* - Sasha: We are not writing this with the ? operator to avoid hitting - a possible compiler bug. At least gcc 2.95 cannot deal with - several layers of ternary operators that evaluated comma(,) operator - expressions inside - I do have a test case if somebody wants it - */ - if (file->type == SEQ_READ_APPEND) - return my_b_append(file, buf,len); - return my_b_write(file, buf,len); -} - #ifdef MYSQL_CLIENT static void pretty_print_str(FILE* file, char* str, int len) { @@ -2039,7 +2025,7 @@ Slave: load data infile on table '%s' at log position %s in log \ err=ER(sql_errno); } slave_print_error(rli,sql_errno,"\ -Error '%s' running lOAD DATA INFILE on table '%s'. Default database: '%s'", +Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", err, (char*)table_name, print_slave_db_safe(db)); free_root(&thd->mem_root,0); return 1; |