~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_statrec.c

  • Committer: Monty Taylor
  • Date: 2008-08-04 19:37:18 UTC
  • mto: (261.2.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804193718-f0rz13uli4429ozb
Changed gettext_noop() to N_()

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include "myisamdef.h"
19
19
 
20
 
int _mi_write_static_record(MI_INFO *info, const unsigned char *record)
 
20
int _mi_write_static_record(MI_INFO *info, const uchar *record)
21
21
{
22
 
  unsigned char temp[8];                                /* max pointer length */
 
22
  uchar temp[8];                                /* max pointer length */
23
23
  if (info->s->state.dellink != HA_OFFSET_ERROR &&
24
24
      !info->append_insert_at_end)
25
25
  {
52
52
        goto err;
53
53
      if (info->s->base.pack_reclength != info->s->base.reclength)
54
54
      {
55
 
        uint32_t length=info->s->base.pack_reclength - info->s->base.reclength;
 
55
        uint length=info->s->base.pack_reclength - info->s->base.reclength;
56
56
        memset(temp, 0, length);
57
57
        if (my_b_write(&info->rec_cache, temp,length))
58
58
          goto err;
67
67
        goto err;
68
68
      if (info->s->base.pack_reclength != info->s->base.reclength)
69
69
      {
70
 
        uint32_t length=info->s->base.pack_reclength - info->s->base.reclength;
 
70
        uint length=info->s->base.pack_reclength - info->s->base.reclength;
71
71
        memset(temp, 0, length);
72
72
        if (info->s->file_write(info, temp,length,
73
73
                      info->state->data_file_length+
84
84
  return 1;
85
85
}
86
86
 
87
 
int _mi_update_static_record(MI_INFO *info, my_off_t pos, const unsigned char *record)
 
87
int _mi_update_static_record(MI_INFO *info, my_off_t pos, const uchar *record)
88
88
{
89
89
  info->rec_cache.seek_not_done=1;              /* We have done a seek */
90
90
  return (info->s->file_write(info,
96
96
 
97
97
int _mi_delete_static_record(MI_INFO *info)
98
98
{
99
 
  unsigned char temp[9];                                /* 1+sizeof(uint32) */
 
99
  uchar temp[9];                                /* 1+sizeof(uint32) */
100
100
 
101
101
  info->state->del++;
102
102
  info->state->empty+=info->s->base.pack_reclength;
104
104
  _mi_dpointer(info,temp+1,info->s->state.dellink);
105
105
  info->s->state.dellink = info->lastpos;
106
106
  info->rec_cache.seek_not_done=1;
107
 
  return (info->s->file_write(info,(unsigned char*) temp, 1+info->s->rec_reflength,
 
107
  return (info->s->file_write(info,(uchar*) temp, 1+info->s->rec_reflength,
108
108
                    info->lastpos, MYF(MY_NABP)) != 0);
109
109
}
110
110
 
111
111
 
112
 
int _mi_cmp_static_record(register MI_INFO *info, register const unsigned char *old)
 
112
int _mi_cmp_static_record(register MI_INFO *info, register const uchar *old)
113
113
{
114
114
  if (info->opt_flag & WRITE_CACHE_USED)
115
115
  {
139
139
 
140
140
 
141
141
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
142
 
                          const unsigned char *record, my_off_t pos)
 
142
                          const uchar *record, my_off_t pos)
143
143
{
144
144
  info->rec_cache.seek_not_done=1;              /* We have done a seek */
145
145
  if (info->s->file_read(info, info->rec_buff, info->s->base.reclength,
156
156
        /*        MY_FILE_ERROR on read-error or locking-error */
157
157
 
158
158
int _mi_read_static_record(register MI_INFO *info, register my_off_t pos,
159
 
                           register unsigned char *record)
 
159
                           register uchar *record)
160
160
{
161
161
  int error;
162
162
 
189
189
 
190
190
 
191
191
 
192
 
int _mi_read_rnd_static_record(MI_INFO *info, unsigned char *buf,
 
192
int _mi_read_rnd_static_record(MI_INFO *info, uchar *buf,
193
193
                               register my_off_t filepos,
194
 
                               bool skip_deleted_blocks)
 
194
                               my_bool skip_deleted_blocks)
195
195
{
196
196
  int locked,error,cache_read;
197
 
  uint32_t cache_length;
 
197
  uint cache_length;
198
198
  MYISAM_SHARE *share=info->s;
199
199
 
200
200
  cache_read=0;
253
253
  }
254
254
 
255
255
        /* Read record with cacheing */
256
 
  error=my_b_read(&info->rec_cache,(unsigned char*) buf,share->base.reclength);
 
256
  error=my_b_read(&info->rec_cache,(uchar*) buf,share->base.reclength);
257
257
  if (info->s->base.pack_reclength != info->s->base.reclength && !error)
258
258
  {
259
259
    char tmp[8];                                /* Skill fill bytes */
260
 
    error=my_b_read(&info->rec_cache,(unsigned char*) tmp,
 
260
    error=my_b_read(&info->rec_cache,(uchar*) tmp,
261
261
                    info->s->base.pack_reclength - info->s->base.reclength);
262
262
  }
263
263
  if (locked)
264
 
    _mi_writeinfo(info,0);              /* Unlock keyfile */
 
264
    VOID(_mi_writeinfo(info,0));                /* Unlock keyfile */
265
265
  if (!error)
266
266
  {
267
267
    if (!buf[0])