MySQL 8.3.0
Source Code Documentation
Gtid_set_or_null Struct Reference

Holds information about a Gtid_set. More...

#include <rpl_gtid.h>

Public Member Functions

Gtid_setget_gtid_set () const
 Return NULL if this is NULL, otherwise return the Gtid_set. More...
 
Gtid_setset_non_null (Tsid_map *sm)
 Do nothing if this object is non-null; set to empty set otherwise. More...
 
void set_null ()
 Set this Gtid_set to NULL. More...
 

Public Attributes

Gtid_setgtid_set
 Pointer to the Gtid_set. More...
 
bool is_non_null
 True if this Gtid_set is NULL. More...
 

Detailed Description

Holds information about a Gtid_set.

Can also be NULL.

This is used as backend storage for @session.gtid_next_list. The idea is that we allow the user to set this to NULL, but we keep the Gtid_set object so that we can re-use the allocated memory and avoid costly allocations later.

This is stored in struct system_variables (defined in sql_class.h), which is cleared using memset(0); hence the negated form of is_non_null.

The convention is: if is_non_null is false, then the value of the session variable is NULL, and the field gtid_set may be NULL or non-NULL. If is_non_null is true, then the value of the session variable is not NULL, and the field gtid_set has to be non-NULL.

This is a POD. It has to be a POD because it is stored in THD::variables.

Member Function Documentation

◆ get_gtid_set()

Gtid_set * Gtid_set_or_null::get_gtid_set ( ) const
inline

Return NULL if this is NULL, otherwise return the Gtid_set.

◆ set_non_null()

Gtid_set * Gtid_set_or_null::set_non_null ( Tsid_map sm)
inline

Do nothing if this object is non-null; set to empty set otherwise.

Returns
NULL if out of memory; Gtid_set otherwise.

◆ set_null()

void Gtid_set_or_null::set_null ( )
inline

Set this Gtid_set to NULL.

Member Data Documentation

◆ gtid_set

Gtid_set* Gtid_set_or_null::gtid_set

Pointer to the Gtid_set.

◆ is_non_null

bool Gtid_set_or_null::is_non_null

True if this Gtid_set is NULL.


The documentation for this struct was generated from the following file: