Attach the POSIX thread to a session. */
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected