~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_extra.c

  • Committer: Brian Aker
  • Date: 2009-02-12 22:45:08 UTC
  • Revision ID: brian@tangent.org-20090212224508-mrd9jwgn1zjdpqdk
Minor refactoring (we will need to disconnect the code from the include
file).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "myisamdef.h"
17
 
#ifdef HAVE_SYS_MMAN_H
 
17
#include <drizzled/util/test.h>
 
18
#include <sys/types.h>
18
19
#include <sys/mman.h>
19
 
#endif
 
20
 
 
21
#include <string.h>
20
22
 
21
23
static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function);
22
24
 
138
140
      error=end_io_cache(&info->rec_cache);
139
141
      /* Sergei will insert full text index caching here */
140
142
    }
141
 
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
 
143
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(TARGET_OS_SOLARIS)
142
144
    if (info->opt_flag & MEMMAP_USED)
143
145
      madvise((char*) share->file_map, share->state.state.data_file_length,
144
146
              MADV_RANDOM);
163
165
  case HA_EXTRA_KEYREAD:                        /* Read only keys to record */
164
166
  case HA_EXTRA_REMEMBER_POS:
165
167
    info->opt_flag |= REMEMBER_OLD_POS;
166
 
    memcpy(info->lastkey+share->base.max_key_length*2,
167
 
           info->lastkey,info->lastkey_length);
 
168
    memmove(info->lastkey+share->base.max_key_length*2,
 
169
            info->lastkey,info->lastkey_length);
168
170
    info->save_update=  info->update;
169
171
    info->save_lastinx= info->lastinx;
170
172
    info->save_lastpos= info->lastpos;
180
182
  case HA_EXTRA_RESTORE_POS:
181
183
    if (info->opt_flag & REMEMBER_OLD_POS)
182
184
    {
183
 
      memcpy(info->lastkey,
184
 
             info->lastkey+share->base.max_key_length*2,
185
 
             info->save_lastkey_length);
 
185
      memmove(info->lastkey,
 
186
              info->lastkey+share->base.max_key_length*2,
 
187
              info->save_lastkey_length);
186
188
      info->update=     info->save_update | HA_STATE_WRITTEN;
187
189
      info->lastinx=    info->save_lastinx;
188
190
      info->lastpos=    info->save_lastpos;
323
325
      info->opt_flag|= OPT_NO_ROWS;
324
326
    break;
325
327
  case HA_EXTRA_PRELOAD_BUFFER_SIZE:
326
 
    info->preload_buff_size= *((uint32_t *) extra_arg); 
 
328
    info->preload_buff_size= *((uint32_t *) extra_arg);
327
329
    break;
328
330
  case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
329
331
  case HA_EXTRA_CHANGE_KEY_TO_DUP:
412
414
  }
413
415
  if (share->base.blobs)
414
416
    mi_alloc_rec_buff(info, -1, &info->rec_buff);
415
 
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
 
417
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(TARGET_OS_SOLARIS)
416
418
  if (info->opt_flag & MEMMAP_USED)
417
419
    madvise((char*) share->file_map, share->state.state.data_file_length,
418
420
            MADV_RANDOM);