2004-04-15 09:14:14 +02:00
|
|
|
/* Copyright (C) 2000-2003 MySQL AB
|
|
|
|
|
|
|
|
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
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2004-04-15 09:14:14 +02:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
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 */
|
|
|
|
|
|
|
|
/*
|
|
|
|
This file defines the NDB Cluster handler: the interface between MySQL and
|
|
|
|
NDB Cluster
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* The class defining a handle to an NDB Cluster table */
|
|
|
|
|
2005-05-04 15:05:56 +02:00
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
2004-04-15 09:14:14 +02:00
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <ndbapi_limits.h>
|
|
|
|
|
2006-02-10 17:40:22 +01:00
|
|
|
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
|
2007-04-23 11:25:33 +02:00
|
|
|
/* Forward declarations */
|
|
|
|
class Ndb;
|
|
|
|
class NdbOperation;
|
|
|
|
class NdbTransaction;
|
|
|
|
class NdbRecAttr;
|
2004-06-11 13:49:22 +02:00
|
|
|
class NdbScanOperation;
|
|
|
|
class NdbIndexScanOperation;
|
2004-07-22 12:38:09 +02:00
|
|
|
class NdbBlob;
|
2007-04-23 11:25:33 +02:00
|
|
|
class ha_ndbcluster_cond;
|
2004-04-15 09:14:14 +02:00
|
|
|
|
2004-08-20 18:10:47 +02:00
|
|
|
// connectstring to cluster if given by mysqld
|
|
|
|
extern const char *ndbcluster_connectstring;
|
2005-02-01 15:43:08 +01:00
|
|
|
extern ulong ndb_cache_check_time;
|
2007-03-12 19:08:35 +01:00
|
|
|
extern char opt_ndb_constrbuf[];
|
2004-08-18 19:13:39 +02:00
|
|
|
|
2004-04-15 09:14:14 +02:00
|
|
|
typedef enum ndb_index_type {
|
|
|
|
UNDEFINED_INDEX = 0,
|
|
|
|
PRIMARY_KEY_INDEX = 1,
|
2004-05-24 12:35:39 +02:00
|
|
|
PRIMARY_KEY_ORDERED_INDEX = 2,
|
|
|
|
UNIQUE_INDEX = 3,
|
|
|
|
UNIQUE_ORDERED_INDEX = 4,
|
|
|
|
ORDERED_INDEX = 5
|
2004-04-15 09:14:14 +02:00
|
|
|
} NDB_INDEX_TYPE;
|
|
|
|
|
2004-08-18 19:13:39 +02:00
|
|
|
typedef struct ndb_index_data {
|
|
|
|
NDB_INDEX_TYPE type;
|
|
|
|
void *index;
|
|
|
|
void *unique_index;
|
2005-01-26 11:31:46 +01:00
|
|
|
unsigned char *unique_index_attrid_map;
|
2006-11-07 16:38:37 +01:00
|
|
|
bool null_in_unique_index;
|
2004-08-18 19:13:39 +02:00
|
|
|
} NDB_INDEX_DATA;
|
2004-04-15 09:14:14 +02:00
|
|
|
|
|
|
|
typedef struct st_ndbcluster_share {
|
|
|
|
THR_LOCK lock;
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
char *table_name;
|
|
|
|
uint table_name_length,use_count;
|
2005-03-15 15:03:25 +01:00
|
|
|
uint commit_count_lock;
|
2005-02-07 13:46:13 +01:00
|
|
|
ulonglong commit_count;
|
2004-04-15 09:14:14 +02:00
|
|
|
} NDB_SHARE;
|
|
|
|
|
2006-08-15 14:31:21 +02:00
|
|
|
typedef enum ndb_query_state_bits {
|
|
|
|
NDB_QUERY_NORMAL = 0,
|
|
|
|
NDB_QUERY_MULTI_READ_RANGE = 1
|
|
|
|
} NDB_QUERY_STATE_BITS;
|
|
|
|
|
2004-09-14 14:47:34 +02:00
|
|
|
/*
|
|
|
|
Place holder for ha_ndbcluster thread specific data
|
|
|
|
*/
|
|
|
|
|
2005-02-16 14:18:32 +01:00
|
|
|
class Thd_ndb
|
|
|
|
{
|
2004-09-14 14:47:34 +02:00
|
|
|
public:
|
|
|
|
Thd_ndb();
|
|
|
|
~Thd_ndb();
|
|
|
|
Ndb *ndb;
|
|
|
|
ulong count;
|
|
|
|
uint lock_count;
|
2005-02-17 22:52:40 +01:00
|
|
|
NdbTransaction *all;
|
|
|
|
NdbTransaction *stmt;
|
2004-09-14 18:17:01 +02:00
|
|
|
int error;
|
2005-03-15 15:03:25 +01:00
|
|
|
List<NDB_SHARE> changed_tables;
|
2006-08-15 14:31:21 +02:00
|
|
|
uint query_state;
|
2004-09-14 14:47:34 +02:00
|
|
|
};
|
|
|
|
|
2004-04-15 09:14:14 +02:00
|
|
|
class ha_ndbcluster: public handler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ha_ndbcluster(TABLE *table);
|
|
|
|
~ha_ndbcluster();
|
|
|
|
|
|
|
|
int open(const char *name, int mode, uint test_if_locked);
|
|
|
|
int close(void);
|
|
|
|
|
|
|
|
int write_row(byte *buf);
|
|
|
|
int update_row(const byte *old_data, byte *new_data);
|
|
|
|
int delete_row(const byte *buf);
|
|
|
|
int index_init(uint index);
|
|
|
|
int index_end();
|
|
|
|
int index_read(byte *buf, const byte *key, uint key_len,
|
2005-02-16 14:18:32 +01:00
|
|
|
enum ha_rkey_function find_flag);
|
2004-04-15 09:14:14 +02:00
|
|
|
int index_read_idx(byte *buf, uint index, const byte *key, uint key_len,
|
2005-02-16 14:18:32 +01:00
|
|
|
enum ha_rkey_function find_flag);
|
2004-04-15 09:14:14 +02:00
|
|
|
int index_next(byte *buf);
|
|
|
|
int index_prev(byte *buf);
|
|
|
|
int index_first(byte *buf);
|
|
|
|
int index_last(byte *buf);
|
2004-12-20 15:12:42 +01:00
|
|
|
int index_read_last(byte * buf, const byte * key, uint key_len);
|
2004-06-25 17:49:36 +02:00
|
|
|
int rnd_init(bool scan);
|
2004-04-15 09:14:14 +02:00
|
|
|
int rnd_end();
|
|
|
|
int rnd_next(byte *buf);
|
|
|
|
int rnd_pos(byte *buf, byte *pos);
|
|
|
|
void position(const byte *record);
|
2004-04-30 13:38:41 +02:00
|
|
|
int read_range_first(const key_range *start_key,
|
2005-02-16 14:18:32 +01:00
|
|
|
const key_range *end_key,
|
|
|
|
bool eq_range, bool sorted);
|
2004-09-07 16:22:42 +02:00
|
|
|
int read_range_first_to_buf(const key_range *start_key,
|
2005-02-16 14:18:32 +01:00
|
|
|
const key_range *end_key,
|
|
|
|
bool eq_range, bool sorted,
|
|
|
|
byte* buf);
|
2004-05-24 12:35:39 +02:00
|
|
|
int read_range_next();
|
2004-04-30 13:38:41 +02:00
|
|
|
|
2004-11-17 10:07:52 +01:00
|
|
|
/**
|
|
|
|
* Multi range stuff
|
|
|
|
*/
|
2004-12-28 17:01:07 +01:00
|
|
|
int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
|
2005-02-16 14:18:32 +01:00
|
|
|
KEY_MULTI_RANGE*ranges, uint range_count,
|
|
|
|
bool sorted, HANDLER_BUFFER *buffer);
|
2004-12-28 17:01:07 +01:00
|
|
|
int read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
|
2006-11-07 16:38:37 +01:00
|
|
|
bool null_value_index_search(KEY_MULTI_RANGE *ranges,
|
|
|
|
KEY_MULTI_RANGE *end_range,
|
|
|
|
HANDLER_BUFFER *buffer);
|
2004-05-24 12:35:39 +02:00
|
|
|
bool get_error_message(int error, String *buf);
|
2006-08-10 16:55:20 +02:00
|
|
|
int info(uint);
|
2004-04-15 09:14:14 +02:00
|
|
|
int extra(enum ha_extra_function operation);
|
|
|
|
int extra_opt(enum ha_extra_function operation, ulong cache_size);
|
2007-03-22 12:42:13 +01:00
|
|
|
int reset();
|
2004-04-15 09:14:14 +02:00
|
|
|
int external_lock(THD *thd, int lock_type);
|
2006-06-08 16:12:38 +02:00
|
|
|
void unlock_row();
|
2005-09-30 20:20:10 +02:00
|
|
|
int start_stmt(THD *thd, thr_lock_type lock_type);
|
2004-11-17 09:15:53 +01:00
|
|
|
const char * table_type() const;
|
2004-04-15 09:14:14 +02:00
|
|
|
const char ** bas_ext() const;
|
2004-11-17 09:15:53 +01:00
|
|
|
ulong table_flags(void) const;
|
2004-07-08 14:45:25 +02:00
|
|
|
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
2004-11-17 09:15:53 +01:00
|
|
|
uint max_supported_record_length() const;
|
|
|
|
uint max_supported_keys() const;
|
|
|
|
uint max_supported_key_parts() const;
|
|
|
|
uint max_supported_key_length() const;
|
2006-02-07 19:57:31 +01:00
|
|
|
uint max_supported_key_part_length() const;
|
2004-04-15 09:14:14 +02:00
|
|
|
|
|
|
|
int rename_table(const char *from, const char *to);
|
|
|
|
int delete_table(const char *name);
|
|
|
|
int create(const char *name, TABLE *form, HA_CREATE_INFO *info);
|
|
|
|
THR_LOCK_DATA **store_lock(THD *thd,
|
2005-02-16 14:18:32 +01:00
|
|
|
THR_LOCK_DATA **to,
|
|
|
|
enum thr_lock_type lock_type);
|
2004-04-15 09:14:14 +02:00
|
|
|
|
2004-11-17 09:15:53 +01:00
|
|
|
bool low_byte_first() const;
|
|
|
|
bool has_transactions();
|
|
|
|
const char* index_type(uint key_number);
|
2004-04-15 09:14:14 +02:00
|
|
|
|
|
|
|
double scan_time();
|
2004-05-16 13:48:32 +02:00
|
|
|
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
|
2004-04-29 14:38:35 +02:00
|
|
|
void start_bulk_insert(ha_rows rows);
|
|
|
|
int end_bulk_insert();
|
2004-04-15 09:14:14 +02:00
|
|
|
|
2004-09-14 14:47:34 +02:00
|
|
|
static Thd_ndb* seize_thd_ndb();
|
|
|
|
static void release_thd_ndb(Thd_ndb* thd_ndb);
|
2004-12-17 21:13:22 +01:00
|
|
|
|
2005-04-22 17:38:28 +02:00
|
|
|
static void set_dbname(const char *pathname, char *dbname);
|
|
|
|
static void set_tabname(const char *pathname, char *tabname);
|
|
|
|
|
2004-12-17 21:13:22 +01:00
|
|
|
/*
|
|
|
|
Condition pushdown
|
|
|
|
*/
|
2005-02-23 15:51:26 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
Push condition down to the table handler.
|
|
|
|
SYNOPSIS
|
|
|
|
cond_push()
|
|
|
|
cond Condition to be pushed. The condition tree must not be
|
|
|
|
modified by the by the caller.
|
|
|
|
RETURN
|
|
|
|
The 'remainder' condition that caller must use to filter out records.
|
|
|
|
NULL means the handler will not return rows that do not match the
|
|
|
|
passed condition.
|
|
|
|
NOTES
|
|
|
|
The pushed conditions form a stack (from which one can remove the
|
|
|
|
last pushed condition using cond_pop).
|
|
|
|
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
|
|
|
|
AND ... AND pushed_condN)
|
|
|
|
or less restrictive condition, depending on handler's capabilities.
|
|
|
|
|
|
|
|
handler->extra(HA_EXTRA_RESET) call empties the condition stack.
|
|
|
|
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
|
|
|
|
condition stack.
|
|
|
|
The current implementation supports arbitrary AND/OR nested conditions
|
|
|
|
with comparisons between columns and constants (including constant
|
|
|
|
expressions and function calls) and the following comparison operators:
|
|
|
|
=, !=, >, >=, <, <=, like, "not like", "is null", and "is not null".
|
|
|
|
Negated conditions are supported by NOT which generate NAND/NOR groups.
|
|
|
|
*/
|
2004-12-17 21:13:22 +01:00
|
|
|
const COND *cond_push(const COND *cond);
|
2005-02-23 15:51:26 +01:00
|
|
|
/*
|
|
|
|
Pop the top condition from the condition stack of the handler instance.
|
|
|
|
SYNOPSIS
|
|
|
|
cond_pop()
|
|
|
|
Pops the top if condition stack, if stack is not empty
|
|
|
|
*/
|
2004-12-17 21:13:22 +01:00
|
|
|
void cond_pop();
|
|
|
|
|
2004-11-17 09:15:53 +01:00
|
|
|
uint8 table_cache_type();
|
2006-10-23 15:46:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal to ha_ndbcluster, used by C functions
|
|
|
|
*/
|
2006-10-23 15:57:28 +02:00
|
|
|
int ndb_err(NdbTransaction*);
|
2006-10-23 15:46:35 +02:00
|
|
|
|
2005-02-04 10:56:53 +01:00
|
|
|
my_bool register_query_cache_table(THD *thd, char *table_key,
|
2005-02-16 14:18:32 +01:00
|
|
|
uint key_length,
|
|
|
|
qc_engine_callback *engine_callback,
|
|
|
|
ulonglong *engine_data);
|
2005-02-04 10:56:53 +01:00
|
|
|
private:
|
2004-12-06 14:51:10 +01:00
|
|
|
int alter_table_name(const char *to);
|
2004-04-15 09:14:14 +02:00
|
|
|
int drop_table();
|
2004-04-30 12:25:31 +02:00
|
|
|
int create_index(const char *name, KEY *key_info, bool unique);
|
|
|
|
int create_ordered_index(const char *name, KEY *key_info);
|
|
|
|
int create_unique_index(const char *name, KEY *key_info);
|
2004-08-19 11:10:35 +02:00
|
|
|
int initialize_autoincrement(const void *table);
|
2004-08-19 11:51:06 +02:00
|
|
|
enum ILBP {ILBP_CREATE = 0, ILBP_OPEN = 1}; // Index List Build Phase
|
2005-03-22 17:42:08 +01:00
|
|
|
int build_index_list(Ndb *ndb, TABLE *tab, enum ILBP phase);
|
2004-04-15 09:14:14 +02:00
|
|
|
int get_metadata(const char* path);
|
|
|
|
void release_metadata();
|
|
|
|
NDB_INDEX_TYPE get_index_type(uint idx_no) const;
|
|
|
|
NDB_INDEX_TYPE get_index_type_from_table(uint index_no) const;
|
2006-11-07 16:38:37 +01:00
|
|
|
bool has_null_in_unique_index(uint idx_no) const;
|
|
|
|
bool check_index_fields_not_null(uint index_no);
|
2004-11-22 10:35:03 +01:00
|
|
|
|
2004-07-22 18:35:51 +02:00
|
|
|
int pk_read(const byte *key, uint key_len, byte *buf);
|
|
|
|
int complemented_pk_read(const byte *old_data, byte *new_data);
|
2006-03-23 09:48:46 +01:00
|
|
|
bool check_all_operations_for_error(NdbTransaction *trans,
|
|
|
|
const NdbOperation *first,
|
|
|
|
const NdbOperation *last,
|
|
|
|
uint errcode);
|
2006-11-30 22:52:23 +01:00
|
|
|
int peek_indexed_rows(const byte *record, bool check_pk);
|
2004-04-15 09:14:14 +02:00
|
|
|
int unique_index_read(const byte *key, uint key_len,
|
2005-02-16 14:18:32 +01:00
|
|
|
byte *buf);
|
2004-04-30 13:38:41 +02:00
|
|
|
int ordered_index_scan(const key_range *start_key,
|
2005-02-16 14:18:32 +01:00
|
|
|
const key_range *end_key,
|
|
|
|
bool sorted, bool descending, byte* buf);
|
2006-11-07 16:38:37 +01:00
|
|
|
int unique_index_scan(const KEY* key_info,
|
|
|
|
const byte *key,
|
|
|
|
uint key_len,
|
|
|
|
byte *buf);
|
|
|
|
|
2004-04-15 09:14:14 +02:00
|
|
|
int full_table_scan(byte * buf);
|
2004-12-08 00:36:40 +01:00
|
|
|
int fetch_next(NdbScanOperation* op);
|
2004-04-15 09:14:14 +02:00
|
|
|
int next_result(byte *buf);
|
2004-05-10 14:12:28 +02:00
|
|
|
int define_read_attrs(byte* buf, NdbOperation* op);
|
2004-04-15 09:14:14 +02:00
|
|
|
int filtered_scan(const byte *key, uint key_len,
|
2005-02-16 14:18:32 +01:00
|
|
|
byte *buf,
|
|
|
|
enum ha_rkey_function find_flag);
|
2004-05-11 13:59:22 +02:00
|
|
|
int close_scan();
|
2004-04-15 09:14:14 +02:00
|
|
|
void unpack_record(byte *buf);
|
2004-07-22 12:38:09 +02:00
|
|
|
int get_ndb_lock_type(enum thr_lock_type type);
|
2004-04-15 09:14:14 +02:00
|
|
|
|
|
|
|
void set_dbname(const char *pathname);
|
|
|
|
void set_tabname(const char *pathname);
|
|
|
|
|
|
|
|
bool set_hidden_key(NdbOperation*,
|
2005-02-16 14:18:32 +01:00
|
|
|
uint fieldnr, const byte* field_ptr);
|
2004-04-15 09:14:14 +02:00
|
|
|
int set_ndb_key(NdbOperation*, Field *field,
|
2005-02-16 14:18:32 +01:00
|
|
|
uint fieldnr, const byte* field_ptr);
|
2004-10-01 13:16:49 +02:00
|
|
|
int set_ndb_value(NdbOperation*, Field *field, uint fieldnr, bool *set_blob_value= 0);
|
2004-09-20 20:50:48 +02:00
|
|
|
int get_ndb_value(NdbOperation*, Field *field, uint fieldnr, byte*);
|
2004-07-29 10:44:53 +02:00
|
|
|
friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg);
|
2006-06-21 09:36:50 +02:00
|
|
|
int get_ndb_blobs_value(NdbBlob *last_ndb_blob, my_ptrdiff_t ptrdiff);
|
2004-04-15 09:14:14 +02:00
|
|
|
int set_primary_key(NdbOperation *op, const byte *key);
|
2005-07-06 11:23:36 +02:00
|
|
|
int set_primary_key_from_record(NdbOperation *op, const byte *record);
|
2006-03-23 09:48:46 +01:00
|
|
|
int set_index_key_from_record(NdbOperation *op, const byte *record,
|
|
|
|
uint keyno);
|
2004-12-06 09:05:30 +01:00
|
|
|
int set_bounds(NdbIndexScanOperation*, const key_range *keys[2], uint= 0);
|
2004-04-15 09:14:14 +02:00
|
|
|
int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
|
2004-11-30 13:37:03 +01:00
|
|
|
int set_index_key(NdbOperation *, const KEY *key_info, const byte *key_ptr);
|
2004-04-15 09:14:14 +02:00
|
|
|
void print_results();
|
|
|
|
|
2004-09-15 21:10:31 +02:00
|
|
|
ulonglong get_auto_increment();
|
2005-04-27 18:17:41 +02:00
|
|
|
void invalidate_dictionary_cache(bool global);
|
2006-10-23 15:57:28 +02:00
|
|
|
|
|
|
|
bool uses_blob_value(bool all_fields);
|
2004-04-15 09:14:14 +02:00
|
|
|
|
2005-02-01 10:03:37 +01:00
|
|
|
char *update_table_comment(const char * comment);
|
|
|
|
|
2004-09-13 14:46:38 +02:00
|
|
|
int write_ndb_file();
|
|
|
|
|
2005-03-15 15:03:25 +01:00
|
|
|
int check_ndb_connection(THD* thd= current_thd);
|
2004-04-15 09:14:14 +02:00
|
|
|
|
2004-12-17 21:13:22 +01:00
|
|
|
void set_rec_per_key();
|
2006-10-16 09:39:38 +02:00
|
|
|
int records_update();
|
2004-12-17 21:13:22 +01:00
|
|
|
void no_uncommitted_rows_execute_failure();
|
|
|
|
void no_uncommitted_rows_update(int);
|
|
|
|
void no_uncommitted_rows_init(THD *);
|
|
|
|
void no_uncommitted_rows_reset(THD *);
|
|
|
|
|
2007-04-24 11:17:27 +02:00
|
|
|
void release_completed_operations(NdbTransaction*, bool);
|
|
|
|
|
2004-12-29 09:54:48 +01:00
|
|
|
friend int execute_commit(ha_ndbcluster*, NdbTransaction*);
|
2006-08-15 14:31:21 +02:00
|
|
|
friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*, bool);
|
|
|
|
friend int execute_no_commit_ie(ha_ndbcluster*, NdbTransaction*, bool);
|
2004-12-17 21:13:22 +01:00
|
|
|
|
2004-12-23 11:21:01 +01:00
|
|
|
NdbTransaction *m_active_trans;
|
2004-12-08 00:36:40 +01:00
|
|
|
NdbScanOperation *m_active_cursor;
|
2004-09-14 10:52:21 +02:00
|
|
|
void *m_table;
|
2005-04-27 18:17:41 +02:00
|
|
|
int m_table_version;
|
2004-09-14 10:52:21 +02:00
|
|
|
void *m_table_info;
|
2004-04-15 09:14:14 +02:00
|
|
|
char m_dbname[FN_HEADLEN];
|
|
|
|
//char m_schemaname[FN_HEADLEN];
|
|
|
|
char m_tabname[FN_HEADLEN];
|
|
|
|
ulong m_table_flags;
|
|
|
|
THR_LOCK_DATA m_lock;
|
2006-06-08 16:12:38 +02:00
|
|
|
bool m_lock_tuple;
|
2004-04-15 09:14:14 +02:00
|
|
|
NDB_SHARE *m_share;
|
2004-08-18 19:13:39 +02:00
|
|
|
NDB_INDEX_DATA m_index[MAX_KEY];
|
2004-07-22 12:38:09 +02:00
|
|
|
// NdbRecAttr has no reference to blob
|
2004-12-01 12:43:30 +01:00
|
|
|
typedef union { const NdbRecAttr *rec; NdbBlob *blob; void *ptr; } NdbValue;
|
2004-07-22 12:38:09 +02:00
|
|
|
NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE];
|
2006-02-10 17:40:22 +01:00
|
|
|
byte m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH];
|
2004-04-15 09:14:14 +02:00
|
|
|
bool m_use_write;
|
2004-11-18 12:11:56 +01:00
|
|
|
bool m_ignore_dup_key;
|
2006-03-23 09:48:46 +01:00
|
|
|
bool m_has_unique_index;
|
2004-11-03 15:53:26 +01:00
|
|
|
bool m_primary_key_update;
|
|
|
|
bool m_retrieve_all_fields;
|
2004-11-18 12:11:56 +01:00
|
|
|
bool m_retrieve_primary_key;
|
2004-11-03 15:53:26 +01:00
|
|
|
ha_rows m_rows_to_insert;
|
|
|
|
ha_rows m_rows_inserted;
|
|
|
|
ha_rows m_bulk_insert_rows;
|
2005-03-15 15:03:25 +01:00
|
|
|
ha_rows m_rows_changed;
|
2004-11-03 15:53:26 +01:00
|
|
|
bool m_bulk_insert_not_flushed;
|
2007-04-04 12:50:39 +02:00
|
|
|
bool m_delete_cannot_batch;
|
|
|
|
bool m_update_cannot_batch;
|
2004-11-03 15:53:26 +01:00
|
|
|
ha_rows m_ops_pending;
|
|
|
|
bool m_skip_auto_increment;
|
|
|
|
bool m_blobs_pending;
|
2006-06-21 09:36:50 +02:00
|
|
|
my_ptrdiff_t m_blobs_offset;
|
2004-07-22 12:38:09 +02:00
|
|
|
// memory for blobs in one tuple
|
2004-11-03 15:53:26 +01:00
|
|
|
char *m_blobs_buffer;
|
|
|
|
uint32 m_blobs_buffer_size;
|
|
|
|
uint m_dupkey;
|
2004-11-22 14:41:46 +01:00
|
|
|
// set from thread variables at external lock
|
2004-11-17 09:15:53 +01:00
|
|
|
bool m_ha_not_exact_count;
|
|
|
|
bool m_force_send;
|
|
|
|
ha_rows m_autoincrement_prefetch;
|
|
|
|
bool m_transaction_on;
|
2006-08-15 13:12:27 +02:00
|
|
|
|
2007-04-23 11:25:33 +02:00
|
|
|
ha_ndbcluster_cond *m_cond;
|
2004-11-17 10:07:52 +01:00
|
|
|
bool m_disable_multi_read;
|
2004-12-08 00:36:40 +01:00
|
|
|
byte *m_multi_range_result_ptr;
|
2004-12-28 17:01:07 +01:00
|
|
|
KEY_MULTI_RANGE *m_multi_ranges;
|
|
|
|
KEY_MULTI_RANGE *m_multi_range_defined;
|
2004-12-08 00:36:40 +01:00
|
|
|
const NdbOperation *m_current_multi_operation;
|
|
|
|
NdbIndexScanOperation *m_multi_cursor;
|
|
|
|
byte *m_multi_range_cursor_result_ptr;
|
2004-12-01 12:43:30 +01:00
|
|
|
int setup_recattr(const NdbRecAttr*);
|
2004-12-30 19:56:09 +01:00
|
|
|
Ndb *get_ndb();
|
2004-04-15 09:14:14 +02:00
|
|
|
};
|
|
|
|
|
2005-01-14 12:32:33 +01:00
|
|
|
extern struct show_var_st ndb_status_variables[];
|
|
|
|
|
2005-10-03 04:44:28 +02:00
|
|
|
bool ndbcluster_init(void);
|
2004-04-15 09:14:14 +02:00
|
|
|
bool ndbcluster_end(void);
|
|
|
|
|
2004-09-13 14:46:38 +02:00
|
|
|
int ndbcluster_discover(THD* thd, const char* dbname, const char* name,
|
2005-02-16 14:18:32 +01:00
|
|
|
const void** frmblob, uint* frmlen);
|
2004-09-21 12:13:58 +02:00
|
|
|
int ndbcluster_find_files(THD *thd,const char *db,const char *path,
|
2005-02-16 14:18:32 +01:00
|
|
|
const char *wild, bool dir, List<char> *files);
|
2005-06-08 13:31:59 +02:00
|
|
|
int ndbcluster_table_exists_in_engine(THD* thd,
|
|
|
|
const char *db, const char *name);
|
2004-04-15 09:14:14 +02:00
|
|
|
int ndbcluster_drop_database(const char* path);
|
|
|
|
|
2004-07-02 16:14:08 +02:00
|
|
|
void ndbcluster_print_error(int error, const NdbOperation *error_op);
|
2005-09-19 15:35:07 +02:00
|
|
|
|
|
|
|
int ndbcluster_show_status(THD*);
|