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

Method attach_to

phx_percona/percona/sql/binlog.cc:265–280  ·  view source on GitHub ↗

Attach the POSIX thread to a session. */

Source from the content-addressed store, hash-verified

263 Attach the POSIX thread to a session.
264 */
265 int attach_to(THD *thd)
266 {
267#ifndef EMBEDDED_LIBRARY
268 if (DBUG_EVALUATE_IF("simulate_session_attach_error", 1, 0)
269 || unlikely(setup_thread_globals(thd)))
270 {
271 /*
272 Indirectly uses pthread_setspecific, which can only return
273 ENOMEM or EINVAL. Since store_globals are using correct keys,
274 the only alternative is out of memory.
275 */
276 return ER_OUTOFMEMORY;
277 }
278#endif /* EMBEDDED_LIBRARY */
279 return 0;
280 }
281
282 int setup_thread_globals(THD *thd) const {
283 int error= 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected