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

Method setup_thread_globals

phx_percona/percona/sql/binlog.cc:282–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 }
281
282 int setup_thread_globals(THD *thd) const {
283 int error= 0;
284 THD *original_thd= my_pthread_getspecific(THD*, THR_THD);
285 MEM_ROOT* original_mem_root= my_pthread_getspecific(MEM_ROOT*, THR_MALLOC);
286 if ((error= my_pthread_setspecific_ptr(THR_THD, thd)))
287 goto exit0;
288 if ((error= my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root)))
289 goto exit1;
290 if ((error= set_mysys_var(thd->mysys_var)))
291 goto exit2;
292 goto exit0;
293exit2:
294 error= my_pthread_setspecific_ptr(THR_MALLOC, original_mem_root);
295exit1:
296 error= my_pthread_setspecific_ptr(THR_THD, original_thd);
297exit0:
298 return error;
299 }
300
301 THD *m_original_thd;
302};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected