Replication API Types and Definitions

All enumerations and preprocessor definitions for the Binglog/Replication API are defined in include/mariadb_rpl.h.

The following API types and definitions are used by the Binlog/Replication API:

Type or Definition
Description

mariadb_rpl_option

Options for configuring a MARIADB_RPL replication handle. Used by mariadb_rpl_optionsv() and mariadb_rpl_get_optionsv()

mariadb_rpl_event

Event type identifiers returned in the event_type field of MARIADB_RPL_EVENT.

mariadb_row_event_type

Row operation type for write, update, and delete row events.

Flags

Bitmask constants for controlling binary log dump behaviour. Passed via the MARIADB_RPL_FLAGS option.

mariadb_rpl_option

mariadb_rpl_option is the enumeration of options accepted by mariadb_rpl_optionsv() and mariadb_rpl_get_optionsv(). Options are used to configure a MARIADB_RPL handle before opening a binary log stream.

enum mariadb_rpl_option {
  MARIADB_RPL_FILENAME,       /* Filename and length */
  MARIADB_RPL_START,          /* Start position */
  MARIADB_RPL_SERVER_ID,      /* Server ID */
  MARIADB_RPL_FLAGS,          /* Protocol flags */
  MARIADB_RPL_GTID_CALLBACK,  /* GTID callback function */
  MARIADB_RPL_GTID_DATA,      /* GTID data */
  MARIADB_RPL_BUFFER
};

Option descriptions

  • MARIADB_RPL_FILENAME → Name of the binary log file to open, and its length in bytes.

  • MARIADB_RPL_START → Binary log position from which to start reading events.

  • MARIADB_RPL_SERVER_ID → The server ID to use when registering this client as a replica.

  • MARIADB_RPL_FLAGS → Bitmask of protocol flags controlling binary log dump behavior. See Flags for valid values.

  • MARIADB_RPL_GTID_CALLBACK → Pointer to a GTID callback function, called when a GTID event is received.

  • MARIADB_RPL_GTID_DATA → User data pointer passed to the GTID callback function.

  • MARIADB_RPL_BUFFER → Pre‑allocated buffer for event data, and its size.

mariadb_rpl_event

mariadb_rpl_event is the enumeration of all binary log event types. The event_type field of MARIADB_RPL_EVENT is set to one of these values to indicate which event structure is active in the event union.

mariadb_row_event_type

mariadb_row_event_type identifies the row operation performed by a WRITE_ROWS_EVENT, UPDATE_ROWS_EVENT, or DELETE_ROWS_EVENT.

Value
Constant
Description

0

WRITE_ROWS

A row was inserted. The row_data field contains the new row image.

1

UPDATE_ROWS

A row was updated.

2

DELETE_ROWS

A row was deleted. The row_data field contains the deleted row image.

Flags

The following flags are passed as a bitmask to the MARIADB_RPL_FLAGS option via mariadb_rpl_optionsv(). Multiple flags can be combined using the bitwise OR operator (|) to control binary log dump behavior.

See Also

Last updated

Was this helpful?