Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-07-09 08:11:38+02:00, tnurnberg@stripped +3 -0
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@stripped, 2007-07-09 08:11:36+02:00, tnurnberg@stripped +0 -97
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
streamlined test
mysql-test/t/binlog.test@stripped, 2007-07-09 08:11:36+02:00, tnurnberg@stripped +0 -61
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
streamlined test
sql/log.cc@stripped, 2007-07-09 08:11:36+02:00, tnurnberg@stripped +9 -7
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
comment clarified
diff -Nrup a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result
--- a/mysql-test/r/binlog.result 2007-07-02 07:13:32 +02:00
+++ b/mysql-test/r/binlog.result 2007-07-09 08:11:36 +02:00
@@ -153,105 +153,8 @@ master-bin.000001 353 Query 1 441 use `t
master-bin.000001 441 Query 1 529 use `test`; insert into t1 values (3)
master-bin.000001 529 Xid 1 556 COMMIT /* XID */
master-bin.000001 556 Query 1 632 use `test`; drop table t1
-set autocommit= 1;
-reset master;
-create table t1(n int) engine=innodb;
-insert into t1 values (1);
-insert into t1 values (2);
-insert into t1 values (3);
-commit;
-drop table t1;
-show binlog events from 0;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4
-master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb
-master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1)
-master-bin.000001 285 Xid 1 312 COMMIT /* XID */
-master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2)
-master-bin.000001 400 Xid 1 427 COMMIT /* XID */
-master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3)
-master-bin.000001 515 Xid 1 542 COMMIT /* XID */
-master-bin.000001 542 Query 1 618 use `test`; drop table t1
-reset master;
-create table t1(n int) engine=myisam;
-begin;
-insert into t1 values (4);
-insert into t1 values (5);
-insert into t1 values (6);
-commit;
-drop table t1;
-show binlog events from 0;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4
-master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam
-master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4)
-master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5)
-master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6)
-master-bin.000001 461 Query 1 537 use `test`; drop table t1
-set autocommit= 1;
-reset master;
-create table t1(n int) engine=innodb;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 197
-insert into t1 values (1);
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 312
-insert into t1 values (2);
-insert into t1 values (3);
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 542
-commit;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 542
-drop table t1;
-show binlog events from 0;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4
-master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb
-master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1)
-master-bin.000001 285 Xid 1 312 COMMIT /* XID */
-master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2)
-master-bin.000001 400 Xid 1 427 COMMIT /* XID */
-master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3)
-master-bin.000001 515 Xid 1 542 COMMIT /* XID */
-master-bin.000001 542 Query 1 618 use `test`; drop table t1
-set autocommit= 0;
-reset master;
-create table t1(n int) engine=myisam;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 197
-insert into t1 values (4);
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 285
-insert into t1 values (5);
-insert into t1 values (6);
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 461
-commit;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 461
-drop table t1;
-show binlog events from 0;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4
-master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam
-master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4)
-master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5)
-master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6)
-master-bin.000001 461 Query 1 537 use `test`; drop table t1
-set session autocommit = @ac;
set @bcs = @@binlog_cache_size;
-set @ac = @@autocommit;
set global binlog_cache_size=4096;
-set autocommit= 0;
reset master;
create table t1 (a int) engine=innodb;
show binlog events from 0;
diff -Nrup a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test
--- a/mysql-test/t/binlog.test 2007-07-02 07:13:32 +02:00
+++ b/mysql-test/t/binlog.test 2007-07-09 08:11:36 +02:00
@@ -78,72 +78,11 @@ drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
-set autocommit= 1;
-reset master;
-create table t1(n int) engine=innodb;
-insert into t1 values (1);
-insert into t1 values (2);
-insert into t1 values (3);
-commit;
-drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
-
-reset master;
-create table t1(n int) engine=myisam;
-begin;
-insert into t1 values (4);
-insert into t1 values (5);
-insert into t1 values (6);
-commit;
-drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
-
-# now show this also works for SHOW MASTER STATUS
-# as this is what "mysqldump --master-data=1" uses.
-
-set autocommit= 1;
-reset master;
-create table t1(n int) engine=innodb;
-show master status;
-insert into t1 values (1);
-show master status;
-insert into t1 values (2);
-insert into t1 values (3);
-show master status;
-commit;
-show master status;
-drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
-
-set autocommit= 0;
-reset master;
-create table t1(n int) engine=myisam;
-show master status;
-insert into t1 values (4);
-show master status;
-insert into t1 values (5);
-insert into t1 values (6);
-
-show master status;
-commit;
-show master status;
-drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
-
-set session autocommit = @ac;
-
# now show that nothing breaks if we need to read from the cache more
# than once, resulting in split event-headers
set @bcs = @@binlog_cache_size;
-set @ac = @@autocommit;
-
set global binlog_cache_size=4096;
-set autocommit= 0;
reset master;
create table t1 (a int) engine=innodb;
diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc 2007-07-02 07:13:32 +02:00
+++ b/sql/log.cc 2007-07-09 08:11:36 +02:00
@@ -1965,14 +1965,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE
}
/*
- 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 */
@@ -1981,6 +1981,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE
cache->read_pos=cache->read_end; // Mark buffer used up
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;
| Thread |
|---|
| • bk commit into 5.0 tree (tnurnberg:1.2510) BUG#22540 | Tatjana A Nuernberg | 9 Jul |