summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 521884f3f4d..b6950108be4 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1427,10 +1427,15 @@ public:
size_t needed,
bool is_transactional,
RowsEventT* hint);
- Rows_log_event* binlog_get_pending_rows_event() const;
- void binlog_set_pending_rows_event(Rows_log_event* ev);
- int binlog_flush_pending_rows_event(bool stmt_end);
- int binlog_remove_pending_rows_event(bool clear_maps);
+ Rows_log_event* binlog_get_pending_rows_event(bool is_transactional) const;
+ void binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional);
+ inline int binlog_flush_pending_rows_event(bool stmt_end)
+ {
+ return (binlog_flush_pending_rows_event(stmt_end, FALSE) ||
+ binlog_flush_pending_rows_event(stmt_end, TRUE));
+ }
+ int binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional);
+ int binlog_remove_pending_rows_event(bool clear_maps, bool is_transactional);
/**
Determine the binlog format of the current statement.
@@ -1494,6 +1499,9 @@ public:
uint get_binlog_table_maps() const {
return binlog_table_maps;
}
+ void clear_binlog_table_maps() {
+ binlog_table_maps= 0;
+ }
#endif /* MYSQL_CLIENT */
public:
@@ -1959,8 +1967,8 @@ public:
};
int binlog_query(enum_binlog_query_type qtype,
- char const *query, ulong query_len,
- bool is_trans, bool suppress_use,
+ char const *query, ulong query_len, bool is_trans,
+ bool direct, bool suppress_use,
int errcode);
#endif
@@ -2009,6 +2017,21 @@ public:
return 0;
#endif
}
+ /**
+ Returns TRUE if session is in a multi-statement transaction mode.
+
+ OPTION_NOT_AUTOCOMMIT: When autocommit is off, a multi-statement
+ transaction is implicitly started on the first statement after a
+ previous transaction has been ended.
+
+ OPTION_BEGIN: Regardless of the autocommit status, a multi-statement
+ transaction can be explicitly started with the statements "START
+ TRANSACTION", "BEGIN [WORK]", "[COMMIT | ROLLBACK] AND CHAIN", etc.
+ */
+ inline bool in_multi_stmt_transaction()
+ {
+ return options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
+ }
inline bool fill_derived_tables()
{
return !stmt_arena->is_stmt_prepare() && !lex->only_view_structure();