~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_info.c

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
/* Get information about the table */
32
32
/* if flag == 2 one get current info (no sync from database */
33
33
 
34
 
int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
 
34
int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint32_t flag)
35
35
{
36
36
  struct stat state;
37
37
  MYISAM_SHARE *share=info->s;
38
 
  DBUG_ENTER("mi_status");
39
38
 
40
39
  x->recpos  = info->lastpos;
41
40
  if (flag == HA_STATUS_POS)
42
 
    DBUG_RETURN(0);                             /* Compatible with ISAM */
 
41
    return(0);                          /* Compatible with ISAM */
43
42
  if (!(flag & HA_STATUS_NO_LOCK))
44
43
  {
45
44
    pthread_mutex_lock(&share->intern_lock);
46
 
    VOID(_mi_readinfo(info,F_RDLCK,0));
 
45
    _mi_readinfo(info,F_RDLCK,0);
47
46
    fast_mi_writeinfo(info);
48
47
    pthread_mutex_unlock(&share->intern_lock);
49
48
  }
58
57
    x->keys             = share->state.header.keys;
59
58
    x->check_time       = share->state.check_time;
60
59
    x->mean_reclength= x->records ?
61
 
      (ulong) ((x->data_file_length - x->delete_length) / x->records) :
62
 
      (ulong) share->min_pack_length;
 
60
      (uint32_t) ((x->data_file_length - x->delete_length) / x->records) :
 
61
      (uint32_t) share->min_pack_length;
63
62
  }
64
63
  if (flag & HA_STATUS_ERRKEY)
65
64
  {
95
94
    if (!x->auto_increment)                     /* This shouldn't happen */
96
95
      x->auto_increment= ~(uint64_t) 0;
97
96
  }
98
 
  DBUG_RETURN(0);
 
97
  return(0);
99
98
}
100
99
 
101
100
 
121
120
void mi_report_error(int errcode, const char *file_name)
122
121
{
123
122
  size_t        lgt;
124
 
  DBUG_ENTER("mi_report_error");
125
 
  DBUG_PRINT("enter",("errcode %d, table '%s'", errcode, file_name));
126
123
 
127
124
  if ((lgt= strlen(file_name)) > 64)
128
125
    file_name+= lgt - 64;
129
126
  my_error(errcode, MYF(ME_NOREFRESH), file_name);
130
 
  DBUG_VOID_RETURN;
 
127
  return;
131
128
}
132
129