summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorbrian@zim.(none) <>2005-10-02 19:44:28 -0700
committerbrian@zim.(none) <>2005-10-02 19:44:28 -0700
commit54a958993ced2a53b85448e1840cf45f4bd56d95 (patch)
tree72eb47c02b43069ea929c5d757efd985ed319a7b /sql/ha_ndbcluster.cc
parentacdc193a45a7f2952867a3d3f2373dd42e887ef2 (diff)
downloadmariadb-git-54a958993ced2a53b85448e1840cf45f4bd56d95.tar.gz
Next big patch for loadable storage engines!
Handlerton array is now created instead of using sys_table_types_st. All storage engines can now have inits and giant ifdef's are now gone for startup. No compeltely clean yet, handlertons will next be merged with sys_table_types. Federated and archive now have real cleanup if their inits fail.
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 709a7ed14e0..2b028902ecb 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -51,6 +51,10 @@ static int ndbcluster_rollback(THD *thd, bool all);
handlerton ndbcluster_hton = {
"ndbcluster",
+ SHOW_OPTION_YES,
+ "Clustered, fault-tolerant, memory-based tables",
+ DB_TYPE_NDBCLUSTER,
+ ndbcluster_init,
0, /* slot */
0, /* savepoint size */
ndbcluster_close_connection,
@@ -4734,11 +4738,14 @@ static int connect_callback()
return 0;
}
-handlerton *
-ndbcluster_init()
+bool ndbcluster_init()
{
int res;
DBUG_ENTER("ndbcluster_init");
+
+ if (have_ndbcluster != SHOW_OPTION_YES)
+ goto ndbcluster_init_error;
+
// Set connectstring if specified
if (opt_ndbcluster_connectstring != 0)
DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring));
@@ -4819,16 +4826,18 @@ ndbcluster_init()
}
ndbcluster_inited= 1;
- DBUG_RETURN(&ndbcluster_hton);
+ DBUG_RETURN(FALSE);
- ndbcluster_init_error:
+ndbcluster_init_error:
if (g_ndb)
delete g_ndb;
g_ndb= NULL;
if (g_ndb_cluster_connection)
delete g_ndb_cluster_connection;
g_ndb_cluster_connection= NULL;
- DBUG_RETURN(NULL);
+ have_ndbcluster= SHOW_OPTION_DISABLED; // If we couldn't use handler
+ ndbcluster_hton.state= SHOW_OPTION_DISABLED;
+ DBUG_RETURN(TRUE);
}