summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/sin.intern.azundris.com>2007-07-09 08:11:38 +0200
committerunknown <tnurnberg@mysql.com/sin.intern.azundris.com>2007-07-09 08:11:38 +0200
commit82ac789172d627739541284cd1f314d4fa514a3e (patch)
tree41f246bee79f92ee688ac594c685becb160b929f /sql/log.cc
parent68e1f851ed1d41923da17b5bfafdd2ad4d94f24a (diff)
downloadmariadb-git-82ac789172d627739541284cd1f314d4fa514a3e.tar.gz
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
dollin' it up for Guilhem ;) -- test streamlined, better comments, faster code, add'l assert. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB comment clarified
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc
index bcaf352f620..164dbd0d2d5 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1965,14 +1965,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
}
/*
- Adjust hdr_offs. Note that this doesn't mean it will necessarily
- be valid in the next iteration; if the current event is very long,
- it may take a couple of read-iterations (and subsequent fixings
- of hdr_offs) for it to become valid again.
- if we had a split header, hdr_offs was already fixed above.
+ Adjust hdr_offs. Note that it may still point beyond the segment
+ read in the next iteration; if the current event is very long,
+ it may take a couple of read-iterations (and subsequent adjustments
+ of hdr_offs) for it to point into the then-current segment.
+ If we have a split header (!carry), hdr_offs will be set at the
+ beginning of the next iteration, overwriting the value we set here:
*/
- if (carry == 0)
- hdr_offs -= length;
+ hdr_offs -= length;
}
/* Write data to the binary log file */
@@ -1982,6 +1982,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
} while ((length=my_b_fill(cache)));
+ DBUG_ASSERT(carry == 0);
+
if (commit_event->write(&log_file))
goto err;
#ifndef DBUG_OFF