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

Function delegates_init

phx_percona/percona/sql/rpl_handler.cc:87–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int delegates_init()
88{
89 static my_aligned_storage<sizeof(Trans_delegate), MY_ALIGNOF(long)> trans_mem;
90 static my_aligned_storage<sizeof(Binlog_storage_delegate),
91 MY_ALIGNOF(long)> storage_mem;
92#ifdef HAVE_REPLICATION
93 static my_aligned_storage<sizeof(Binlog_transmit_delegate),
94 MY_ALIGNOF(long)> transmit_mem;
95 static my_aligned_storage<sizeof(Binlog_relay_IO_delegate),
96 MY_ALIGNOF(long)> relay_io_mem;
97#endif
98
99 void *place_trans_mem= trans_mem.data;
100 void *place_storage_mem= storage_mem.data;
101
102 transaction_delegate= new (place_trans_mem) Trans_delegate;
103
104 if (!transaction_delegate->is_inited())
105 {
106 sql_print_error("Initialization of transaction delegates failed. "
107 "Please report a bug.");
108 return 1;
109 }
110
111 binlog_storage_delegate= new (place_storage_mem) Binlog_storage_delegate;
112
113 if (!binlog_storage_delegate->is_inited())
114 {
115 sql_print_error("Initialization binlog storage delegates failed. "
116 "Please report a bug.");
117 return 1;
118 }
119
120#ifdef HAVE_REPLICATION
121 void *place_transmit_mem= transmit_mem.data;
122 void *place_relay_io_mem= relay_io_mem.data;
123
124 binlog_transmit_delegate= new (place_transmit_mem) Binlog_transmit_delegate;
125
126 if (!binlog_transmit_delegate->is_inited())
127 {
128 sql_print_error("Initialization of binlog transmit delegates failed. "
129 "Please report a bug.");
130 return 1;
131 }
132
133 binlog_relay_io_delegate= new (place_relay_io_mem) Binlog_relay_IO_delegate;
134
135 if (!binlog_relay_io_delegate->is_inited())
136 {
137 sql_print_error("Initialization binlog relay IO delegates failed. "
138 "Please report a bug.");
139 return 1;
140 }
141#endif
142
143 return 0;
144}

Callers 1

init_server_componentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected