~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_info.c

  • Committer: Brian Aker
  • Date: 2008-07-15 06:45:16 UTC
  • Revision ID: brian@tangent.org-20080715064516-fnbq7kowh7w57bxj
Merge Monty's code.

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