19 #include "sql_class.h"
25 DBUG_ENTER(
"Group_cache::Group_cache");
26 my_init_dynamic_array(&groups,
sizeof(
Cached_group), 8, 8);
33 DBUG_ENTER(
"Group_cache::~Group_cache");
34 delete_dynamic(&groups);
41 DBUG_ENTER(
"Group_cache::clear");
48 Group_cache::add_logged_group(
const THD *thd, my_off_t binlog_offset)
50 DBUG_ENTER(
"Group_cache::add_logged_group(THD *, my_off_t)");
52 DBUG_ASSERT(spec.
type != UNDEFINED_GROUP);
56 DBUG_RETURN(EXTEND_EXISTING_GROUP);
74 DBUG_RETURN(APPEND_NEW_GROUP);
81 for (
int i= 0;
i < n_groups;
i++)
98 Group_cache::add_empty_group(
const Gtid >id)
100 DBUG_ENTER(
"Group_cache::add_empty_group");
104 DBUG_RETURN(EXTEND_EXISTING_GROUP);
123 DBUG_RETURN(APPEND_NEW_GROUP);
130 DBUG_ENTER(
"Group_cache::generate_automatic_gno");
131 DBUG_ASSERT(thd->variables.gtid_next.type == AUTOMATIC_GROUP);
132 DBUG_ASSERT(thd->variables.gtid_next_list.get_gtid_set() == NULL);
134 enum_group_type automatic_type= INVALID_GROUP;
135 Gtid automatic_gtid= { 0, 0 };
136 for (
int i= 0;
i < n_groups;
i++)
139 if (group->
spec.
type == AUTOMATIC_GROUP)
141 if (automatic_type == INVALID_GROUP)
145 automatic_type= ANONYMOUS_GROUP;
149 automatic_type= GTID_GROUP;
154 if (automatic_gtid.
gno == -1)
157 RETURN_REPORTED_ERROR;
173 DBUG_ENTER(
"Group_cache::get_groups");
176 for (
int i= 0;
i < n_groups;
i++)