diff options
author | unknown <monty@mysql.com/nosik.monty.fi> | 2007-08-03 01:14:27 +0300 |
---|---|---|
committer | unknown <monty@mysql.com/nosik.monty.fi> | 2007-08-03 01:14:27 +0300 |
commit | 720ea4041e1f650ab83b7ffdad529236bc2f9fae (patch) | |
tree | e484df98228dddbe77df4c8040131f1c053dc6f9 /sql/handler.cc | |
parent | dcf1fd73d9e35767ad19783a35ce92648e933f0a (diff) | |
download | mariadb-git-720ea4041e1f650ab83b7ffdad529236bc2f9fae.tar.gz |
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
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index f06ad282efa..bab384e19fd 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -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; |