Skip to content

rpl_data_structures

Georg Richter edited this page Oct 22, 2018 · 8 revisions

Binlog/Replication API data structures

Structures and type definitions for Binglog/Replication API are defined in source file include/mariadb_rpl.h.

MARIADB_STRING

MARIADB_STRING is a simple structure (same as MYSQL_STRING and MYSQL_LEX_STRING) which stores a string together with its length.

typedef struct {
  char *str;
  size_t length;
} MARIADB_STRING;

MARIADB_GTID

MARIADB_GTID is used to store the global transaction id. The global transaction id is defined by three numbers: The domain id, the server id and the sequence number.

typedef struct st_mariadb_gtid {
  unsigned int domain_id;
  unsigned int server_id;
  unsigned long long sequence_nr;
} MARIADB_GTID;

MARIADB_RPL

MARIADB_RPL is the generic replication handle, which represents a replication connection and is used by all binlg/replication API calls. The MARIADB_RPL structure is considered to be opaque, instead of accessing its internal members you should use the api functions mariadb_rpl_optionsv and mariadb_rpl_get_optionsv.

typedef struct st_mariadb_rpl {
  unsigned int version;
  MYSQL *mysql;
  char *filename;
  uint32_t filename_length;
  unsigned char *buffer;
  unsigned long buffer_size;
  uint32_t server_id;
  unsigned long start_position;
  uint32_t flags;
  uint8_t fd_header_len; /* header len from last format description event */
} MARIADB_RPL;
Clone this wiki locally