149
156
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
150
157
#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
158
#define HA_CAN_FULLTEXT (1 << 21) /* Historical, no longer supported */
159
#define HA_CAN_SQL_HANDLER (1 << 22) /* Historical, no longer supported */
151
160
#define HA_NO_AUTO_INCREMENT (1 << 23)
152
161
#define HA_HAS_CHECKSUM (1 << 24)
153
162
/* Table data are stored in separate files (for lower_case_table_names) */
154
163
#define HA_FILE_BASED (1 << 26)
164
#define HA_NO_VARCHAR (1 << 27) /* Historical, no longer supported */
165
#define HA_CAN_BIT_FIELD (1 << 28) /* Historical, no longer supported */
155
166
#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */
156
167
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
157
#define HA_NO_COPY_ON_ALTER (INT64_C(1) << 31)
158
#define HA_HAS_RECORDS (INT64_C(1) << 32) /* records() gives exact count*/
159
#define HA_MRR_CANT_SORT (INT64_C(1) << 34)
168
#define HA_NO_COPY_ON_ALTER (1LL << 31)
169
#define HA_HAS_RECORDS (1LL << 32) /* records() gives exact count*/
170
/* Has it's own method of binlog logging */
171
#define HA_HAS_OWN_BINLOGGING (1LL << 33) /* Historical, no longer supported */
172
#define HA_MRR_CANT_SORT (1LL << 34)
162
175
Engine is capable of row-format and statement-format logging,
165
#define HA_BINLOG_ROW_CAPABLE (INT64_C(1) << 35)
166
#define HA_BINLOG_STMT_CAPABLE (INT64_C(1) << 36)
178
#define HA_BINLOG_ROW_CAPABLE (1LL << 35)
179
#define HA_BINLOG_STMT_CAPABLE (1LL << 36)
168
#define HA_ONLINE_ALTER (INT64_C(1) << 37)
181
#define HA_ONLINE_ALTER (1LL << 37)
171
184
Set of all binlog flags. Currently only contain the capabilities
282
295
enum legacy_db_type
297
DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
298
DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM,
299
DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM,
300
DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM,
301
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
302
DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
303
DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
304
DB_TYPE_FEDERATED_DB,
305
DB_TYPE_BLACKHOLE_DB,
306
DB_TYPE_PARTITION_DB,
310
DB_TYPE_TABLE_FUNCTION,
285
314
DB_TYPE_FIRST_DYNAMIC=42,
286
315
DB_TYPE_DEFAULT=127 // Must be last
445
475
typedef struct st_table_share TABLE_SHARE;
446
476
struct st_foreign_key_info;
447
477
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
448
typedef bool (stat_print_fn)(THD *thd, const char *type, uint32_t type_len,
449
const char *file, uint32_t file_len,
450
const char *status, uint32_t status_len);
478
typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
479
const char *file, uint file_len,
480
const char *status, uint status_len);
451
481
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
452
482
extern st_plugin_int *hton2plugin[MAX_HA];
524
554
int (*commit)(handlerton *hton, THD *thd, bool all);
525
555
int (*rollback)(handlerton *hton, THD *thd, bool all);
526
556
int (*prepare)(handlerton *hton, THD *thd, bool all);
527
int (*recover)(handlerton *hton, XID *xid_list, uint32_t len);
557
int (*recover)(handlerton *hton, XID *xid_list, uint len);
528
558
int (*commit_by_xid)(handlerton *hton, XID *xid);
529
559
int (*rollback_by_xid)(handlerton *hton, XID *xid);
530
560
void *(*create_cursor_read_view)(handlerton *hton, THD *thd);
740
770
uint32_t used_fields;
741
771
uint32_t key_block_size;
742
772
uint32_t block_size;
743
774
handlerton *db_type;
744
775
enum row_type row_type;
745
uint32_t null_bits; /* NULL bits at start of record */
746
uint32_t options; /* OR of HA_CREATE_ options */
747
uint32_t extra_size; /* length of extra data segment */
776
uint null_bits; /* NULL bits at start of record */
777
uint options; /* OR of HA_CREATE_ options */
778
uint merge_insert_method;
779
uint extra_size; /* length of extra data segment */
780
/* 0 not used, 1 if not transactional, 2 if transactional */
781
enum ha_choice transactional;
748
782
bool table_existed; /* 1 in create if table existed */
749
783
bool frm_only; /* 1 if no ha_create_table() */
750
784
bool varchar; /* 1 if table has a VARCHAR */
792
826
TABLEOP_HOOKS() {}
793
827
virtual ~TABLEOP_HOOKS() {}
795
inline void prelock(Table **tables, uint32_t count)
829
inline void prelock(Table **tables, uint count)
797
831
do_prelock(tables, count);
800
inline int postlock(Table **tables, uint32_t count)
834
inline int postlock(Table **tables, uint count)
802
836
return do_postlock(tables, count);
805
839
/* Function primitive that is called prior to locking tables */
806
840
virtual void do_prelock(Table **tables __attribute__((unused)),
807
uint32_t count __attribute__((unused)))
841
uint count __attribute__((unused)))
809
843
/* Default is to do nothing */
891
925
0 - Ok, the range structure filled with info about the next range
892
926
1 - No more ranges
894
uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
928
uint (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
897
uint16_t &mrr_persistent_flag_storage(range_seq_t seq, uint32_t idx);
898
char* &mrr_get_ptr_by_idx(range_seq_t seq, uint32_t idx);
931
uint16_t &mrr_persistent_flag_storage(range_seq_t seq, uint idx);
932
char* &mrr_get_ptr_by_idx(range_seq_t seq, uint idx);
1103
1137
ha_rows estimation_rows_to_insert;
1105
1139
handlerton *ht; /* storage engine of this handler */
1106
unsigned char *ref; /* Pointer to current row */
1107
unsigned char *dup_ref; /* Pointer to duplicate row */
1140
uchar *ref; /* Pointer to current row */
1141
uchar *dup_ref; /* Pointer to duplicate row */
1109
1143
ha_statistics stats;
1110
1144
/** MultiRangeRead-related members: */
1111
1145
range_seq_t mrr_iter; /* Interator to traverse the range sequence */
1112
1146
RANGE_SEQ_IF mrr_funcs; /* Range sequence traversal functions */
1113
1147
HANDLER_BUFFER *multi_range_buffer; /* MRR buffer info */
1114
uint32_t ranges_in_seq; /* Total number of ranges in the traversed sequence */
1148
uint ranges_in_seq; /* Total number of ranges in the traversed sequence */
1115
1149
/* true <=> source MRR ranges and the output are ordered */
1116
1150
bool mrr_is_output_sorted;
1132
1166
bool in_range_check_pushed_down;
1134
uint32_t errkey; /* Last dup key */
1135
uint32_t key_used_on_scan;
1136
uint32_t active_index;
1168
uint errkey; /* Last dup key */
1169
uint key_used_on_scan;
1137
1171
/** Length of ref (1-8 or the clustered key length) */
1138
uint32_t ref_length;
1139
1173
enum {NONE=0, INDEX, RND} inited;
1141
1175
bool implicit_emptied; /* Can be !=0 only if HEAP */
1142
1176
const Item *pushed_cond;
1144
1178
Item *pushed_idx_cond;
1145
uint32_t pushed_idx_cond_keyno; /* The index which the above condition is for */
1179
uint pushed_idx_cond_keyno; /* The index which the above condition is for */
1148
1182
next_insert_id is the next value which should be inserted into the
1235
1269
and delete_row() below.
1237
1271
int ha_external_lock(THD *thd, int lock_type);
1238
int ha_write_row(unsigned char * buf);
1239
int ha_update_row(const unsigned char * old_data, unsigned char * new_data);
1240
int ha_delete_row(const unsigned char * buf);
1272
int ha_write_row(uchar * buf);
1273
int ha_update_row(const uchar * old_data, uchar * new_data);
1274
int ha_delete_row(const uchar * buf);
1241
1275
void ha_release_auto_increment();
1243
1277
int ha_check_for_upgrade(HA_CHECK_OPT *check_opt);
1254
1288
estimation_rows_to_insert= 0;
1255
1289
return end_bulk_insert();
1257
int ha_bulk_update_row(const unsigned char *old_data, unsigned char *new_data,
1258
uint32_t *dup_key_found);
1291
int ha_bulk_update_row(const uchar *old_data, uchar *new_data,
1292
uint *dup_key_found);
1259
1293
int ha_delete_all_rows();
1260
1294
int ha_reset_auto_increment(uint64_t value);
1261
1295
int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
1262
1296
int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
1263
1297
bool ha_check_and_repair(THD *thd);
1264
int ha_disable_indexes(uint32_t mode);
1265
int ha_enable_indexes(uint32_t mode);
1298
int ha_disable_indexes(uint mode);
1299
int ha_enable_indexes(uint mode);
1266
1300
int ha_discard_or_import_tablespace(bool discard);
1267
1301
void ha_prepare_for_alter();
1268
1302
int ha_rename_table(const char *from, const char *to);
1277
1311
void adjust_next_insert_id_after_explicit_value(uint64_t nr);
1278
1312
int update_auto_increment();
1279
void print_keydup_error(uint32_t key_nr, const char *msg);
1313
void print_keydup_error(uint key_nr, const char *msg);
1280
1314
virtual void print_error(int error, myf errflag);
1281
1315
virtual bool get_error_message(int error, String *buf);
1282
uint32_t get_dup_key(int error);
1316
uint get_dup_key(int error);
1283
1317
virtual void change_table_ptr(Table *table_arg, TABLE_SHARE *share)
1285
1319
table= table_arg;
1288
1322
/* Estimates calculation */
1289
1323
virtual double scan_time(void)
1290
1324
{ return uint64_t2double(stats.data_file_length) / IO_SIZE + 2; }
1291
virtual double read_time(uint32_t index __attribute__((unused)),
1292
uint32_t ranges, ha_rows rows)
1325
virtual double read_time(uint index __attribute__((unused)),
1326
uint ranges, ha_rows rows)
1293
1327
{ return rows2double(ranges+rows); }
1295
virtual double index_only_read_time(uint32_t keynr, double records);
1329
virtual double index_only_read_time(uint keynr, double records);
1297
virtual ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1331
virtual ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
1298
1332
void *seq_init_param,
1299
uint32_t n_ranges, uint32_t *bufsz,
1300
uint32_t *flags, COST_VECT *cost);
1301
virtual int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
1302
uint32_t *bufsz, uint32_t *flags, COST_VECT *cost);
1333
uint n_ranges, uint *bufsz,
1334
uint *flags, COST_VECT *cost);
1335
virtual int multi_range_read_info(uint keyno, uint n_ranges, uint keys,
1336
uint *bufsz, uint *flags, COST_VECT *cost);
1303
1337
virtual int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
1304
uint32_t n_ranges, uint32_t mode,
1338
uint n_ranges, uint mode,
1305
1339
HANDLER_BUFFER *buf);
1306
1340
virtual int multi_range_read_next(char **range_info);
1414
1448
row if available. If the key value is null, begin at the first key of the
1417
virtual int index_read_map(unsigned char * buf, const unsigned char * key,
1451
virtual int index_read_map(uchar * buf, const uchar * key,
1418
1452
key_part_map keypart_map,
1419
1453
enum ha_rkey_function find_flag)
1421
uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
1455
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
1422
1456
return index_read(buf, key, key_len, find_flag);
1427
1461
row if available. If the key value is null, begin at the first key of the
1430
virtual int index_read_idx_map(unsigned char * buf, uint32_t index, const unsigned char * key,
1464
virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key,
1431
1465
key_part_map keypart_map,
1432
1466
enum ha_rkey_function find_flag);
1433
virtual int index_next(unsigned char * buf __attribute__((unused)))
1434
{ return HA_ERR_WRONG_COMMAND; }
1435
virtual int index_prev(unsigned char * buf __attribute__((unused)))
1436
{ return HA_ERR_WRONG_COMMAND; }
1437
virtual int index_first(unsigned char * buf __attribute__((unused)))
1438
{ return HA_ERR_WRONG_COMMAND; }
1439
virtual int index_last(unsigned char * buf __attribute__((unused)))
1440
{ return HA_ERR_WRONG_COMMAND; }
1441
virtual int index_next_same(unsigned char *buf __attribute__((unused)),
1442
const unsigned char *key __attribute__((unused)),
1443
uint32_t keylen __attribute__((unused)));
1467
virtual int index_next(uchar * buf __attribute__((unused)))
1468
{ return HA_ERR_WRONG_COMMAND; }
1469
virtual int index_prev(uchar * buf __attribute__((unused)))
1470
{ return HA_ERR_WRONG_COMMAND; }
1471
virtual int index_first(uchar * buf __attribute__((unused)))
1472
{ return HA_ERR_WRONG_COMMAND; }
1473
virtual int index_last(uchar * buf __attribute__((unused)))
1474
{ return HA_ERR_WRONG_COMMAND; }
1475
virtual int index_next_same(uchar *buf __attribute__((unused)),
1476
const uchar *key __attribute__((unused)),
1477
uint keylen __attribute__((unused)));
1446
1480
The following functions works like index_read, but it find the last
1447
1481
row with the current key value or prefix.
1449
virtual int index_read_last_map(unsigned char * buf, const unsigned char * key,
1483
virtual int index_read_last_map(uchar * buf, const uchar * key,
1450
1484
key_part_map keypart_map)
1452
uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
1486
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
1453
1487
return index_read_last(buf, key, key_len);
1455
1489
virtual int read_range_first(const key_range *start_key,
1458
1492
virtual int read_range_next();
1459
1493
int compare_key(key_range *range);
1460
1494
int compare_key2(key_range *range);
1461
virtual int rnd_next(unsigned char *buf __attribute__((unused)))=0;
1462
virtual int rnd_pos(unsigned char * buf __attribute__((unused)),
1463
unsigned char *pos __attribute__((unused)))=0;
1495
virtual int rnd_next(uchar *buf __attribute__((unused)))=0;
1496
virtual int rnd_pos(uchar * buf __attribute__((unused)),
1497
uchar *pos __attribute__((unused)))=0;
1465
1499
One has to use this method when to find
1466
1500
random position by record as the plain
1467
1501
position() call doesn't work for some
1468
1502
handlers for random position.
1470
virtual int rnd_pos_by_record(unsigned char *record);
1471
virtual int read_first_row(unsigned char *buf, uint32_t primary_key);
1504
virtual int rnd_pos_by_record(uchar *record);
1505
virtual int read_first_row(uchar *buf, uint primary_key);
1473
1507
The following function is only needed for tables that may be temporary
1474
1508
tables during joins.
1476
virtual int restart_rnd_next(unsigned char *buf __attribute__((unused)),
1477
unsigned char *pos __attribute__((unused)))
1478
{ return HA_ERR_WRONG_COMMAND; }
1479
virtual int rnd_same(unsigned char *buf __attribute__((unused)),
1480
uint32_t inx __attribute__((unused)))
1481
{ return HA_ERR_WRONG_COMMAND; }
1482
virtual ha_rows records_in_range(uint32_t inx __attribute__((unused)),
1510
virtual int restart_rnd_next(uchar *buf __attribute__((unused)),
1511
uchar *pos __attribute__((unused)))
1512
{ return HA_ERR_WRONG_COMMAND; }
1513
virtual int rnd_same(uchar *buf __attribute__((unused)),
1514
uint inx __attribute__((unused)))
1515
{ return HA_ERR_WRONG_COMMAND; }
1516
virtual ha_rows records_in_range(uint inx __attribute__((unused)),
1483
1517
key_range *min_key __attribute__((unused)),
1484
1518
key_range *max_key __attribute__((unused)))
1485
1519
{ return (ha_rows) 10; }
1486
virtual void position(const unsigned char *record)=0;
1520
virtual void position(const uchar *record)=0;
1487
1521
virtual int info(uint)=0; // see my_base.h for full description
1488
1522
virtual uint32_t calculate_key_hash_value(Field **field_array __attribute__((unused)))
1489
1523
{ assert(0); return 0; }
1595
1629
virtual int get_default_no_partitions(HA_CREATE_INFO *info __attribute__((unused))) { return 1;}
1596
1630
virtual bool get_no_parts(const char *name __attribute__((unused)),
1603
virtual uint32_t index_flags(uint32_t idx, uint32_t part, bool all_parts) const =0;
1637
virtual uint32_t index_flags(uint idx, uint part, bool all_parts) const =0;
1605
1639
virtual int add_index(Table *table_arg __attribute__((unused)),
1606
1640
KEY *key_info __attribute__((unused)),
1607
uint32_t num_of_keys __attribute__((unused)))
1641
uint num_of_keys __attribute__((unused)))
1608
1642
{ return (HA_ERR_WRONG_COMMAND); }
1609
1643
virtual int prepare_drop_index(Table *table_arg __attribute__((unused)),
1610
uint32_t *key_num __attribute__((unused)),
1611
uint32_t num_of_keys __attribute__((unused)))
1644
uint *key_num __attribute__((unused)),
1645
uint num_of_keys __attribute__((unused)))
1612
1646
{ return (HA_ERR_WRONG_COMMAND); }
1613
1647
virtual int final_drop_index(Table *table_arg __attribute__((unused)))
1614
1648
{ return (HA_ERR_WRONG_COMMAND); }
1616
uint32_t max_record_length() const
1617
{ return cmin((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); }
1618
uint32_t max_keys() const
1619
{ return cmin((unsigned int)MAX_KEY, max_supported_keys()); }
1620
uint32_t max_key_parts() const
1621
{ return cmin((unsigned int)MAX_REF_PARTS, max_supported_key_parts()); }
1622
uint32_t max_key_length() const
1623
{ return cmin((unsigned int)MAX_KEY_LENGTH, max_supported_key_length()); }
1624
uint32_t max_key_part_length(void) const
1625
{ return cmin((unsigned int)MAX_KEY_LENGTH, max_supported_key_part_length()); }
1650
uint max_record_length() const
1651
{ return min((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); }
1652
uint max_keys() const
1653
{ return min((unsigned int)MAX_KEY, max_supported_keys()); }
1654
uint max_key_parts() const
1655
{ return min((unsigned int)MAX_REF_PARTS, max_supported_key_parts()); }
1656
uint max_key_length() const
1657
{ return min((unsigned int)MAX_KEY_LENGTH, max_supported_key_length()); }
1658
uint max_key_part_length(void) const
1659
{ return min((unsigned int)MAX_KEY_LENGTH, max_supported_key_part_length()); }
1627
virtual uint32_t max_supported_record_length(void) const
1661
virtual uint max_supported_record_length(void) const
1628
1662
{ return HA_MAX_REC_LENGTH; }
1629
virtual uint32_t max_supported_keys(void) const { return 0; }
1630
virtual uint32_t max_supported_key_parts(void) const { return MAX_REF_PARTS; }
1631
virtual uint32_t max_supported_key_length(void) const { return MAX_KEY_LENGTH; }
1632
virtual uint32_t max_supported_key_part_length(void) const { return 255; }
1633
virtual uint32_t min_record_length(uint32_t options __attribute__((unused))) const
1663
virtual uint max_supported_keys(void) const { return 0; }
1664
virtual uint max_supported_key_parts(void) const { return MAX_REF_PARTS; }
1665
virtual uint max_supported_key_length(void) const { return MAX_KEY_LENGTH; }
1666
virtual uint max_supported_key_part_length(void) const { return 255; }
1667
virtual uint min_record_length(uint options __attribute__((unused))) const
1636
1670
virtual bool low_byte_first(void) const { return 1; }
1637
virtual uint32_t checksum(void) const { return 0; }
1671
virtual uint checksum(void) const { return 0; }
1638
1672
virtual bool is_crashed(void) const { return 0; }
1639
1673
virtual bool auto_repair(void) const { return 0; }
1935
1969
the corresponding 'ha_*' method above.
1938
virtual int open(const char *name, int mode, uint32_t test_if_locked)=0;
1939
virtual int index_init(uint32_t idx,
1972
virtual int open(const char *name, int mode, uint test_if_locked)=0;
1973
virtual int index_init(uint idx,
1940
1974
bool sorted __attribute__((unused)))
1941
1975
{ active_index= idx; return 0; }
1942
1976
virtual int index_end() { active_index= MAX_KEY; return 0; }
1950
1984
virtual int rnd_init(bool scan)= 0;
1951
1985
virtual int rnd_end() { return 0; }
1952
virtual int write_row(unsigned char *buf __attribute__((unused)))
1954
return HA_ERR_WRONG_COMMAND;
1957
virtual int update_row(const unsigned char *old_data __attribute__((unused)),
1958
unsigned char *new_data __attribute__((unused)))
1960
return HA_ERR_WRONG_COMMAND;
1963
virtual int delete_row(const unsigned char *buf __attribute__((unused)))
1986
virtual int write_row(uchar *buf __attribute__((unused)))
1988
return HA_ERR_WRONG_COMMAND;
1991
virtual int update_row(const uchar *old_data __attribute__((unused)),
1992
uchar *new_data __attribute__((unused)))
1994
return HA_ERR_WRONG_COMMAND;
1997
virtual int delete_row(const uchar *buf __attribute__((unused)))
1965
1999
return HA_ERR_WRONG_COMMAND;
2018
2052
virtual void start_bulk_insert(ha_rows rows __attribute__((unused)))
2020
2054
virtual int end_bulk_insert(void) { return 0; }
2021
virtual int index_read(unsigned char * buf __attribute__((unused)),
2022
const unsigned char * key __attribute__((unused)),
2023
uint32_t key_len __attribute__((unused)),
2055
virtual int index_read(uchar * buf __attribute__((unused)),
2056
const uchar * key __attribute__((unused)),
2057
uint key_len __attribute__((unused)),
2024
2058
enum ha_rkey_function find_flag __attribute__((unused)))
2025
2059
{ return HA_ERR_WRONG_COMMAND; }
2026
virtual int index_read_last(unsigned char * buf __attribute__((unused)),
2027
const unsigned char * key __attribute__((unused)),
2028
uint32_t key_len __attribute__((unused)))
2060
virtual int index_read_last(uchar * buf __attribute__((unused)),
2061
const uchar * key __attribute__((unused)),
2062
uint key_len __attribute__((unused)))
2029
2063
{ return (my_errno= HA_ERR_WRONG_COMMAND); }
2031
2065
This method is similar to update_row, however the handler doesn't need
2040
2074
@retval 0 Bulk delete used by handler
2041
2075
@retval 1 Bulk delete not used, normal operation used
2043
virtual int bulk_update_row(const unsigned char *old_data __attribute__((unused)),
2044
unsigned char *new_data __attribute__((unused)),
2045
uint32_t *dup_key_found __attribute__((unused)))
2077
virtual int bulk_update_row(const uchar *old_data __attribute__((unused)),
2078
uchar *new_data __attribute__((unused)),
2079
uint *dup_key_found __attribute__((unused)))
2048
2082
return HA_ERR_WRONG_COMMAND;
2071
2105
{ return HA_ADMIN_NOT_IMPLEMENTED; }
2072
2106
virtual bool check_and_repair(THD *thd __attribute__((unused)))
2073
2107
{ return true; }
2074
virtual int disable_indexes(uint32_t mode __attribute__((unused)))
2108
virtual int disable_indexes(uint mode __attribute__((unused)))
2075
2109
{ return HA_ERR_WRONG_COMMAND; }
2076
virtual int enable_indexes(uint32_t mode __attribute__((unused)))
2110
virtual int enable_indexes(uint mode __attribute__((unused)))
2077
2111
{ return HA_ERR_WRONG_COMMAND; }
2078
2112
virtual int discard_or_import_tablespace(bool discard __attribute__((unused)))
2079
2113
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
2122
2156
/* Buffer to store rowids, or (rowid, range_id) pairs */
2123
unsigned char *rowids_buf;
2124
unsigned char *rowids_buf_cur; /* Current position when reading/writing */
2125
unsigned char *rowids_buf_last; /* When reading: end of used buffer space */
2126
unsigned char *rowids_buf_end; /* End of the buffer */
2158
uchar *rowids_buf_cur; /* Current position when reading/writing */
2159
uchar *rowids_buf_last; /* When reading: end of used buffer space */
2160
uchar *rowids_buf_end; /* End of the buffer */
2128
2162
bool dsmrr_eof; /* true <=> We have reached EOF when reading index tuples */
2138
2172
table= table_arg;
2140
2174
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
2141
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
2175
void *seq_init_param, uint n_ranges, uint mode,
2142
2176
HANDLER_BUFFER *buf);
2143
2177
void dsmrr_close();
2144
2178
int dsmrr_fill_buffer(handler *h);
2145
2179
int dsmrr_next(handler *h, char **range_info);
2147
int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
2148
uint32_t *flags, COST_VECT *cost);
2181
int dsmrr_info(uint keyno, uint n_ranges, uint keys, uint *bufsz,
2182
uint *flags, COST_VECT *cost);
2150
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
2151
void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz,
2152
uint32_t *flags, COST_VECT *cost);
2184
ha_rows dsmrr_info_const(uint keyno, RANGE_SEQ_IF *seq,
2185
void *seq_init_param, uint n_ranges, uint *bufsz,
2186
uint *flags, COST_VECT *cost);
2154
bool key_uses_partial_cols(uint32_t keyno);
2155
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
2188
bool key_uses_partial_cols(uint keyno);
2189
bool choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, uint *bufsz,
2156
2190
COST_VECT *cost);
2157
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
2158
uint32_t *buffer_size, COST_VECT *cost);
2191
bool get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags,
2192
uint *buffer_size, COST_VECT *cost);
2161
2195
extern const char *ha_row_type[];
2225
2259
/* discovery */
2226
2260
int ha_create_table_from_engine(THD* thd, const char *db, const char *name);
2227
2261
int ha_discover(THD* thd, const char* dbname, const char* name,
2228
unsigned char** frmblob, size_t* frmlen);
2262
uchar** frmblob, size_t* frmlen);
2229
2263
int ha_find_files(THD *thd,const char *db,const char *path,
2230
2264
const char *wild, bool dir, List<LEX_STRING>* files);
2231
2265
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
2269
2303
#define trans_need_2pc(thd, all) ((total_ha_2pc > 1) && \
2270
2304
!((all ? &thd->transaction.all : &thd->transaction.stmt)->no_2pc))
2306
#ifdef HAVE_NDB_BINLOG
2307
int ha_reset_logs(THD *thd);
2308
int ha_binlog_index_purge_file(THD *thd, const char *file);
2309
void ha_reset_slave(THD *thd);
2310
void ha_binlog_log_query(THD *thd, handlerton *db_type,
2311
enum_binlog_command binlog_command,
2312
const char *query, uint query_length,
2313
const char *db, const char *table_name);
2314
void ha_binlog_wait(THD *thd);
2315
int ha_binlog_end(THD *thd);
2317
#define ha_reset_logs(a) do {} while (0)
2318
#define ha_binlog_index_purge_file(a,b) do {} while (0)
2319
#define ha_reset_slave(a) do {} while (0)
2320
#define ha_binlog_log_query(a,b,c,d,e,f,g) do {} while (0)
2321
#define ha_binlog_wait(a) do {} while (0)
2322
#define ha_binlog_end(a) do {} while (0)