summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
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);
}