From b35e1f01bbc4341a074d1fde355ffade6a4aab51 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Tue, 24 Feb 2004 17:38:47 +0200 Subject: ha_innodb.cc: Add diagnostic code to analyze an assertion failure in ha_innodb.cc on line 2020 reported by a user (Bug #2903) --- sql/ha_innodb.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'sql/ha_innodb.cc') diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 172f5b969cb..ec384478777 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2016,8 +2016,27 @@ ha_innobase::write_row( DBUG_ENTER("ha_innobase::write_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->transaction.all.innobase_tid); + if (prebuilt->trx != + (trx_t*) current_thd->transaction.all.innobase_tid) { + char err_buf[2000]; + + fprintf(stderr, +"InnoDB: Error: the transaction object for the table handle is at\n" +"InnoDB: %lx, but for the current thread it is at %lx\n", + (ulong)prebuilt->trx, + (ulong)current_thd->transaction.all.innobase_tid); + + ut_sprintf_buf(err_buf, ((byte*)prebuilt) - 100, 200); + fprintf(stderr, +"InnoDB: Dump of 200 bytes around prebuilt: %.1000s\n", err_buf); + + ut_sprintf_buf(err_buf, + ((byte*)(&(current_thd->transaction.all))) - 100, 200); + fprintf(stderr, +"InnoDB: Dump of 200 bytes around transaction.all: %.1000s\n", err_buf); + + ut_a(0); + } statistic_increment(ha_write_count, &LOCK_status); -- cgit v1.2.1 From bce65d4b76a31bcdc2739afbda7ae6290237f7e4 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Mon, 1 Mar 2004 15:15:58 +0100 Subject: Fix for BUG#3015 "(binlog, position) stored by InnoDB for a replication slave can be wrong". This code contains conditional #if to distinguish between versions; it should be merged into 4.1 and 5.0. --- sql/ha_innodb.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sql/ha_innodb.cc') diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index ec384478777..4d1bbacc3ed 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -938,19 +938,17 @@ innobase_commit_low( return; } - /* TODO: Guilhem should check if master_log_name, pending - etc. are right if the master log gets rotated! Possible bug here. - Comment by Heikki March 4, 2003. */ - if (current_thd->slave_thread) { /* Update the replication position info inside InnoDB */ trx->mysql_master_log_file_name = active_mi->rli.master_log_name; - trx->mysql_master_log_pos = ((ib_longlong) - (active_mi->rli.master_log_pos + - active_mi->rli.event_len + - active_mi->rli.pending)); + trx->mysql_master_log_pos = (ib_longlong) +#if MYSQL_VERSION_ID < 40100 + (active_mi->rli.future_master_log_pos); +#else + (active_mi->rli.future_group_master_log_pos); +#endif } trx_commit_for_mysql(trx); -- cgit v1.2.1