diff options
author | Monty <monty@mariadb.org> | 2019-10-14 18:14:36 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2019-10-20 11:52:29 +0300 |
commit | b62101f84be49013cf07f323c202606847dcc453 (patch) | |
tree | dab5a7aab47b675ad9264b0146edaa89b0a125ab /sql/sql_lex.h | |
parent | e0b6294338fdfc8a4a8b42e6b199c588453be879 (diff) | |
download | mariadb-git-b62101f84be49013cf07f323c202606847dcc453.tar.gz |
Fixes for binary logging --read-only mode
- Any temporary tables created under read-only mode will never be logged
to binary log. Any usage of these tables to update normal tables, even
after read-only has been disabled, will use row base logging (as the
temporary table will not be on the slave).
- Analyze, check and repair table will not be logged in read-only mode.
Other things:
- Removed not used varaibles in
MYSQL_BIN_LOG::flush_and_set_pending_rows_event.
- Set table_share->table_creation_was_logged for all normal tables.
- THD::binlog_query() now returns -1 if statement was not logged., This
is used to update table_share->table_creation_was_logged.
- Don't log admin statements in opt_readonly is set.
- Table's that doesn't have table_creation_was_logged will set binlog format to row
logging.
- Removed not needed/wrong setting of table->s->table_creation_was_logged
in create_table_from_items()
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8b6b2ca9df0..03e73e23d3d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2018,6 +2018,14 @@ public: ((1U << STMT_READS_TEMP_TRANS_TABLE) | (1U << STMT_WRITES_TEMP_TRANS_TABLE))) != 0); } + inline bool stmt_writes_to_non_temp_table() + { + DBUG_ENTER("THD::stmt_writes_to_non_temp_table"); + + DBUG_RETURN((stmt_accessed_table_flag & + ((1U << STMT_WRITES_TRANS_TABLE) | + (1U << STMT_WRITES_NON_TRANS_TABLE)))); + } /** Checks if a temporary non-transactional table is about to be accessed |