1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-25 18:38:00 +03:00

This patch adds handlerton passing to functions. NDB and Innodb still require a global hanlderton in the main code due to the nature of the sql_cache call back function (should be solveable... another patch).

Partitioning now has a flag to allow disabling of engines from being compatible with partitioning. Cleaned up heap naming convention on panic call.
This commit is contained in:
brian@zim.(none)
2006-09-30 12:49:46 -07:00
parent a756fd36ef
commit 46ae2113ba
27 changed files with 350 additions and 248 deletions

View File

@@ -75,10 +75,17 @@ static const int max_transactions= 3; // should really be 2 but there is a trans
static uint ndbcluster_partition_flags();
static uint ndbcluster_alter_table_flags(uint flags);
static int ndbcluster_init(void *);
static int ndbcluster_end(ha_panic_function flag);
static bool ndbcluster_show_status(THD*,stat_print_fn *,enum ha_stat_type);
static int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info);
static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond);
static int ndbcluster_end(handlerton *hton, ha_panic_function flag);
static bool ndbcluster_show_status(handlerton *hton, THD*,
stat_print_fn *,
enum ha_stat_type);
static int ndbcluster_alter_tablespace(handlerton *hton,
THD* thd,
st_alter_tablespace *info);
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
COND *cond);
handlerton *ndbcluster_hton;
@@ -4202,7 +4209,7 @@ int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
Commit a transaction started in NDB
*/
static int ndbcluster_commit(THD *thd, bool all)
static int ndbcluster_commit(handlerton *hton, THD *thd, bool all)
{
int res= 0;
Thd_ndb *thd_ndb= get_thd_ndb(thd);
@@ -4253,7 +4260,7 @@ static int ndbcluster_commit(THD *thd, bool all)
Rollback a transaction started in NDB
*/
static int ndbcluster_rollback(THD *thd, bool all)
static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all)
{
int res= 0;
Thd_ndb *thd_ndb= get_thd_ndb(thd);
@@ -5817,7 +5824,7 @@ int ha_ndbcluster::check_ndb_connection(THD* thd)
}
static int ndbcluster_close_connection(THD *thd)
static int ndbcluster_close_connection(handlerton *hton, THD *thd)
{
Thd_ndb *thd_ndb= get_thd_ndb(thd);
DBUG_ENTER("ndbcluster_close_connection");
@@ -5834,8 +5841,10 @@ static int ndbcluster_close_connection(THD *thd)
Try to discover one table from NDB
*/
int ndbcluster_discover(THD* thd, const char *db, const char *name,
const void** frmblob, uint* frmlen)
int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
const char *name,
const void** frmblob,
uint* frmlen)
{
int error= 0;
NdbError ndb_error;
@@ -5915,7 +5924,8 @@ err:
*/
int ndbcluster_table_exists_in_engine(THD* thd, const char *db,
int ndbcluster_table_exists_in_engine(handlerton *hton, THD* thd,
const char *db,
const char *name)
{
Ndb* ndb;
@@ -6015,7 +6025,7 @@ int ndbcluster_drop_database_impl(const char *path)
DBUG_RETURN(ret);
}
static void ndbcluster_drop_database(char *path)
static void ndbcluster_drop_database(handlerton *hton, char *path)
{
THD *thd= current_thd;
DBUG_ENTER("ndbcluster_drop_database");
@@ -6176,7 +6186,9 @@ int ndbcluster_find_all_files(THD *thd)
DBUG_RETURN(-(skipped + unhandled));
}
int ndbcluster_find_files(THD *thd,const char *db,const char *path,
int ndbcluster_find_files(handlerton *hton, THD *thd,
const char *db,
const char *path,
const char *wild, bool dir, List<char> *files)
{
DBUG_ENTER("ndbcluster_find_files");
@@ -6286,7 +6298,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
DBUG_PRINT("info", ("%s existed on disk", name));
// The .ndb file exists on disk, but it's not in list of tables in ndb
// Verify that handler agrees table is gone.
if (ndbcluster_table_exists_in_engine(thd, db, file_name) == 0)
if (ndbcluster_table_exists_in_engine(hton, thd, db, file_name) == 0)
{
DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
it.remove();
@@ -6540,7 +6552,7 @@ ndbcluster_init_error:
DBUG_RETURN(TRUE);
}
static int ndbcluster_end(ha_panic_function type)
static int ndbcluster_end(handlerton *hton, ha_panic_function type)
{
DBUG_ENTER("ndbcluster_end");
@@ -9704,7 +9716,7 @@ err:
Implements the SHOW NDB STATUS command.
*/
bool
ndbcluster_show_status(THD* thd, stat_print_fn *stat_print,
ndbcluster_show_status(handlerton *hton, THD* thd, stat_print_fn *stat_print,
enum ha_stat_type stat_type)
{
char buf[IO_SIZE];
@@ -10168,7 +10180,7 @@ bool set_up_undofile(st_alter_tablespace *info,
return false;
}
int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
int ndbcluster_alter_tablespace(handlerton *hton, THD* thd, st_alter_tablespace *info)
{
DBUG_ENTER("ha_ndbcluster::alter_tablespace");
@@ -10429,7 +10441,9 @@ bool ha_ndbcluster::get_no_parts(const char *name, uint *no_parts)
DBUG_RETURN(TRUE);
}
static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
COND *cond)
{
TABLE* table= tables->table;