~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/csv/ha_tina.cc

  • Committer: Brian Aker
  • Date: 2008-12-09 17:33:02 UTC
  • mfrom: (656.1.54 devel)
  • Revision ID: brian@tangent.org-20081209173302-aptngvc7efxnatnt
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
  unsigned char meta_buffer[META_BUFFER_SIZE];
235
235
  unsigned char *ptr= meta_buffer;
236
236
 
237
 
  my_seek(meta_file, 0, MY_SEEK_SET, MYF(0));
 
237
  lseek(meta_file, 0, SEEK_SET);
238
238
  if (my_read(meta_file, (unsigned char*)meta_buffer, META_BUFFER_SIZE, 0)
239
239
      != META_BUFFER_SIZE)
240
240
    return(HA_ERR_CRASHED_ON_USAGE);
301
301
  ptr+= 3*sizeof(uint64_t);
302
302
  *ptr= (unsigned char)dirty;
303
303
 
304
 
  my_seek(meta_file, 0, MY_SEEK_SET, MYF(0));
 
304
  lseek(meta_file, 0, SEEK_SET);
305
305
  if (my_write(meta_file, (unsigned char *)meta_buffer, META_BUFFER_SIZE, 0)
306
306
      != META_BUFFER_SIZE)
307
307
    return(-1);
546
546
      chain_size += DEFAULT_CHAIN_LENGTH;
547
547
      if (chain_alloced)
548
548
      {
549
 
        /* Must cast since my_malloc unlike malloc doesn't have a void ptr */
550
 
        if ((chain= (tina_set *) my_realloc((unsigned char*)chain,
551
 
                                            chain_size, MYF(MY_WME))) == NULL)
 
549
        if ((chain= (tina_set *) realloc(chain, chain_size)) == NULL)
552
550
          return -1;
553
551
      }
554
552
      else
555
553
      {
556
 
        tina_set *ptr= (tina_set *) my_malloc(chain_size * sizeof(tina_set),
557
 
                                              MYF(MY_WME));
 
554
        tina_set *ptr= (tina_set *) malloc(chain_size * sizeof(tina_set));
 
555
        if (ptr == NULL)
 
556
          return -1;
558
557
        memcpy(ptr, chain, DEFAULT_CHAIN_LENGTH * sizeof(tina_set));
559
558
        chain= ptr;
560
559
        chain_alloced++;
1287
1286
 
1288
1287
  /* Don't assert in field::val() functions */
1289
1288
  table->use_all_columns();
1290
 
  if (!(buf= (unsigned char*) my_malloc(table->s->reclength, MYF(MY_WME))))
 
1289
  if (!(buf= (unsigned char*) malloc(table->s->reclength)))
1291
1290
    return(HA_ERR_OUT_OF_MEM);
1292
1291
 
1293
1292
  /* position buffer to the start of the file */
1474
1473
 
1475
1474
  old_proc_info= get_session_proc_info(session);
1476
1475
  set_session_proc_info(session, "Checking table");
1477
 
  if (!(buf= (unsigned char*) my_malloc(table->s->reclength, MYF(MY_WME))))
 
1476
  if (!(buf= (unsigned char*) malloc(table->s->reclength)))
1478
1477
    return(HA_ERR_OUT_OF_MEM);
1479
1478
 
1480
1479
  /* position buffer to the start of the file */