MCPcopy Create free account
hub / github.com/Tencent/phxsql / write_empty_groups_to_cache

Function write_empty_groups_to_cache

phx_percona/percona/sql/binlog.cc:1070–1093  ·  view source on GitHub ↗

Writes all GTIDs that the thread owns to the stmt/trx cache, if the GTID is not already in the cache. @todo Move this function into the cache class? @param thd THD object for the thread that owns the cache. @param cache_data The cache. */

Source from the content-addressed store, hash-verified

1068 @param cache_data The cache.
1069*/
1070static int write_empty_groups_to_cache(THD *thd, binlog_cache_data *cache_data)
1071{
1072 DBUG_ENTER("write_empty_groups_to_cache");
1073 if (thd->owned_gtid.sidno == -1)
1074 {
1075#ifdef HAVE_GTID_NEXT_LIST
1076 Gtid_set::Gtid_iterator git(&thd->owned_gtid_set);
1077 Gtid gtid= git.get();
1078 while (gtid.sidno != 0)
1079 {
1080 if (write_one_empty_group_to_cache(thd, cache_data, gtid) != 0)
1081 DBUG_RETURN(1);
1082 git.next();
1083 gtid= git.get();
1084 }
1085#else
1086 DBUG_ASSERT(0);
1087#endif
1088 }
1089 else if (thd->owned_gtid.sidno > 0)
1090 if (write_one_empty_group_to_cache(thd, cache_data, thd->owned_gtid) != 0)
1091 DBUG_RETURN(1);
1092 DBUG_RETURN(0);
1093}
1094
1095
1096/**

Callers 2

gtid_before_write_cacheFunction · 0.85
commitMethod · 0.85

Calls 1

Tested by

no test coverage detected