1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Simplify logging code a bit (to make code smaller and faster)

Moved duplicated code to inline function store_timestamp()
Save thd->time_zone_used when logging to table as CSV internally cases it to be changed
Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
Set TABLE->no_replicate on open



client/mysqlbinlog.cc:
  Fixed several memory leaks (most in case of error situations)
mysql-test/r/events_logs_tests.result:
  Made long_query_timeout smaller to ensure next query comes into log
mysql-test/r/variables.result:
  Make it safe to run test with --log
mysql-test/t/events_logs_tests.test:
  Made long_query_timeout smaller to ensure next query comes into log
mysql-test/t/variables.test:
  Make it safe to run test with --log
sql/field.cc:
  Moved duplicated code to inline function store_timestamp()
sql/field.h:
  Moved duplicated code to inline function store_timestamp()
sql/handler.cc:
  Reorder checks in likely order
  Simplify checks if we should do binary logging
  (no_replicate is set once and for all when table is opened)
sql/log.cc:
  Save thd->time_zone_used as CVS internally cases it to be changed
  Use Field_timestamp->store_timestamp instead of automatic timestamps.
  This gives us correct timestamp even if thd->set_time() is not called (in case
  of connect) and we don't have to store thd->query_start_used anymore.
sql/sql_base.cc:
  Removed not needed comment
  Moved LINT_INIT() to after declaration
  Renamed temporary variable to avoid compiler warning
  Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
  Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
sql/table.cc:
  Set TABLE->no_replicate on open
This commit is contained in:
unknown
2007-08-03 01:14:27 +03:00
parent dcf1fd73d9
commit 720ea4041e
11 changed files with 89 additions and 68 deletions

View File

@@ -3462,8 +3462,7 @@ namespace {
if (table->s->cached_row_logging_check == -1)
{
int const check(table->s->tmp_table == NO_TMP_TABLE &&
binlog_filter->db_ok(table->s->db.str) &&
!table->no_replicate);
binlog_filter->db_ok(table->s->db.str));
table->s->cached_row_logging_check= check;
}
@@ -3471,9 +3470,9 @@ namespace {
table->s->cached_row_logging_check == 1);
return (thd->current_stmt_binlog_row_based &&
table->s->cached_row_logging_check &&
(thd->options & OPTION_BIN_LOG) &&
mysql_bin_log.is_open() &&
table->s->cached_row_logging_check);
mysql_bin_log.is_open());
}
}
@@ -3551,7 +3550,7 @@ namespace
const uchar *before_record,
const uchar *after_record)
{
if (table->file->ha_table_flags() & HA_HAS_OWN_BINLOGGING)
if (table->no_replicate)
return 0;
bool error= 0;
THD *const thd= table->in_use;