mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in configure.in Text conflict in dbug/dbug.c Text conflict in mysql-test/r/ps.result Text conflict in mysql-test/t/ps.test Text conflict in sql/CMakeLists.txt Text conflict in sql/ha_ndbcluster.cc Text conflict in sql/mysqld.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_table.cc
This commit is contained in:
@ -305,6 +305,37 @@ void **thd_ha_data(const THD *thd, const struct handlerton *hton)
|
||||
return (void **) &thd->ha_data[hton->slot].ha_ptr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Provide a handler data getter to simplify coding
|
||||
*/
|
||||
extern "C"
|
||||
void *thd_get_ha_data(const THD *thd, const struct handlerton *hton)
|
||||
{
|
||||
return *thd_ha_data(thd, hton);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Provide a handler data setter to simplify coding
|
||||
@see thd_set_ha_data() definition in plugin.h
|
||||
*/
|
||||
extern "C"
|
||||
void thd_set_ha_data(THD *thd, const struct handlerton *hton,
|
||||
const void *ha_data)
|
||||
{
|
||||
plugin_ref *lock= &thd->ha_data[hton->slot].lock;
|
||||
if (ha_data && !*lock)
|
||||
*lock= ha_lock_engine(NULL, (handlerton*) hton);
|
||||
else if (!ha_data && *lock)
|
||||
{
|
||||
plugin_unlock(NULL, *lock);
|
||||
*lock= NULL;
|
||||
}
|
||||
*thd_ha_data(thd, hton)= (void*) ha_data;
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
long long thd_test_options(const THD *thd, long long test_options)
|
||||
{
|
||||
|
Reference in New Issue
Block a user