Re: THD::scramble access from a plugin?

Tor Didriksen <[email protected]> Thu, 30 Apr 2015 09:56:57 +0200
Newsgroups gmane.comp.db.mysql.devel
Message-ID <[email protected]>
On 2015-04-30 09:29, Felipe Gasper wrote:
> Hello,
>
>     Hopefully this isn=E2=80=99t too far off-topic for this forum, but =
I=E2=80=99m=20
> trying to get access to THD::scramble from a plugin. How readily=20
> doable is this?
>
>     I see a reference to thd_get_current_thd() in=20
> mysql/thread_pool_priv.h, but it wants a bunch of stuff (e.g.,=20
> scheduler.h) that doesn=E2=80=99t seem to be part of the installed deve=
lopment=20
> 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=20
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


--=20
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals