#At file:///data/src/bzr/mysql-trunk-merge/ based on revid:alexey.kopytov@stripped
3016 Alexey Kopytov 2010-05-11 [merge]
Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Text conflict in sql/log.cc
Text conflict in sql/log.h
Text conflict in sql/sql_class.cc
Text conflict in sql/sql_load.cc
modified:
sql/log.cc
sql/log.h
sql/log_event.h
sql/sql_class.cc
sql/sql_load.cc
sql/table.cc
sql/table.h
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2010-04-27 09:58:21 +0000
+++ b/sql/log.cc 2010-05-11 08:23:57 +0000
@@ -1528,11 +1528,6 @@ binlog_flush_trx_cache(THD *thd, binlog_
cache_mngr->trx_cache.has_incident());
cache_mngr->reset_cache(&cache_mngr->trx_cache);
- /*
- 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 (cache_log->disk_writes != 0)
{
@@ -1592,13 +1587,6 @@ binlog_truncate_trx_cache(THD *thd, binl
else
cache_mngr->trx_cache.restore_prev_position();
- /*
- 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(is_transactional) == NULL);
DBUG_RETURN(error);
}
@@ -1650,11 +1638,6 @@ binlog_flush_stmt_cache(THD *thd, binlog
DBUG_RETURN(error);
cache_mngr->reset_cache(&cache_mngr->stmt_cache);
- /*
- 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 (cache_log->disk_writes != 0)
{
@@ -2662,7 +2645,7 @@ const char *MYSQL_LOG::generate_name(con
MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period)
:bytes_written(0), prepared_xids(0), file_id(1), open_count(1),
- need_start_event(TRUE), m_table_map_version(0),
+ need_start_event(TRUE),
sync_period_ptr(sync_period),
is_relay_log(0), signal_cnt(0),
description_event_for_exec(0), description_event_for_queue(0)
@@ -4447,7 +4430,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);
}
@@ -4589,21 +4571,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.
-
- In an ideal world, we could avoid stepping the table map version,
- since we could then reuse the table map that was written earlier
- in the 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;
}
@@ -4792,9 +4759,6 @@ unlock:
}
}
- if (event_info->flags & LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F)
- ++m_table_map_version;
-
DBUG_RETURN(error);
}
=== modified file 'sql/log.h'
--- a/sql/log.h 2010-04-20 09:10:43 +0000
+++ b/sql/log.h 2010-05-11 08:23:57 +0000
@@ -299,8 +299,6 @@ class MYSQL_BIN_LOG: public TC_LOG, priv
*/
bool no_auto_events;
- ulonglong m_table_map_version;
-
/* pointer to the sync period variable, for binlog this will be
sync_binlog_period, for relay log this will be
sync_relay_log_period
@@ -353,13 +351,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,
bool is_transactional);
=== modified file 'sql/log_event.h'
--- a/sql/log_event.h 2010-04-19 12:09:44 +0000
+++ b/sql/log_event.h 2010-05-11 08:23:57 +0000
@@ -469,10 +469,10 @@ struct sql_ex_info
#define LOG_EVENT_SUPPRESS_USE_F 0x8
/*
- The table map version internal to the log should be increased after
- the event has been written to the binary log.
+ Note: this is a place holder for the flag
+ LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F (0x10), which is not used any
+ more, please do not reused this value for other flags.
*/
-#define LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F 0x10
/**
@def LOG_EVENT_ARTIFICIAL_F
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2010-05-08 22:03:35 +0000
+++ b/sql/sql_class.cc 2010-05-11 08:23:57 +0000
@@ -4468,7 +4468,6 @@ int THD::binlog_flush_pending_rows_event
if (stmt_end)
{
pending->set_flags(Rows_log_event::STMT_END_F);
- pending->flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
binlog_table_maps= 0;
}
@@ -4654,7 +4653,6 @@ int THD::binlog_query(THD::enum_binlog_q
{
Query_log_event qinfo(this, query_arg, query_len, is_trans, direct,
suppress_use, errcode);
- qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
/*
Binlog table maps will be irrelevant after a Query_log_event
(they are just removed on the slave side) so after the query
=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc 2010-05-07 16:17:55 +0000
+++ b/sql/sql_load.cc 2010-05-11 08:23:57 +0000
@@ -563,7 +563,6 @@ int mysql_load(THD *thd,sql_exchange *ex
else
{
Delete_file_log_event d(thd, db, transactional_table);
- d.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
(void) mysql_bin_log.write(&d);
}
}
@@ -744,7 +743,6 @@ static bool write_execute_load_query_log
(duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
(ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
transactional_table, FALSE, FALSE, errcode);
- e.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
return mysql_bin_log.write(&e);
}
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2010-05-08 22:03:35 +0000
+++ b/sql/table.cc 2010-05-11 08:23:57 +0000
@@ -311,13 +311,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
@@ -383,11 +376,6 @@ void init_tmp_table_share(THD *thd, TABL
share->path.length= share->normalized_path.length= strlen(path);
share->frm_version= FRM_VER_TRUE_VARCHAR;
- /*
- 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 2010-05-08 22:03:35 +0000
+++ b/sql/table.h 2010-05-11 08:23:57 +0000
@@ -617,7 +617,6 @@ struct TABLE_SHARE
bool crashed;
bool is_view;
ulong table_map_id; /* for row-based replication */
- ulonglong table_map_version;
/*
Cache for row-based replication table share checks that does not
Attachment: [text/bzr-bundle] bzr/alexey.kopytov@sun.com-20100511082357-p6pzx0gdtaoopa7i.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (Alexey.Kopytov:3016) | Alexey Kopytov | 11 May |