MySQL 8.4.3
Source Code Documentation
|
This is the base class for verifying transaction boundaries. More...
#include <trx_boundary_parser.h>
Public Types | |
enum | enum_trx_boundary_parser_context { TRX_BOUNDARY_PARSER_RECEIVER , TRX_BOUNDARY_PARSER_APPLIER } |
The context where the parser is used. More... | |
enum | enum_event_parser_error { ER_TRX_BOUND_UNSUPPORTED_UNIGNORABLE_EVENT_IN_STREAM , ER_TRX_BOUND_GTID_LOG_EVENT_IN_STREAM , ER_TRX_BOUND_UNEXPECTED_BEGIN_IN_STREAM , ER_TRX_BOUND_UNEXPECTED_COMMIT_ROLLBACK_OR_XID_LOG_EVENT_IN_STREAM , ER_TRX_BOUND_UNEXPECTED_XA_ROLLBACK_IN_STREAM } |
Internal error indentifiers for parser issues. More... | |
Public Member Functions | |
Transaction_boundary_parser (enum_trx_boundary_parser_context context) | |
Constructor. More... | |
virtual | ~Transaction_boundary_parser () |
Destructor. More... | |
void | reset () |
Reset the transaction boundary parser state. More... | |
bool | is_inside_transaction () |
State if the transaction boundary parser is inside a transaction. More... | |
bool | is_not_inside_transaction () |
State if the transaction boundary parser is not inside a transaction. More... | |
bool | is_error () |
State if the transaction boundary parser was fed with a sequence of events that the parser wasn't able to parse correctly. More... | |
bool | feed_event (mysql::binlog::event::Log_event_basic_info log_event_info, bool throw_warnings) |
Feed the transaction boundary parser with a Log_event of any type in object type. More... | |
bool | check_row_logging_constraints (mysql::binlog::event::Log_event_basic_info event_info) |
Evaluate given the current info about boundary type, event type and parser state if the given event violates any restriction associated to row based only modes. More... | |
void | rollback () |
Rolls back to the last parser state. More... | |
Private Types | |
enum | enum_event_boundary_type { EVENT_BOUNDARY_TYPE_ERROR = -1 , EVENT_BOUNDARY_TYPE_GTID = 0 , EVENT_BOUNDARY_TYPE_BEGIN_TRX = 1 , EVENT_BOUNDARY_TYPE_END_TRX = 2 , EVENT_BOUNDARY_TYPE_END_XA_TRX = 3 , EVENT_BOUNDARY_TYPE_PRE_STATEMENT = 4 , EVENT_BOUNDARY_TYPE_STATEMENT = 5 , EVENT_BOUNDARY_TYPE_INCIDENT = 6 , EVENT_BOUNDARY_TYPE_IGNORE = 7 , EVENT_BOUNDARY_TYPE_TRANSACTION_PAYLOAD = 8 } |
enum | enum_event_parser_state { EVENT_PARSER_NONE , EVENT_PARSER_GTID , EVENT_PARSER_DDL , EVENT_PARSER_DML , EVENT_PARSER_ERROR } |
Private Member Functions | |
enum_event_boundary_type | get_event_boundary_type (mysql::binlog::event::Log_event_basic_info event_info, bool throw_warnings) |
Parses an raw event based on the event parser logic. More... | |
bool | update_state (enum_event_boundary_type event_boundary_type, bool throw_warnings) |
Set the boundary parser state based on the event parser logic. More... | |
virtual void | log_server_warning (int error, const char *message) |
Log warnings using some defined logging interface. More... | |
Private Attributes | |
enum_event_parser_state | current_parser_state |
Current internal state of the event parser. More... | |
enum_event_parser_state | last_parser_state |
Last internal state of the event parser. More... | |
enum_event_boundary_type | m_current_boundary_state |
The last processed boundary event type. More... | |
enum_trx_boundary_parser_context | m_trx_boundary_parser_context |
In which context of the boundary parser is used. More... | |
This is the base class for verifying transaction boundaries.
Internal error indentifiers for parser issues.
|
inline |
Constructor.
context | If this parser is used on a receiver or applier context |
|
virtualdefault |
Destructor.
bool mysql::binlog::event::Transaction_boundary_parser::check_row_logging_constraints | ( | mysql::binlog::event::Log_event_basic_info | event_info | ) |
Evaluate given the current info about boundary type, event type and parser state if the given event violates any restriction associated to row based only modes.
event_info | the event information: type, query, is it ignorable |
bool mysql::binlog::event::Transaction_boundary_parser::feed_event | ( | mysql::binlog::event::Log_event_basic_info | log_event_info, |
bool | throw_warnings | ||
) |
Feed the transaction boundary parser with a Log_event of any type in object type.
log_event_info | the event object |
throw_warnings | If the function should throw warning messages while updating the boundary parser state. While initializing the Relay_log_info the relay log is scanned backwards and this could generate false errors. So, in this case, we don't want to throw warnings. |
|
private |
Parses an raw event based on the event parser logic.
event_info | Info about an event: type, query, is it ignorable |
throw_warnings | If the function should throw warning messages while updating the boundary parser state. |
|
inline |
State if the transaction boundary parser was fed with a sequence of events that the parser wasn't able to parse correctly.
|
inline |
State if the transaction boundary parser is inside a transaction.
This "inside a transaction" means that the parser was fed with at least one event of a transaction, but the transaction wasn't completely fed yet. This also means that the last event fed depends on following event(s) to be correctly applied.
|
inline |
State if the transaction boundary parser is not inside a transaction.
This "not inside a transaction" means that the parser was fed with an event that doesn't depend on following events.
|
privatevirtual |
Log warnings using some defined logging interface.
error | the error number |
message | the error message |
Reimplemented in Replication_transaction_boundary_parser.
void mysql::binlog::event::Transaction_boundary_parser::reset | ( | ) |
Reset the transaction boundary parser state.
Reset the transaction boundary parser.
This method initialize the boundary parser state.
|
inline |
Rolls back to the last parser state.
This should be called in the case of a failed queued event.
|
private |
Set the boundary parser state based on the event parser logic.
Update the boundary parser state based on a given boundary type.
event_boundary_type | the current event boundary type |
throw_warnings | If the function should throw warning messages while updating the boundary parser state. |
event_boundary_type | The event boundary type of the event used to fed the boundary parser. |
throw_warnings | If the function should throw warnings while updating the boundary parser state. Please see comments on this at feed_event(). |
|
private |
Current internal state of the event parser.
|
private |
Last internal state of the event parser.
This should be used if we had to roll back the last parsed event.
|
private |
The last processed boundary event type.
|
private |
In which context of the boundary parser is used.