Bug #22775 | Additional thread accessors like thd_in_lock_tables() required by engine plugins | ||
---|---|---|---|
Submitted: | 28 Sep 2006 10:37 | Modified: | 1 Aug 2007 9:39 |
Reporter: | Paul McCullagh (Basic Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S4 (Feature request) |
Version: | 5.1 | OS: | Any |
Assigned to: | Timothy Smith | CPU Architecture: | Any |
Tags: | accessors, engine, plugin, thd, thd class, thd_in_lock_tables, thread |
[28 Sep 2006 10:37]
Paul McCullagh
[5 Oct 2006 9:55]
Sergei Golubchik
Paul, I'd rather keep THD as an "internal" structure, not exposed to plugins, making only specific fields public via accessor functions. And add these accessr functions on a case by case basis. There is thd_proc_info() function already. thd->variables.tx_isolation - ok thd->killed - ok. Why do you need the other three ?
[5 Oct 2006 13:08]
Paul McCullagh
Hi Sergei, Access to "&thd->main_security_ctx" is not essential. I use it to access 'sctx->user' and 'sctx->host' to create a name for a thread which is used when logging errors (so the administrator has an idea what client cause the error). 'thd->options' is more critical. I use it in a test like this: "thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)", for example in ha_pbxt::external_lock(). Basically I need to determine whether the auto-commit switch is on or off. I use 'thd->lex->sql_command' in ha_pbxt::store_lock() in the same way as InnoDB does: to test whether I can set lock_type = TL_WRITE_ALLOW_WRITE. One other thing: currently thd_proc_info() can only be used to get and set 'proc_info'. It needs to be changed so that just a get is possible, for example: const char *thd_proc_info(THD *thd, const char *info) { const char *old_info= thd->proc_info; if (info) thd->proc_info= info; return old_info; } Or just add a thd_get_proc_info().
[20 Jan 2007 14:13]
Sergei Golubchik
Antony had this in one of his patches for WL#2936
[14 May 2007 17:26]
Antony Curtis
Now that WL#2936 is pushed, I will now examine what the current state of play is.
[14 Jun 2007 6:11]
Antony Curtis
Will complete as part of WL#3653 (currently pending arch review)
[19 Jun 2007 17:56]
Timothy Smith
There is now a dedicated Worklog task for this, WL#3914. This bug will be closed when that Worklog is completed.
[1 Aug 2007 9:39]
Timothy Smith
WL#3914 is now merged into MySQL 5.1 code.