~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.cc

  • 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:
60
60
{
61
61
  THD* thd = (THD*)param->thd;
62
62
  Protocol *protocol= thd->protocol;
63
 
  uint length, msg_length;
 
63
  uint32_t length, msg_length;
64
64
  char msgbuf[MI_MAX_MSG_BUF];
65
65
  char name[NAME_LEN*2+2];
66
66
 
126
126
*/
127
127
 
128
128
int table2myisam(Table *table_arg, MI_KEYDEF **keydef_out,
129
 
                 MI_COLUMNDEF **recinfo_out, uint *records_out)
 
129
                 MI_COLUMNDEF **recinfo_out, uint32_t *records_out)
130
130
{
131
 
  uint i, j, recpos, minpos, fieldpos, temp_length, length;
 
131
  uint32_t i, j, recpos, minpos, fieldpos, temp_length, length;
132
132
  enum ha_base_keytype type= HA_KEYTYPE_BINARY;
133
133
  unsigned char *record;
134
134
  KEY *pos;
136
136
  MI_COLUMNDEF *recinfo, *recinfo_pos;
137
137
  HA_KEYSEG *keyseg;
138
138
  TABLE_SHARE *share= table_arg->s;
139
 
  uint options= share->db_options_in_use;
 
139
  uint32_t options= share->db_options_in_use;
140
140
  if (!(my_multi_malloc(MYF(MY_WME),
141
141
          recinfo_out, (share->fields * 2 + 2) * sizeof(MI_COLUMNDEF),
142
142
          keydef_out, share->keys * sizeof(MI_KEYDEF),
314
314
*/
315
315
 
316
316
int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
317
 
                     uint t1_keys, uint t1_recs,
 
317
                     uint32_t t1_keys, uint32_t t1_recs,
318
318
                     MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo,
319
 
                     uint t2_keys, uint t2_recs, bool strict)
 
319
                     uint32_t t2_keys, uint32_t t2_recs, bool strict)
320
320
{
321
 
  uint i, j;
 
321
  uint32_t i, j;
322
322
  if ((strict ? t1_keys != t2_keys : t1_keys > t2_keys))
323
323
  {
324
324
    return(1);
440
440
*/
441
441
 
442
442
void _mi_report_crashed(MI_INFO *file, const char *message,
443
 
                        const char *sfile, uint sline)
 
443
                        const char *sfile, uint32_t sline)
444
444
{
445
445
  THD *cur_thd;
446
446
  LIST *element;
499
499
}
500
500
 
501
501
 
502
 
const char *ha_myisam::index_type(uint key_number __attribute__((unused)))
 
502
const char *ha_myisam::index_type(uint32_t key_number __attribute__((unused)))
503
503
{
504
504
  return "BTREE";
505
505
}
506
506
 
507
507
/* Name is here without an extension */
508
 
int ha_myisam::open(const char *name, int mode, uint test_if_locked)
 
508
int ha_myisam::open(const char *name, int mode, uint32_t test_if_locked)
509
509
{
510
510
  MI_KEYDEF *keyinfo;
511
511
  MI_COLUMNDEF *recinfo= 0;
512
 
  uint recs;
513
 
  uint i;
 
512
  uint32_t recs;
 
513
  uint32_t i;
514
514
 
515
515
  /*
516
516
    If the user wants to have memory mapped data files, add an
661
661
          (param.testflag & (T_EXTEND | T_MEDIUM)))) ||
662
662
        mi_is_crashed(file))
663
663
    {
664
 
      uint old_testflag=param.testflag;
 
664
      uint32_t old_testflag=param.testflag;
665
665
      param.testflag|=T_MEDIUM;
666
666
      if (!(error= init_io_cache(&param.read_cache, file->dfile,
667
667
                                 my_default_record_cache_size, READ_CACHE,
818
818
int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
819
819
{
820
820
  int error=0;
821
 
  uint local_testflag=param.testflag;
 
821
  uint32_t local_testflag=param.testflag;
822
822
  bool optimize_done= !do_optimize, statistics_done=0;
823
823
  const char *old_proc_info= thd->get_proc_info();
824
824
  char fixed_name[FN_REFLEN];
866
866
    uint64_t key_map= ((local_testflag & T_CREATE_MISSING_KEYS) ?
867
867
                        mi_get_mask_all_keys_active(share->base.keys) :
868
868
                        share->state.key_map);
869
 
    uint testflag=param.testflag;
 
869
    uint32_t testflag=param.testflag;
870
870
    if (mi_test_if_sort_rep(file,file->state->records,key_map,0) &&
871
871
        (local_testflag & T_REP_BY_SORT))
872
872
    {
1034
1034
    HA_ERR_WRONG_COMMAND  mode not implemented.
1035
1035
*/
1036
1036
 
1037
 
int ha_myisam::disable_indexes(uint mode)
 
1037
int ha_myisam::disable_indexes(uint32_t mode)
1038
1038
{
1039
1039
  int error;
1040
1040
 
1086
1086
    HA_ERR_WRONG_COMMAND  mode not implemented.
1087
1087
*/
1088
1088
 
1089
 
int ha_myisam::enable_indexes(uint mode)
 
1089
int ha_myisam::enable_indexes(uint32_t mode)
1090
1090
{
1091
1091
  int error;
1092
1092
 
1241
1241
  int error=0;
1242
1242
  int marked_crashed;
1243
1243
  char *old_query;
1244
 
  uint old_query_length;
 
1244
  uint32_t old_query_length;
1245
1245
  HA_CHECK_OPT check_opt;
1246
1246
 
1247
1247
  check_opt.init();
1317
1317
#endif
1318
1318
 
1319
1319
 
1320
 
int ha_myisam::index_init(uint idx, bool sorted __attribute__((unused)))
 
1320
int ha_myisam::index_init(uint32_t idx, bool sorted __attribute__((unused)))
1321
1321
1322
1322
  active_index=idx;
1323
1323
  //in_range_read= false;
1349
1349
  return error;
1350
1350
}
1351
1351
 
1352
 
int ha_myisam::index_read_idx_map(unsigned char *buf, uint index, const unsigned char *key,
 
1352
int ha_myisam::index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
1353
1353
                                  key_part_map keypart_map,
1354
1354
                                  enum ha_rkey_function find_flag)
1355
1355
{
1408
1408
 
1409
1409
int ha_myisam::index_next_same(unsigned char *buf,
1410
1410
                               const unsigned char *key __attribute__((unused)),
1411
 
                               uint length __attribute__((unused)))
 
1411
                               uint32_t length __attribute__((unused)))
1412
1412
{
1413
1413
  int error;
1414
1414
  assert(inited==INDEX);
1482
1482
  my_store_ptr(ref, ref_length, row_position);
1483
1483
}
1484
1484
 
1485
 
int ha_myisam::info(uint flag)
 
1485
int ha_myisam::info(uint32_t flag)
1486
1486
{
1487
1487
  MI_ISAMINFO misam_info;
1488
1488
  char name_buff[FN_REFLEN];
1616
1616
                      HA_CREATE_INFO *ha_create_info)
1617
1617
{
1618
1618
  int error;
1619
 
  uint create_flags= 0, records;
 
1619
  uint32_t create_flags= 0, records;
1620
1620
  char buff[FN_REFLEN];
1621
1621
  MI_KEYDEF *keydef;
1622
1622
  MI_COLUMNDEF *recinfo;
1623
1623
  MI_CREATE_INFO create_info;
1624
1624
  TABLE_SHARE *share= table_arg->s;
1625
 
  uint options= share->db_options_in_use;
 
1625
  uint32_t options= share->db_options_in_use;
1626
1626
  if ((error= table2myisam(table_arg, &keydef, &recinfo, &records)))
1627
1627
    return(error); /* purecov: inspected */
1628
1628
  memset(&create_info, 0, sizeof(create_info));
1741
1741
                        the range.
1742
1742
*/
1743
1743
 
1744
 
ha_rows ha_myisam::records_in_range(uint inx, key_range *min_key,
 
1744
ha_rows ha_myisam::records_in_range(uint32_t inx, key_range *min_key,
1745
1745
                                    key_range *max_key)
1746
1746
{
1747
1747
  return (ha_rows) mi_records_in_range(file, (int) inx, min_key, max_key);
1748
1748
}
1749
1749
 
1750
1750
 
1751
 
uint ha_myisam::checksum() const
 
1751
uint32_t ha_myisam::checksum() const
1752
1752
{
1753
1753
  return (uint)file->state->checksum;
1754
1754
}
1755
1755
 
1756
1756
 
1757
1757
bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *info,
1758
 
                                           uint table_changes)
 
1758
                                           uint32_t table_changes)
1759
1759
{
1760
 
  uint options= table->s->db_options_in_use;
 
1760
  uint32_t options= table->s->db_options_in_use;
1761
1761
 
1762
1762
  if (info->auto_increment_value != stats.auto_increment_value ||
1763
1763
      info->data_file_name != data_file_name ||
1797
1797
 ***************************************************************************/
1798
1798
 
1799
1799
int ha_myisam::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
1800
 
                                     uint n_ranges, uint mode, 
 
1800
                                     uint32_t n_ranges, uint32_t mode, 
1801
1801
                                     HANDLER_BUFFER *buf)
1802
1802
{
1803
1803
  return ds_mrr.dsmrr_init(this, &table->key_info[active_index], 
1809
1809
  return ds_mrr.dsmrr_next(this, range_info);
1810
1810
}
1811
1811
 
1812
 
ha_rows ha_myisam::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
 
1812
ha_rows ha_myisam::multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1813
1813
                                               void *seq_init_param, 
1814
 
                                               uint n_ranges, uint *bufsz,
1815
 
                                               uint *flags, COST_VECT *cost)
 
1814
                                               uint32_t n_ranges, uint32_t *bufsz,
 
1815
                                               uint32_t *flags, COST_VECT *cost)
1816
1816
{
1817
1817
  /*
1818
1818
    This call is here because there is no location where this->table would
1824
1824
                                 flags, cost);
1825
1825
}
1826
1826
 
1827
 
int ha_myisam::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
1828
 
                                     uint *bufsz, uint *flags, COST_VECT *cost)
 
1827
int ha_myisam::multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
 
1828
                                     uint32_t *bufsz, uint32_t *flags, COST_VECT *cost)
1829
1829
{
1830
1830
  ds_mrr.init(this, table);
1831
1831
  return ds_mrr.dsmrr_info(keyno, n_ranges, keys, bufsz, flags, cost);
1837
1837
/* Index condition pushdown implementation*/
1838
1838
 
1839
1839
 
1840
 
Item *ha_myisam::idx_cond_push(uint keyno_arg, Item* idx_cond_arg)
 
1840
Item *ha_myisam::idx_cond_push(uint32_t keyno_arg, Item* idx_cond_arg)
1841
1841
{
1842
1842
  pushed_idx_cond_keyno= keyno_arg;
1843
1843
  pushed_idx_cond= idx_cond_arg;