#At file:///home/mikael/mysql_clones/LOCK_log/
2848 Mikael Ronstrom 2009-05-08
WL#4832 Patch 1 of 3:Remove table map version fields and associated code
modified:
mysql-test/t/mysql.test
sql/log.cc
sql/log.h
sql/table.cc
sql/table.h
=== modified file 'mysql-test/t/mysql.test'
--- a/mysql-test/t/mysql.test 2009-01-09 17:51:52 +0000
+++ b/mysql-test/t/mysql.test 2009-05-08 16:33:47 +0000
@@ -206,10 +206,10 @@ drop table t17583;
--echo Test connect with dbname + _invalid_ hostname
# Mask the errno of the error message
--replace_regex /\([0-9]*\)/(errno)/
---error 1
+--error 1,1
--exec $MYSQL test -e "\r test invalid_hostname" 2>&1
--replace_regex /\([0-9]*\)/(errno)/
---error 1
+--error 1,1
--exec $MYSQL test -e "connect test invalid_hostname" 2>&1
--echo The commands reported in the bug report
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2009-01-23 12:22:05 +0000
+++ b/sql/log.cc 2009-05-08 16:33:47 +0000
@@ -1400,11 +1400,6 @@ binlog_end_trans(THD *thd, binlog_trx_da
error= mysql_bin_log.write(thd, &trx_data->trans_log, end_ev);
trx_data->reset();
- /*
- We need to step the table map version after writing the
- transaction cache to disk.
- */
- mysql_bin_log.update_table_map_version();
statistic_increment(binlog_cache_use, &LOCK_status);
if (trans_log->disk_writes != 0)
{
@@ -1426,13 +1421,6 @@ binlog_end_trans(THD *thd, binlog_trx_da
trx_data->reset();
else // ...statement
trx_data->truncate(trx_data->before_stmt_pos);
-
- /*
- We need to step the table map version on a rollback to ensure
- that a new table map event is generated instead of the one that
- was written to the thrown-away transaction cache.
- */
- mysql_bin_log.update_table_map_version();
}
DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL);
@@ -2301,8 +2289,7 @@ const char *MYSQL_LOG::generate_name(con
MYSQL_BIN_LOG::MYSQL_BIN_LOG()
:bytes_written(0), prepared_xids(0), file_id(1), open_count(1),
- need_start_event(TRUE), m_table_map_version(0),
- is_relay_log(0),
+ need_start_event(TRUE), is_relay_log(0),
description_event_for_exec(0), description_event_for_queue(0)
{
/*
@@ -3742,7 +3729,6 @@ int THD::binlog_write_table_map(TABLE *t
DBUG_RETURN(error);
binlog_table_maps++;
- table->s->table_map_version= mysql_bin_log.table_map_version();
DBUG_RETURN(0);
}
@@ -3849,24 +3835,6 @@ MYSQL_BIN_LOG::flush_and_set_pending_row
DBUG_RETURN(1);
}
- /*
- We step the table map version if we are writing an event
- representing the end of a statement. We do this regardless of
- wheather we write to the transaction cache or to directly to the
- file.
-
- In an ideal world, we could avoid stepping the table map version
- if we were writing to a transaction cache, since we could then
- reuse the table map that was written earlier in the transaction
- cache. This does not work since STMT_END_F implies closing all
- table mappings on the slave side.
-
- TODO: Find a solution so that table maps does not have to be
- written several times within a transaction.
- */
- if (pending->get_flags(Rows_log_event::STMT_END_F))
- ++m_table_map_version;
-
delete pending;
if (file == &log_file)
@@ -4073,9 +4041,6 @@ err:
}
}
- if (event_info->flags & LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F)
- ++m_table_map_version;
-
pthread_mutex_unlock(&LOCK_log);
DBUG_RETURN(error);
}
=== modified file 'sql/log.h'
--- a/sql/log.h 2009-01-23 12:22:05 +0000
+++ b/sql/log.h 2009-05-08 16:33:47 +0000
@@ -267,8 +267,6 @@ class MYSQL_BIN_LOG: public TC_LOG, priv
*/
bool no_auto_events;
- ulonglong m_table_map_version;
-
int write_to_file(IO_CACHE *cache);
/*
This is used to start writing to a new log file. The difference from
@@ -309,14 +307,6 @@ public:
void unlog(ulong cookie, my_xid xid);
int recover(IO_CACHE *log, Format_description_log_event *fdle);
#if !defined(MYSQL_CLIENT)
- bool is_table_mapped(TABLE *table) const
- {
- return table->s->table_map_version == table_map_version();
- }
-
- ulonglong table_map_version() const { return m_table_map_version; }
- void update_table_map_version() { ++m_table_map_version; }
-
int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event);
int remove_pending_rows_event(THD *thd);
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2009-01-05 16:10:20 +0000
+++ b/sql/table.cc 2009-05-08 16:33:47 +0000
@@ -300,13 +300,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIS
share->version= refresh_version;
/*
- This constant is used to mark that no table map version has been
- assigned. No arithmetic is done on the value: it will be
- overwritten with a value taken from MYSQL_BIN_LOG.
- */
- share->table_map_version= ~(ulonglong)0;
-
- /*
Since alloc_table_share() can be called without any locking (for
example, ha_create_table... functions), we do not assign a table
map id here. Instead we assign a value that is not used
@@ -373,7 +366,6 @@ void init_tmp_table_share(THD *thd, TABL
Temporary tables are not replicated, but we set up these fields
anyway to be able to catch errors.
*/
- share->table_map_version= ~(ulonglong)0;
share->cached_row_logging_check= -1;
/*
=== modified file 'sql/table.h'
--- a/sql/table.h 2009-01-15 18:11:25 +0000
+++ b/sql/table.h 2009-05-08 16:33:47 +0000
@@ -400,7 +400,6 @@ typedef struct st_table_share
bool name_lock, replace_with_name_lock;
bool waiting_on_cond; /* Protection against free */
ulong table_map_id; /* for row-based replication */
- ulonglong table_map_version;
/*
Cache for row-based replication table share checks that does not
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (mikael:2848) WL#4832 | Mikael Ronstrom | 11 May |