On 2015-04-30 09:29, Felipe Gasper wrote:
> Hello,
>
> Hopefully this isn’t too far off-topic for this forum, but I’m
> trying to get access to THD::scramble from a plugin. How readily
> doable is this?
>
> I see a reference to thd_get_current_thd() in
> mysql/thread_pool_priv.h, but it wants a bunch of stuff (e.g.,
> scheduler.h) that doesn’t seem to be part of the installed development
> headers.
>
> Thanks in advance for any consideration!
>
> -Felipe Gasper
> Houston, TX
>
Hello Felipe
Accessing current_thd->scramble would be very fragile.
You would need to build your plugin together with the server (from source)
because object layout in memory may change.
We have getters/setters for misc thd properties, some declared in
thread_pool_priv.h
others declared in service_thd_alloc.h
Alas, there is nothing to access THD::scramble.
Making one would be trivial though.
-- didrik