summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_ndbcluster.h')
-rw-r--r--sql/ha_ndbcluster.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index a17323d3fd6..7a0e9e57536 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -1,4 +1,7 @@
-/* Copyright (C) 2000-2003 MySQL AB
+#ifndef HA_NDBCLUSTER_INCLUDED
+#define HA_NDBCLUSTER_INCLUDED
+
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This file defines the NDB Cluster handler: the interface between MySQL and
@@ -31,7 +34,10 @@
#include <ndbapi_limits.h>
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
-#define NDB_DEFAULT_AUTO_PREFETCH 32
+
+#ifdef HAVE_PSI_INTERFACE
+extern PSI_file_key key_file_ndb;
+#endif /* HAVE_PSI_INTERFACE */
class Ndb; // Forward declaration
@@ -45,13 +51,10 @@ class NdbIndexStat;
class NdbEventOperation;
class ha_ndbcluster_cond;
+#include "sql_partition.h" /* part_id_range */
+
// connectstring to cluster if given by mysqld
extern const char *ndbcluster_connectstring;
-extern ulong ndb_cache_check_time;
-#ifdef HAVE_NDB_BINLOG
-extern ulong ndb_report_thresh_binlog_epoch_slip;
-extern ulong ndb_report_thresh_binlog_mem_usage;
-#endif
typedef enum ndb_index_type {
UNDEFINED_INDEX = 0,
@@ -105,7 +108,7 @@ typedef struct st_ndbcluster_share {
NDB_SHARE_STATE state;
MEM_ROOT mem_root;
THR_LOCK lock;
- pthread_mutex_t mutex;
+ mysql_mutex_t mutex;
char *key;
uint key_length;
THD *util_lock;
@@ -134,9 +137,9 @@ NDB_SHARE_STATE
get_ndb_share_state(NDB_SHARE *share)
{
NDB_SHARE_STATE state;
- pthread_mutex_lock(&share->mutex);
+ mysql_mutex_lock(&share->mutex);
state= share->state;
- pthread_mutex_unlock(&share->mutex);
+ mysql_mutex_unlock(&share->mutex);
return state;
}
@@ -144,19 +147,19 @@ inline
void
set_ndb_share_state(NDB_SHARE *share, NDB_SHARE_STATE state)
{
- pthread_mutex_lock(&share->mutex);
+ mysql_mutex_lock(&share->mutex);
share->state= state;
- pthread_mutex_unlock(&share->mutex);
+ mysql_mutex_unlock(&share->mutex);
}
struct Ndb_tuple_id_range_guard {
Ndb_tuple_id_range_guard(NDB_SHARE* _share) :
share(_share),
range(share->tuple_id_range) {
- pthread_mutex_lock(&share->mutex);
+ mysql_mutex_lock(&share->mutex);
}
~Ndb_tuple_id_range_guard() {
- pthread_mutex_unlock(&share->mutex);
+ mysql_mutex_unlock(&share->mutex);
}
NDB_SHARE* share;
Ndb::TupleIdRange& range;
@@ -272,7 +275,7 @@ class ha_ndbcluster: public handler
ha_rows estimate_rows_upper_bound()
{ return HA_POS_ERROR; }
int info(uint);
- void get_dynamic_partition_info(PARTITION_INFO *stat_info, uint part_id);
+ void get_dynamic_partition_info(PARTITION_STATS *stat_info, uint part_id);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);
int reset();
@@ -385,6 +388,7 @@ static void set_tabname(const char *pathname, char *tabname);
uint table_changes);
private:
+ int loc_read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
friend int ndbcluster_drop_database_impl(const char *path);
friend int ndb_handle_schema_change(THD *thd,
Ndb *ndb, NdbEventOperation *pOp,
@@ -580,4 +584,6 @@ static const char ndbcluster_hton_name[]= "ndbcluster";
static const int ndbcluster_hton_name_length=sizeof(ndbcluster_hton_name)-1;
extern int ndbcluster_terminating;
extern int ndb_util_thread_running;
-extern pthread_cond_t COND_ndb_util_ready;
+extern mysql_cond_t COND_ndb_util_ready;
+
+#endif /* HA_NDBCLUSTER_INCLUDED */