| 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; |
| 293 | exit2: |
| 294 | error= my_pthread_setspecific_ptr(THR_MALLOC, original_mem_root); |
| 295 | exit1: |
| 296 | error= my_pthread_setspecific_ptr(THR_THD, original_thd); |
| 297 | exit0: |
| 298 | return error; |
| 299 | } |
| 300 | |
| 301 | THD *m_original_thd; |
| 302 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected