~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
#define COMPATIBLE_DATA_NO  1
356
356
 
357
357
typedef bool (*qc_engine_callback)(THD *thd, char *table_key,
358
 
                                      uint key_length,
 
358
                                      uint32_t key_length,
359
359
                                      uint64_t *engine_data);
360
360
 
361
361
/**
417
417
           !memcmp(data, DRIZZLE_XID_PREFIX, DRIZZLE_XID_PREFIX_LEN) ?
418
418
           quick_get_my_xid() : 0;
419
419
  }
420
 
  uint length()
 
420
  uint32_t length()
421
421
  {
422
422
    return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
423
423
           gtrid_length+bqual_length;
426
426
  {
427
427
    return (unsigned char *)&gtrid_length;
428
428
  }
429
 
  uint key_length()
 
429
  uint32_t key_length()
430
430
  {
431
431
    return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
432
432
  }
445
445
typedef struct st_table_share TABLE_SHARE;
446
446
struct st_foreign_key_info;
447
447
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
448
 
typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
449
 
                             const char *file, uint file_len,
450
 
                             const char *status, uint status_len);
 
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);
451
451
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
452
452
extern st_plugin_int *hton2plugin[MAX_HA];
453
453
 
483
483
 
484
484
   slot number is initialized by MySQL after xxx_init() is called.
485
485
   */
486
 
   uint slot;
 
486
   uint32_t slot;
487
487
   /*
488
488
     to store per-savepoint data storage engine is provided with an area
489
489
     of a requested size (0 is ok here).
493
493
     area and need not be used by storage engine.
494
494
     see binlog_hton and binlog_savepoint_set/rollback for an example.
495
495
   */
496
 
   uint savepoint_offset;
 
496
   uint32_t savepoint_offset;
497
497
   /*
498
498
     handlerton methods:
499
499
 
524
524
   int  (*commit)(handlerton *hton, THD *thd, bool all);
525
525
   int  (*rollback)(handlerton *hton, THD *thd, bool all);
526
526
   int  (*prepare)(handlerton *hton, THD *thd, bool all);
527
 
   int  (*recover)(handlerton *hton, XID *xid_list, uint len);
 
527
   int  (*recover)(handlerton *hton, XID *xid_list, uint32_t len);
528
528
   int  (*commit_by_xid)(handlerton *hton, XID *xid);
529
529
   int  (*rollback_by_xid)(handlerton *hton, XID *xid);
530
530
   void *(*create_cursor_read_view)(handlerton *hton, THD *thd);
742
742
  uint32_t block_size;
743
743
  handlerton *db_type;
744
744
  enum row_type row_type;
745
 
  uint null_bits;                       /* NULL bits at start of record */
746
 
  uint options;                         /* OR of HA_CREATE_ options */
747
 
  uint extra_size;                      /* length of extra data segment */
 
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 */
748
748
  bool table_existed;                   /* 1 in create if table existed */
749
749
  bool frm_only;                        /* 1 if no ha_create_table() */
750
750
  bool varchar;                         /* 1 if table has a VARCHAR */
754
754
typedef struct st_ha_alter_information
755
755
{
756
756
  KEY  *key_info_buffer;
757
 
  uint key_count;
758
 
  uint index_drop_count;
759
 
  uint *index_drop_buffer;
760
 
  uint index_add_count;
761
 
  uint *index_add_buffer;
 
757
  uint32_t key_count;
 
758
  uint32_t index_drop_count;
 
759
  uint32_t *index_drop_buffer;
 
760
  uint32_t index_add_count;
 
761
  uint32_t *index_add_buffer;
762
762
  void *data;
763
763
} HA_ALTER_INFO;
764
764
 
792
792
  TABLEOP_HOOKS() {}
793
793
  virtual ~TABLEOP_HOOKS() {}
794
794
 
795
 
  inline void prelock(Table **tables, uint count)
 
795
  inline void prelock(Table **tables, uint32_t count)
796
796
  {
797
797
    do_prelock(tables, count);
798
798
  }
799
799
 
800
 
  inline int postlock(Table **tables, uint count)
 
800
  inline int postlock(Table **tables, uint32_t count)
801
801
  {
802
802
    return do_postlock(tables, count);
803
803
  }
804
804
private:
805
805
  /* Function primitive that is called prior to locking tables */
806
806
  virtual void do_prelock(Table **tables __attribute__((unused)),
807
 
                          uint count __attribute__((unused)))
 
807
                          uint32_t count __attribute__((unused)))
808
808
  {
809
809
    /* Default is to do nothing */
810
810
  }
818
818
     @return Error code or zero.
819
819
   */
820
820
  virtual int do_postlock(Table **tables __attribute__((unused)),
821
 
                          uint count __attribute__((unused)))
 
821
                          uint32_t count __attribute__((unused)))
822
822
  {
823
823
    return 0;                           /* Default is to do nothing */
824
824
  }
835
835
{
836
836
  st_ha_check_opt() {}                        /* Remove gcc warning */
837
837
  uint32_t sort_buffer_size;
838
 
  uint flags;       /* isam layer flags (e.g. for myisamchk) */
839
 
  uint sql_flags;   /* sql layer flags - for something myisamchk cannot do */
 
838
  uint32_t flags;       /* isam layer flags (e.g. for myisamchk) */
 
839
  uint32_t sql_flags;   /* sql layer flags - for something myisamchk cannot do */
840
840
  KEY_CACHE *key_cache; /* new key cache when changing key cache */
841
841
  void init();
842
842
} HA_CHECK_OPT;
876
876
    RETURN
877
877
      An opaque value to be used as RANGE_SEQ_IF::next() parameter
878
878
  */
879
 
  range_seq_t (*init)(void *init_params, uint n_ranges, uint flags);
 
879
  range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
880
880
 
881
881
 
882
882
  /*
891
891
      0 - Ok, the range structure filled with info about the next range
892
892
      1 - No more ranges
893
893
  */
894
 
  uint (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
 
894
  uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
895
895
} RANGE_SEQ_IF;
896
896
 
897
 
uint16_t &mrr_persistent_flag_storage(range_seq_t seq, uint idx);
898
 
char* &mrr_get_ptr_by_idx(range_seq_t seq, uint idx);
 
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);
899
899
 
900
900
class COST_VECT
901
901
1021
1021
  time_t create_time;                   /* When table was created */
1022
1022
  time_t check_time;
1023
1023
  time_t update_time;
1024
 
  uint block_size;                      /* index block size */
 
1024
  uint32_t block_size;                  /* index block size */
1025
1025
 
1026
1026
  ha_statistics():
1027
1027
    data_file_length(0), max_data_file_length(0),
1031
1031
  {}
1032
1032
};
1033
1033
 
1034
 
uint calculate_key_len(Table *, uint, const unsigned char *, key_part_map);
 
1034
uint32_t calculate_key_len(Table *, uint, const unsigned char *, key_part_map);
1035
1035
/*
1036
1036
  bitmap with first N+1 bits set
1037
1037
  (keypart_map for a key prefix of [0..N] keyparts)
1111
1111
  range_seq_t mrr_iter;    /* Interator to traverse the range sequence */
1112
1112
  RANGE_SEQ_IF mrr_funcs;  /* Range sequence traversal functions */
1113
1113
  HANDLER_BUFFER *multi_range_buffer; /* MRR buffer info */
1114
 
  uint ranges_in_seq; /* Total number of ranges in the traversed sequence */
 
1114
  uint32_t ranges_in_seq; /* Total number of ranges in the traversed sequence */
1115
1115
  /* true <=> source MRR ranges and the output are ordered */
1116
1116
  bool mrr_is_output_sorted;
1117
1117
 
1131
1131
  */
1132
1132
  bool in_range_check_pushed_down;
1133
1133
 
1134
 
  uint errkey;                          /* Last dup key */
1135
 
  uint key_used_on_scan;
1136
 
  uint active_index;
 
1134
  uint32_t errkey;                              /* Last dup key */
 
1135
  uint32_t key_used_on_scan;
 
1136
  uint32_t active_index;
1137
1137
  /** Length of ref (1-8 or the clustered key length) */
1138
 
  uint ref_length;
 
1138
  uint32_t ref_length;
1139
1139
  enum {NONE=0, INDEX, RND} inited;
1140
1140
  bool locked;
1141
1141
  bool implicit_emptied;                /* Can be !=0 only if HEAP */
1142
1142
  const Item *pushed_cond;
1143
1143
 
1144
1144
  Item *pushed_idx_cond;
1145
 
  uint pushed_idx_cond_keyno;  /* The index which the above condition is for */
 
1145
  uint32_t pushed_idx_cond_keyno;  /* The index which the above condition is for */
1146
1146
 
1147
1147
  /**
1148
1148
    next_insert_id is the next value which should be inserted into the
1192
1192
  /* ha_ methods: pubilc wrappers for private virtual API */
1193
1193
 
1194
1194
  int ha_open(Table *table, const char *name, int mode, int test_if_locked);
1195
 
  int ha_index_init(uint idx, bool sorted)
 
1195
  int ha_index_init(uint32_t idx, bool sorted)
1196
1196
  {
1197
1197
    int result;
1198
1198
    assert(inited==NONE);
1255
1255
    return end_bulk_insert();
1256
1256
  }
1257
1257
  int ha_bulk_update_row(const unsigned char *old_data, unsigned char *new_data,
1258
 
                         uint *dup_key_found);
 
1258
                         uint32_t *dup_key_found);
1259
1259
  int ha_delete_all_rows();
1260
1260
  int ha_reset_auto_increment(uint64_t value);
1261
1261
  int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
1262
1262
  int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
1263
1263
  bool ha_check_and_repair(THD *thd);
1264
 
  int ha_disable_indexes(uint mode);
1265
 
  int ha_enable_indexes(uint mode);
 
1264
  int ha_disable_indexes(uint32_t mode);
 
1265
  int ha_enable_indexes(uint32_t mode);
1266
1266
  int ha_discard_or_import_tablespace(bool discard);
1267
1267
  void ha_prepare_for_alter();
1268
1268
  int ha_rename_table(const char *from, const char *to);
1276
1276
 
1277
1277
  void adjust_next_insert_id_after_explicit_value(uint64_t nr);
1278
1278
  int update_auto_increment();
1279
 
  void print_keydup_error(uint key_nr, const char *msg);
 
1279
  void print_keydup_error(uint32_t key_nr, const char *msg);
1280
1280
  virtual void print_error(int error, myf errflag);
1281
1281
  virtual bool get_error_message(int error, String *buf);
1282
 
  uint get_dup_key(int error);
 
1282
  uint32_t get_dup_key(int error);
1283
1283
  virtual void change_table_ptr(Table *table_arg, TABLE_SHARE *share)
1284
1284
  {
1285
1285
    table= table_arg;
1288
1288
  /* Estimates calculation */
1289
1289
  virtual double scan_time(void)
1290
1290
  { return uint64_t2double(stats.data_file_length) / IO_SIZE + 2; }
1291
 
  virtual double read_time(uint index __attribute__((unused)),
1292
 
                           uint ranges, ha_rows rows)
 
1291
  virtual double read_time(uint32_t index __attribute__((unused)),
 
1292
                           uint32_t ranges, ha_rows rows)
1293
1293
  { return rows2double(ranges+rows); }
1294
1294
 
1295
 
  virtual double index_only_read_time(uint keynr, double records);
 
1295
  virtual double index_only_read_time(uint32_t keynr, double records);
1296
1296
  
1297
 
  virtual ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
 
1297
  virtual ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1298
1298
                                              void *seq_init_param, 
1299
 
                                              uint n_ranges, uint *bufsz,
1300
 
                                              uint *flags, COST_VECT *cost);
1301
 
  virtual int multi_range_read_info(uint keyno, uint n_ranges, uint keys,
1302
 
                                    uint *bufsz, uint *flags, COST_VECT *cost);
 
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);
1303
1303
  virtual int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
1304
 
                                    uint n_ranges, uint mode,
 
1304
                                    uint32_t n_ranges, uint32_t mode,
1305
1305
                                    HANDLER_BUFFER *buf);
1306
1306
  virtual int multi_range_read_next(char **range_info);
1307
1307
 
1309
1309
  virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; }
1310
1310
  bool has_transactions()
1311
1311
  { return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; }
1312
 
  virtual uint extra_rec_buf_length() const { return 0; }
 
1312
  virtual uint32_t extra_rec_buf_length() const { return 0; }
1313
1313
 
1314
1314
  /**
1315
1315
    This method is used to analyse the error to see whether the error
1321
1321
    same thing as HA_ERR_FOUND_DUP_KEY but can in some cases lead to
1322
1322
    a slightly different error message.
1323
1323
  */
1324
 
  virtual bool is_fatal_error(int error, uint flags)
 
1324
  virtual bool is_fatal_error(int error, uint32_t flags)
1325
1325
  {
1326
1326
    if (!error ||
1327
1327
        ((flags & HA_CHECK_DUP_KEY) &&
1351
1351
  */
1352
1352
  virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; }
1353
1353
 
1354
 
  virtual const char *index_type(uint key_number __attribute__((unused)))
 
1354
  virtual const char *index_type(uint32_t key_number __attribute__((unused)))
1355
1355
  { assert(0); return "";}
1356
1356
 
1357
1357
 
1363
1363
    as there may be several calls to this routine.
1364
1364
  */
1365
1365
  virtual void column_bitmaps_signal();
1366
 
  uint get_index(void) const { return active_index; }
 
1366
  uint32_t get_index(void) const { return active_index; }
1367
1367
  virtual int close(void)=0;
1368
1368
 
1369
1369
  /**
1387
1387
    @retval  0           Success
1388
1388
    @retval  >0          Error code
1389
1389
  */
1390
 
  virtual int exec_bulk_update(uint *dup_key_found __attribute__((unused)))
 
1390
  virtual int exec_bulk_update(uint32_t *dup_key_found __attribute__((unused)))
1391
1391
  {
1392
1392
    assert(false);
1393
1393
    return HA_ERR_WRONG_COMMAND;
1418
1418
                             key_part_map keypart_map,
1419
1419
                             enum ha_rkey_function find_flag)
1420
1420
  {
1421
 
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
 
1421
    uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
1422
1422
    return  index_read(buf, key, key_len, find_flag);
1423
1423
  }
1424
1424
  /**
1427
1427
     row if available. If the key value is null, begin at the first key of the
1428
1428
     index.
1429
1429
  */
1430
 
  virtual int index_read_idx_map(unsigned char * buf, uint index, const unsigned char * key,
 
1430
  virtual int index_read_idx_map(unsigned char * buf, uint32_t index, const unsigned char * key,
1431
1431
                                 key_part_map keypart_map,
1432
1432
                                 enum ha_rkey_function find_flag);
1433
1433
  virtual int index_next(unsigned char * buf __attribute__((unused)))
1440
1440
   { return  HA_ERR_WRONG_COMMAND; }
1441
1441
  virtual int index_next_same(unsigned char *buf __attribute__((unused)),
1442
1442
                              const unsigned char *key __attribute__((unused)),
1443
 
                              uint keylen __attribute__((unused)));
 
1443
                              uint32_t keylen __attribute__((unused)));
1444
1444
  /**
1445
1445
     @brief
1446
1446
     The following functions works like index_read, but it find the last
1449
1449
  virtual int index_read_last_map(unsigned char * buf, const unsigned char * key,
1450
1450
                                  key_part_map keypart_map)
1451
1451
  {
1452
 
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
 
1452
    uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
1453
1453
    return index_read_last(buf, key, key_len);
1454
1454
  }
1455
1455
  virtual int read_range_first(const key_range *start_key,
1468
1468
    handlers for random position.
1469
1469
  */
1470
1470
  virtual int rnd_pos_by_record(unsigned char *record);
1471
 
  virtual int read_first_row(unsigned char *buf, uint primary_key);
 
1471
  virtual int read_first_row(unsigned char *buf, uint32_t primary_key);
1472
1472
  /**
1473
1473
    The following function is only needed for tables that may be temporary
1474
1474
    tables during joins.
1477
1477
                               unsigned char *pos __attribute__((unused)))
1478
1478
    { return HA_ERR_WRONG_COMMAND; }
1479
1479
  virtual int rnd_same(unsigned char *buf __attribute__((unused)),
1480
 
                       uint inx __attribute__((unused)))
 
1480
                       uint32_t inx __attribute__((unused)))
1481
1481
    { return HA_ERR_WRONG_COMMAND; }
1482
 
  virtual ha_rows records_in_range(uint inx __attribute__((unused)),
 
1482
  virtual ha_rows records_in_range(uint32_t inx __attribute__((unused)),
1483
1483
                                   key_range *min_key __attribute__((unused)),
1484
1484
                                   key_range *max_key __attribute__((unused)))
1485
1485
    { return (ha_rows) 10; }
1563
1563
    @retval   true            Foreign key defined on table or index
1564
1564
    @retval   false           No foreign key defined
1565
1565
  */
1566
 
  virtual bool is_fk_defined_on_table_or_index(uint index __attribute__((unused)))
 
1566
  virtual bool is_fk_defined_on_table_or_index(uint32_t index __attribute__((unused)))
1567
1567
  { return false; }
1568
1568
  virtual char* get_foreign_key_create_info(void)
1569
1569
  { return(NULL);}  /* gets foreign key create string from InnoDB */
1573
1573
  virtual int get_foreign_key_list(THD *thd __attribute__((unused)),
1574
1574
                                   List<FOREIGN_KEY_INFO> *f_key_list __attribute__((unused)))
1575
1575
  { return 0; }
1576
 
  virtual uint referenced_by_foreign_key() { return 0;}
 
1576
  virtual uint32_t referenced_by_foreign_key() { return 0;}
1577
1577
  virtual void init_table_handle_for_HANDLER()
1578
1578
  { return; }       /* prepare InnoDB for HANDLER */
1579
1579
  virtual void free_foreign_key_create_info(char* str __attribute__((unused))) {}
1594
1594
 
1595
1595
  virtual int get_default_no_partitions(HA_CREATE_INFO *info __attribute__((unused))) { return 1;}
1596
1596
  virtual bool get_no_parts(const char *name __attribute__((unused)),
1597
 
                            uint *no_parts)
 
1597
                            uint32_t *no_parts)
1598
1598
  {
1599
1599
    *no_parts= 0;
1600
1600
    return 0;
1601
1601
  }
1602
1602
 
1603
 
  virtual uint32_t index_flags(uint idx, uint part, bool all_parts) const =0;
 
1603
  virtual uint32_t index_flags(uint32_t idx, uint32_t part, bool all_parts) const =0;
1604
1604
 
1605
1605
  virtual int add_index(Table *table_arg __attribute__((unused)),
1606
1606
                        KEY *key_info __attribute__((unused)),
1607
 
                        uint num_of_keys __attribute__((unused)))
 
1607
                        uint32_t num_of_keys __attribute__((unused)))
1608
1608
  { return (HA_ERR_WRONG_COMMAND); }
1609
1609
  virtual int prepare_drop_index(Table *table_arg __attribute__((unused)),
1610
 
                                 uint *key_num __attribute__((unused)),
1611
 
                                 uint num_of_keys __attribute__((unused)))
 
1610
                                 uint32_t *key_num __attribute__((unused)),
 
1611
                                 uint32_t num_of_keys __attribute__((unused)))
1612
1612
  { return (HA_ERR_WRONG_COMMAND); }
1613
1613
  virtual int final_drop_index(Table *table_arg __attribute__((unused)))
1614
1614
  { return (HA_ERR_WRONG_COMMAND); }
1615
1615
 
1616
 
  uint max_record_length() const
 
1616
  uint32_t max_record_length() const
1617
1617
  { return cmin((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); }
1618
 
  uint max_keys() const
 
1618
  uint32_t max_keys() const
1619
1619
  { return cmin((unsigned int)MAX_KEY, max_supported_keys()); }
1620
 
  uint max_key_parts() const
 
1620
  uint32_t max_key_parts() const
1621
1621
  { return cmin((unsigned int)MAX_REF_PARTS, max_supported_key_parts()); }
1622
 
  uint max_key_length() const
 
1622
  uint32_t max_key_length() const
1623
1623
  { return cmin((unsigned int)MAX_KEY_LENGTH, max_supported_key_length()); }
1624
 
  uint max_key_part_length(void) const
 
1624
  uint32_t max_key_part_length(void) const
1625
1625
  { return cmin((unsigned int)MAX_KEY_LENGTH, max_supported_key_part_length()); }
1626
1626
 
1627
 
  virtual uint max_supported_record_length(void) const
 
1627
  virtual uint32_t max_supported_record_length(void) const
1628
1628
  { return HA_MAX_REC_LENGTH; }
1629
 
  virtual uint max_supported_keys(void) const { return 0; }
1630
 
  virtual uint max_supported_key_parts(void) const { return MAX_REF_PARTS; }
1631
 
  virtual uint max_supported_key_length(void) const { return MAX_KEY_LENGTH; }
1632
 
  virtual uint max_supported_key_part_length(void) const { return 255; }
1633
 
  virtual uint min_record_length(uint options __attribute__((unused))) const
 
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
1634
1634
  { return 1; }
1635
1635
 
1636
1636
  virtual bool low_byte_first(void) const { return 1; }
1637
 
  virtual uint checksum(void) const { return 0; }
 
1637
  virtual uint32_t checksum(void) const { return 0; }
1638
1638
  virtual bool is_crashed(void) const  { return 0; }
1639
1639
  virtual bool auto_repair(void) const { return 0; }
1640
1640
 
1647
1647
  /**
1648
1648
    @note lock_count() can return > 1 if the table is MERGE or partitioned.
1649
1649
  */
1650
 
  virtual uint lock_count(void) const { return 1; }
 
1650
  virtual uint32_t lock_count(void) const { return 1; }
1651
1651
  /**
1652
1652
    Is not invoked for non-transactional temporary tables.
1653
1653
 
1702
1702
  virtual bool
1703
1703
    register_query_cache_table(THD *thd __attribute__((unused)),
1704
1704
                               char *table_key __attribute__((unused)),
1705
 
                               uint key_length __attribute__((unused)),
 
1705
                               uint32_t key_length __attribute__((unused)),
1706
1706
                               qc_engine_callback *engine_callback,
1707
1707
                               uint64_t *engine_data __attribute__((unused)))
1708
1708
  {
1758
1758
 virtual void cond_pop(void) { return; }
1759
1759
 
1760
1760
 virtual Item
1761
 
   *idx_cond_push(uint keyno __attribute__((unused)),
 
1761
   *idx_cond_push(uint32_t keyno __attribute__((unused)),
1762
1762
                  Item* idx_cond __attribute__((unused)))
1763
1763
 { return idx_cond; }
1764
1764
 
1767
1767
  */
1768
1768
 virtual bool
1769
1769
   check_if_incompatible_data(HA_CREATE_INFO *create_info __attribute__((unused)),
1770
 
                              uint table_changes __attribute__((unused)))
 
1770
                              uint32_t table_changes __attribute__((unused)))
1771
1771
 { return COMPATIBLE_DATA_NO; }
1772
1772
 
1773
1773
 /* On-line ALTER Table interface */
1799
1799
   check_if_supported_alter(Table *altered_table __attribute__((unused)),
1800
1800
                            HA_CREATE_INFO *create_info,
1801
1801
                            HA_ALTER_FLAGS *alter_flags __attribute__((unused)),
1802
 
                            uint table_changes)
 
1802
                            uint32_t table_changes)
1803
1803
 {
1804
1804
   if (this->check_if_incompatible_data(create_info, table_changes)
1805
1805
       == COMPATIBLE_DATA_NO)
1935
1935
    the corresponding 'ha_*' method above.
1936
1936
  */
1937
1937
 
1938
 
  virtual int open(const char *name, int mode, uint test_if_locked)=0;
1939
 
  virtual int index_init(uint idx,
 
1938
  virtual int open(const char *name, int mode, uint32_t test_if_locked)=0;
 
1939
  virtual int index_init(uint32_t idx,
1940
1940
                         bool sorted __attribute__((unused)))
1941
1941
  { active_index= idx; return 0; }
1942
1942
  virtual int index_end() { active_index= MAX_KEY; return 0; }
2020
2020
  virtual int end_bulk_insert(void) { return 0; }
2021
2021
  virtual int index_read(unsigned char * buf __attribute__((unused)),
2022
2022
                         const unsigned char * key __attribute__((unused)),
2023
 
                         uint key_len __attribute__((unused)),
 
2023
                         uint32_t key_len __attribute__((unused)),
2024
2024
                         enum ha_rkey_function find_flag __attribute__((unused)))
2025
2025
   { return  HA_ERR_WRONG_COMMAND; }
2026
2026
  virtual int index_read_last(unsigned char * buf __attribute__((unused)),
2027
2027
                              const unsigned char * key __attribute__((unused)),
2028
 
                              uint key_len __attribute__((unused)))
 
2028
                              uint32_t key_len __attribute__((unused)))
2029
2029
   { return (my_errno= HA_ERR_WRONG_COMMAND); }
2030
2030
  /**
2031
2031
    This method is similar to update_row, however the handler doesn't need
2042
2042
  */
2043
2043
  virtual int bulk_update_row(const unsigned char *old_data __attribute__((unused)),
2044
2044
                              unsigned char *new_data __attribute__((unused)),
2045
 
                              uint *dup_key_found __attribute__((unused)))
 
2045
                              uint32_t *dup_key_found __attribute__((unused)))
2046
2046
  {
2047
2047
    assert(false);
2048
2048
    return HA_ERR_WRONG_COMMAND;
2071
2071
  { return HA_ADMIN_NOT_IMPLEMENTED; }
2072
2072
  virtual bool check_and_repair(THD *thd __attribute__((unused)))
2073
2073
  { return true; }
2074
 
  virtual int disable_indexes(uint mode __attribute__((unused)))
 
2074
  virtual int disable_indexes(uint32_t mode __attribute__((unused)))
2075
2075
  { return HA_ERR_WRONG_COMMAND; }
2076
 
  virtual int enable_indexes(uint mode __attribute__((unused)))
 
2076
  virtual int enable_indexes(uint32_t mode __attribute__((unused)))
2077
2077
  { return HA_ERR_WRONG_COMMAND; }
2078
2078
  virtual int discard_or_import_tablespace(bool discard __attribute__((unused)))
2079
2079
  { return (my_errno=HA_ERR_WRONG_COMMAND); }
2138
2138
    table= table_arg;
2139
2139
  }
2140
2140
  int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs, 
2141
 
                 void *seq_init_param, uint n_ranges, uint mode, 
 
2141
                 void *seq_init_param, uint32_t n_ranges, uint32_t mode, 
2142
2142
                 HANDLER_BUFFER *buf);
2143
2143
  void dsmrr_close();
2144
2144
  int dsmrr_fill_buffer(handler *h);
2145
2145
  int dsmrr_next(handler *h, char **range_info);
2146
2146
 
2147
 
  int dsmrr_info(uint keyno, uint n_ranges, uint keys, uint *bufsz,
2148
 
                 uint *flags, COST_VECT *cost);
 
2147
  int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
 
2148
                 uint32_t *flags, COST_VECT *cost);
2149
2149
 
2150
 
  ha_rows dsmrr_info_const(uint keyno, RANGE_SEQ_IF *seq, 
2151
 
                            void *seq_init_param, uint n_ranges, uint *bufsz,
2152
 
                            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);
2153
2153
private:
2154
 
  bool key_uses_partial_cols(uint keyno);
2155
 
  bool choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, uint *bufsz, 
 
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, 
2156
2156
                       COST_VECT *cost);
2157
 
  bool get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags, 
2158
 
                               uint *buffer_size, 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);
2159
2159
};
2160
2160
 
2161
2161
extern const char *ha_row_type[];