~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_create.c

  • Committer: Mark Atwood
  • Date: 2009-01-05 04:37:22 UTC
  • mto: (758.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: me@mark.atwood.name-20090105043722-03l4mzcxi4yjjjih
replace sql_print_error etc with errmsg_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <mysys/queues.h>
21
21
#include <mysys/my_bit.h>
22
22
 
 
23
#include <drizzled/util/test.h>
23
24
 
24
25
/*
25
26
  Old options is used when recreating database, from myisamchk
83
84
    ci->reloc_rows=ci->max_rows;                /* Check if wrong parameter */
84
85
 
85
86
  if (!(rec_per_key_part=
86
 
        (ulong*) my_malloc((keys + uniques)*MI_MAX_KEY_SEG*sizeof(long),
87
 
                           MYF(MY_WME | MY_ZEROFILL))))
 
87
        (ulong*) malloc((keys + uniques)*MI_MAX_KEY_SEG*sizeof(long))))
88
88
    return(my_errno);
 
89
  memset(rec_per_key_part, 0, (keys + uniques)*MI_MAX_KEY_SEG*sizeof(long));
89
90
 
90
91
        /* Start by checking fields and field-types used */
91
92
 
169
170
  if (flags & HA_CREATE_TMP_TABLE)
170
171
  {
171
172
    options|= HA_OPTION_TMP_TABLE;
172
 
    create_mode|= O_EXCL | O_NOFOLLOW;
 
173
    create_mode|= O_EXCL;
173
174
  }
174
175
  if (flags & HA_CREATE_CHECKSUM || (options & HA_OPTION_CHECKSUM))
175
176
  {
351
352
      share.state.rec_per_key_part[key_segs-1]=1L;
352
353
    length+=key_length;
353
354
    /* Get block length for key, if defined by user */
354
 
    block_length= (keydef->block_length ? 
 
355
    block_length= (keydef->block_length ?
355
356
                   my_round_up_to_next_power(keydef->block_length) :
356
357
                   myisam_block_size);
357
358
    block_length= cmax(block_length, MI_MIN_KEY_BLOCK_LENGTH);
413
414
    goto err;
414
415
  }
415
416
 
416
 
  memcpy(share.state.header.file_version,myisam_file_magic,4);
 
417
  memmove(share.state.header.file_version,myisam_file_magic,4);
417
418
  ci->old_options=options| (ci->old_options & HA_OPTION_TEMP_COMPRESS_RECORD ?
418
419
                        HA_OPTION_COMPRESS_RECORD |
419
420
                        HA_OPTION_TEMP_COMPRESS_RECORD: 0);
695
696
    my_close(dfile,MYF(0));
696
697
    /* fall through */
697
698
  case 2:
698
 
    /* QQ: T�nu should add a call to my_raid_delete() here */
699
699
  if (! (flags & HA_DONT_TOUCH_DATA))
700
700
    my_delete_with_symlink(fn_format(filename,name,"",MI_NAME_DEXT,
701
701
                                     MY_UNPACK_FILENAME | MY_APPEND_EXT),