Commit 83f47098 authored by vasil's avatar vasil

branches/zip:

Introduce a generic soultion to the common problem that MySQL do not add
functions needed by us in a reasonable time.

Start with a function that retrieves THD::thread_id, this is needed for
the information_schema.innodb_trx.mysql_thread_id column.

Approved by:	Marko
parent bc6db1bc
/******************************************************
This file contains functions that need to be added to
MySQL code but have not been added yet.
Whenever you add a function here submit a MySQL bug
report (feature request) with the implementation. Then
write the bug number in the comment before the
function in this file.
When MySQL commits the function it can be deleted from
here. In a perfect world this file exists but is empty.
(c) 2007 Innobase Oy
Created November 07, 2007 Vasil Dimov
*******************************************************/
#ifndef MYSQL_SERVER
#define MYSQL_SERVER
#endif /* MYSQL_SERVER */
#include <mysql_priv.h>
#include "mysql_addons.h"
/***********************************************************************
Retrieve THD::thread_id
http://bugs.mysql.com/30930 */
extern "C"
unsigned long
ib_thd_get_thread_id(
/*=================*/
/* out: THD::thread_id */
const void* thd) /* in: THD */
{
return((unsigned long) ((THD*) thd)->thread_id);
}
/******************************************************
This file contains functions that need to be added to
MySQL code but have not been added yet.
Whenever you add a function here submit a MySQL bug
report (feature request) with the implementation. Then
write the bug number in the comment before the
function in this file.
When MySQL commits the function it can be deleted from
here. In a perfect world this file exists but is empty.
(c) 2007 Innobase Oy
Created November 07, 2007 Vasil Dimov
*******************************************************/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/***********************************************************************
Retrieve THD::thread_id
http://bugs.mysql.com/30930 */
unsigned long
ib_thd_get_thread_id(
/*=================*/
/* out: THD::thread_id */
const void* thd); /* in: THD */
#ifdef __cplusplus
}
#endif /* __cplusplus */
......@@ -13,6 +13,8 @@ Created July 17, 2007 Vasil Dimov
#include <mysql/plugin.h>
#include "mysql_addons.h"
#include "univ.i"
#include "buf0buf.h"
#include "dict0dict.h"
......@@ -45,11 +47,6 @@ allocated till now, then 39th chunk would have 1677416425 number of rows
and all chunks would have 3354832851 number of rows. */
#define MEM_CHUNKS_IN_TABLE_CACHE 39
/* XXX delete this macro as soon as a real thd_get_thread_id()
function is added to the MySQL code, bug
http://bugs.mysql.com/30930 has been opened for this */
#define thd_get_thread_id(thd) 0
/* The following are some testing auxiliary macros. Do not enable them
in a production environment. */
......@@ -360,7 +357,7 @@ fill_trx_row(
row->trx_wait_started = 0;
}
row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd);
row->trx_mysql_thread_id = ib_thd_get_thread_id(trx->mysql_thd);
return(row);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment