summaryrefslogtreecommitdiff
path: root/storage/csv
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2006-09-15 10:28:00 -0700
committerunknown <brian@zim.(none)>2006-09-15 10:28:00 -0700
commitd79485a9be6b2f638fd268aae9c4d0b4056a85d5 (patch)
tree23dd89b8830f721d6e87266e1e75109a0c51996d /storage/csv
parente7a27b6a5812c87fc4e3064f3bdc4f92ff67a5e2 (diff)
downloadmariadb-git-d79485a9be6b2f638fd268aae9c4d0b4056a85d5.tar.gz
This changes the order of the universe, black is now the new white.
In practice this means that handlerton is now created by the server and is passed to the engine. Plugin startups can now also control how plugins are inited (and can optionally pass values). Bit more flexibility to those who want to write plugin interfaces to the database. include/mysql/plugin.h: Optional to pass parameter now to init and deinit functions sql/ha_ndbcluster.cc: Cleanup, handlerton is now a pointer. sql/ha_ndbcluster_binlog.cc: Cleanup (handlerton is now a pointer) sql/ha_ndbcluster_binlog.h: Cleanup (handlerton is now a pointer) sql/ha_partition.cc: Cleaned up handlerton change sql/handler.cc: Cheanup of handlerton change sql/item_sum.cc: Cleanedup of handlerton change sql/log.cc: Cleanup of handlerton change sql/mysql_priv.h: Reverted patch for variables (what would have happen previously if a have_ would have been called that was dynamically loaded? boom!) sql/mysqld.cc: Cleanup of handlerton changes and reverted have variable patch sql/partition_info.cc: Cleanup of handlerton (we need to clean this up a bit more). sql/set_var.cc: Cleanup related to handlerton changes sql/sql_cache.cc: Handlerton changes cleanup sql/sql_insert.cc: Handlerton changes cleanup. sql/sql_partition.cc: Handlerton cleanup changes sql/sql_plugin.cc: Handlerton changes. init() can now be controlled by a plugin specific startup. There was also an issue with how we deinited the status variables. It should have been occuring before we shut down the engines. sql/sql_select.cc: Handlerton cleanup changes sql/sql_show.cc: Handlerton cleanup changes sql/sql_table.cc: Handlerton cleanup changes sql/table.cc: Cleanup storage/archive/ha_archive.cc: Cleanup storage/archive/ha_archive.h: Cleanup storage/blackhole/ha_blackhole.cc: Cleanup storage/csv/ha_tina.cc: Cleanup storage/example/ha_example.cc: Cleanup storage/federated/ha_federated.cc: Cleanup storage/heap/ha_heap.cc: Cleanup storage/innobase/handler/ha_innodb.cc: Cleanup storage/myisam/ha_myisam.cc: Cleanup storage/myisammrg/ha_myisammrg.cc: Cleanup
Diffstat (limited to 'storage/csv')
-rw-r--r--storage/csv/ha_tina.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index ce19202d745..012e9b9bd7f 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -75,7 +75,6 @@ pthread_mutex_t tina_mutex;
static HASH tina_open_tables;
static int tina_init= 0;
static handler *tina_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root);
-static int tina_init_func();
off_t Transparent_file::read_next()
{
@@ -124,7 +123,7 @@ char Transparent_file::get_value(off_t offset)
return buff[0];
}
}
-handlerton tina_hton;
+handlerton *tina_hton;
/*****************************************************************************
** TINA tables
@@ -149,25 +148,25 @@ static byte* tina_get_key(TINA_SHARE *share,uint *length,
return (byte*) share->table_name;
}
-static int tina_init_func()
+static int tina_init_func(void *p)
{
if (!tina_init)
{
+ tina_hton= (handlerton *)p;
tina_init++;
VOID(pthread_mutex_init(&tina_mutex,MY_MUTEX_INIT_FAST));
(void) hash_init(&tina_open_tables,system_charset_info,32,0,0,
(hash_get_key) tina_get_key,0,0);
- bzero(&tina_hton, sizeof(handlerton));
- tina_hton.state= SHOW_OPTION_YES;
- tina_hton.db_type= DB_TYPE_CSV_DB;
- tina_hton.create= tina_create_handler;
- tina_hton.panic= tina_end;
- tina_hton.flags= HTON_CAN_RECREATE;
+ tina_hton->state= SHOW_OPTION_YES;
+ tina_hton->db_type= DB_TYPE_CSV_DB;
+ tina_hton->create= tina_create_handler;
+ tina_hton->panic= tina_end;
+ tina_hton->flags= HTON_CAN_RECREATE;
}
return 0;
}
-static int tina_done_func()
+static int tina_done_func(void *p)
{
if (tina_init)
{
@@ -195,7 +194,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
uint length;
if (!tina_init)
- tina_init_func();
+ tina_init_func(NULL);
pthread_mutex_lock(&tina_mutex);
length=(uint) strlen(table_name);
@@ -452,7 +451,7 @@ static int free_share(TINA_SHARE *share)
int tina_end(ha_panic_function type)
{
- return tina_done_func();
+ return tina_done_func(NULL);
}
@@ -501,7 +500,7 @@ static handler *tina_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
ha_tina::ha_tina(TABLE_SHARE *table_arg)
- :handler(&tina_hton, table_arg),
+ :handler(tina_hton, table_arg),
/*
These definitions are found in handler.h
They are not probably completely right.
@@ -1517,7 +1516,7 @@ bool ha_tina::check_if_incompatible_data(HA_CREATE_INFO *info,
}
struct st_mysql_storage_engine csv_storage_engine=
-{ MYSQL_HANDLERTON_INTERFACE_VERSION, &tina_hton };
+{ MYSQL_HANDLERTON_INTERFACE_VERSION, tina_hton };
mysql_declare_plugin(csv)
{