~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
 
102
102
  int doRenameTable(Session*, const char *from, const char *to);
103
103
 
104
 
  int doDropTable(Session&, const string table_name);
 
104
  int doDropTable(Session&, const string &table_name);
105
105
 
106
106
  int doGetTableDefinition(Session& session,
107
107
                           const char* path,
633
633
 
634
634
int ha_myisam::write_row(unsigned char *buf)
635
635
{
636
 
  ha_statistic_increment(&SSV::ha_write_count);
 
636
  ha_statistic_increment(&system_status_var::ha_write_count);
637
637
 
638
638
  /*
639
639
    If we have an auto_increment column and we are writing a changed row
1024
1024
 
1025
1025
int ha_myisam::update_row(const unsigned char *old_data, unsigned char *new_data)
1026
1026
{
1027
 
  ha_statistic_increment(&SSV::ha_update_count);
 
1027
  ha_statistic_increment(&system_status_var::ha_update_count);
1028
1028
  if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
1029
1029
    table->timestamp_field->set_time();
1030
1030
  return mi_update(file,old_data,new_data);
1032
1032
 
1033
1033
int ha_myisam::delete_row(const unsigned char *buf)
1034
1034
{
1035
 
  ha_statistic_increment(&SSV::ha_delete_count);
 
1035
  ha_statistic_increment(&system_status_var::ha_delete_count);
1036
1036
  return mi_delete(file,buf);
1037
1037
}
1038
1038
 
1057
1057
                              enum ha_rkey_function find_flag)
1058
1058
{
1059
1059
  assert(inited==INDEX);
1060
 
  ha_statistic_increment(&SSV::ha_read_key_count);
 
1060
  ha_statistic_increment(&system_status_var::ha_read_key_count);
1061
1061
  int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag);
1062
1062
  table->status=error ? STATUS_NOT_FOUND: 0;
1063
1063
  return error;
1067
1067
                                  key_part_map keypart_map,
1068
1068
                                  enum ha_rkey_function find_flag)
1069
1069
{
1070
 
  ha_statistic_increment(&SSV::ha_read_key_count);
 
1070
  ha_statistic_increment(&system_status_var::ha_read_key_count);
1071
1071
  int error=mi_rkey(file, buf, index, key, keypart_map, find_flag);
1072
1072
  table->status=error ? STATUS_NOT_FOUND: 0;
1073
1073
  return error;
1077
1077
                                   key_part_map keypart_map)
1078
1078
{
1079
1079
  assert(inited==INDEX);
1080
 
  ha_statistic_increment(&SSV::ha_read_key_count);
 
1080
  ha_statistic_increment(&system_status_var::ha_read_key_count);
1081
1081
  int error=mi_rkey(file, buf, active_index, key, keypart_map,
1082
1082
                    HA_READ_PREFIX_LAST);
1083
1083
  table->status=error ? STATUS_NOT_FOUND: 0;
1087
1087
int ha_myisam::index_next(unsigned char *buf)
1088
1088
{
1089
1089
  assert(inited==INDEX);
1090
 
  ha_statistic_increment(&SSV::ha_read_next_count);
 
1090
  ha_statistic_increment(&system_status_var::ha_read_next_count);
1091
1091
  int error=mi_rnext(file,buf,active_index);
1092
1092
  table->status=error ? STATUS_NOT_FOUND: 0;
1093
1093
  return error;
1096
1096
int ha_myisam::index_prev(unsigned char *buf)
1097
1097
{
1098
1098
  assert(inited==INDEX);
1099
 
  ha_statistic_increment(&SSV::ha_read_prev_count);
 
1099
  ha_statistic_increment(&system_status_var::ha_read_prev_count);
1100
1100
  int error=mi_rprev(file,buf, active_index);
1101
1101
  table->status=error ? STATUS_NOT_FOUND: 0;
1102
1102
  return error;
1105
1105
int ha_myisam::index_first(unsigned char *buf)
1106
1106
{
1107
1107
  assert(inited==INDEX);
1108
 
  ha_statistic_increment(&SSV::ha_read_first_count);
 
1108
  ha_statistic_increment(&system_status_var::ha_read_first_count);
1109
1109
  int error=mi_rfirst(file, buf, active_index);
1110
1110
  table->status=error ? STATUS_NOT_FOUND: 0;
1111
1111
  return error;
1114
1114
int ha_myisam::index_last(unsigned char *buf)
1115
1115
{
1116
1116
  assert(inited==INDEX);
1117
 
  ha_statistic_increment(&SSV::ha_read_last_count);
 
1117
  ha_statistic_increment(&system_status_var::ha_read_last_count);
1118
1118
  int error=mi_rlast(file, buf, active_index);
1119
1119
  table->status=error ? STATUS_NOT_FOUND: 0;
1120
1120
  return error;
1126
1126
{
1127
1127
  int error;
1128
1128
  assert(inited==INDEX);
1129
 
  ha_statistic_increment(&SSV::ha_read_next_count);
 
1129
  ha_statistic_increment(&system_status_var::ha_read_next_count);
1130
1130
  do
1131
1131
  {
1132
1132
    error= mi_rnext_same(file,buf);
1170
1170
 
1171
1171
int ha_myisam::rnd_next(unsigned char *buf)
1172
1172
{
1173
 
  ha_statistic_increment(&SSV::ha_read_rnd_next_count);
 
1173
  ha_statistic_increment(&system_status_var::ha_read_rnd_next_count);
1174
1174
  int error=mi_scan(file, buf);
1175
1175
  table->status=error ? STATUS_NOT_FOUND: 0;
1176
1176
  return error;
1183
1183
 
1184
1184
int ha_myisam::rnd_pos(unsigned char *buf, unsigned char *pos)
1185
1185
{
1186
 
  ha_statistic_increment(&SSV::ha_read_rnd_count);
 
1186
  ha_statistic_increment(&system_status_var::ha_read_rnd_count);
1187
1187
  int error=mi_rrnd(file, buf, internal::my_get_ptr(pos,ref_length));
1188
1188
  table->status=error ? STATUS_NOT_FOUND: 0;
1189
1189
  return error;
1223
1223
    stats.block_size= myisam_key_cache_block_size;        /* record block size */
1224
1224
 
1225
1225
    /* Update share */
1226
 
    if (share->tmp_table == NO_TMP_TABLE)
 
1226
    if (share->tmp_table == STANDARD_TABLE)
1227
1227
      pthread_mutex_lock(&share->mutex);
1228
1228
    set_prefix(share->keys_in_use, share->keys);
1229
1229
    /*
1277
1277
      memcpy(table->key_info[0].rec_per_key,
1278
1278
             misam_info.rec_per_key,
1279
1279
             sizeof(table->key_info[0].rec_per_key)*share->key_parts);
1280
 
    if (share->tmp_table == NO_TMP_TABLE)
 
1280
    if (share->tmp_table == STANDARD_TABLE)
1281
1281
      pthread_mutex_unlock(&share->mutex);
1282
1282
 
1283
1283
   /*
1330
1330
  return mi_delete_all_rows(file);
1331
1331
}
1332
1332
 
1333
 
int MyisamEngine::doDropTable(Session&, const string table_path)
 
1333
int MyisamEngine::doDropTable(Session&, const string &table_path)
1334
1334
{
1335
1335
  ProtoCache::iterator iter;
1336
1336
 
1722
1722
  PLUGIN_LICENSE_GPL,
1723
1723
  myisam_init, /* Plugin Init */
1724
1724
  myisam_deinit, /* Plugin Deinit */
1725
 
  NULL,                       /* status variables                */
1726
1725
  sys_variables,           /* system variables */
1727
1726
  NULL                        /* config options                  */
1728
1727
}