~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/csv/ha_tina.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
pthread_mutex_t tina_mutex;
77
77
static HASH tina_open_tables;
78
78
static handler *tina_create_handler(handlerton *hton,
79
 
                                    TABLE_SHARE *table, 
 
79
                                    TABLE_SHARE *table,
80
80
                                    MEM_ROOT *mem_root);
81
81
 
82
82
 
112
112
                   (hash_get_key) tina_get_key,0,0);
113
113
  tina_hton->state= SHOW_OPTION_YES;
114
114
  tina_hton->create= tina_create_handler;
115
 
  tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES | 
 
115
  tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES |
116
116
                     HTON_NO_PARTITION);
117
117
  return 0;
118
118
}
417
417
 
418
418
 
419
419
static handler *tina_create_handler(handlerton *hton,
420
 
                                    TABLE_SHARE *table, 
 
420
                                    TABLE_SHARE *table,
421
421
                                    MEM_ROOT *mem_root)
422
422
{
423
423
  return new (mem_root) ha_tina(hton, table);
458
458
    const char *ptr;
459
459
    const char *end_ptr;
460
460
    const bool was_null= (*field)->is_null();
461
 
    
 
461
 
462
462
    /*
463
463
      assistance for backwards compatibility in production builds.
464
464
      note: this will not work for ENUM columns.
470
470
    }
471
471
 
472
472
    (*field)->val_str(&attribute,&attribute);
473
 
    
 
473
 
474
474
    if (was_null)
475
475
      (*field)->set_null();
476
476
 
481
481
 
482
482
      buffer.append('"');
483
483
 
484
 
      while (ptr < end_ptr) 
 
484
      while (ptr < end_ptr)
485
485
      {
486
486
        if (*ptr == '"')
487
487
        {
766
766
    For log tables concurrent insert works different. The reason is that
767
767
    log tables are always opened and locked. And as they do not unlock
768
768
    tables, the file length after writes should be updated in a different
769
 
    way. 
 
769
    way.
770
770
*/
771
771
 
772
772
void ha_tina::update_status()
904
904
  size= encode_quote(new_data);
905
905
 
906
906
  /*
907
 
    During update we mark each updating record as deleted 
908
 
    (see the chain_append()) then write new one to the temporary data file. 
 
907
    During update we mark each updating record as deleted
 
908
    (see the chain_append()) then write new one to the temporary data file.
909
909
    At the end of the sequence in the rnd_end() we append all non-marked
910
910
    records from the data file to the temporary data file then rename it.
911
911
    The temp_file_length is used to calculate new data file length.
956
956
 
957
957
/**
958
958
  @brief Initialize the data file.
959
 
  
 
959
 
960
960
  @details Compare the local version of the data file with the shared one.
961
961
  If they differ, there are some changes behind and we have to reopen
962
962
  the data file to make the changes visible.
963
 
  Call @c file_buff->init_buff() at the end to read the beginning of the 
 
963
  Call @c file_buff->init_buff() at the end to read the beginning of the
964
964
  data file into buffer.
965
 
  
 
965
 
966
966
  @retval  0  OK.
967
967
  @retval  1  There was an error.
968
968
*/
1100
1100
int ha_tina::info(uint32_t)
1101
1101
{
1102
1102
  /* This is a lie, but you don't want the optimizer to see zero or 1 */
1103
 
  if (!records_is_known && stats.records < 2) 
 
1103
  if (!records_is_known && stats.records < 2)
1104
1104
    stats.records= 2;
1105
1105
  return(0);
1106
1106
}
1167
1167
      /* if there is something to write, write it */
1168
1168
      if (write_length)
1169
1169
      {
1170
 
        if (my_write(update_temp_file, 
 
1170
        if (my_write(update_temp_file,
1171
1171
                     (unsigned char*) (file_buff->ptr() +
1172
1172
                               (write_begin - file_buff->start())),
1173
1173
                     write_length, MYF_RW))
1221
1221
    if (((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1))
1222
1222
      return(-1);
1223
1223
    /*
1224
 
      As we reopened the data file, increase share->data_file_version 
1225
 
      in order to force other threads waiting on a table lock and  
 
1224
      As we reopened the data file, increase share->data_file_version
 
1225
      in order to force other threads waiting on a table lock and
1226
1226
      have already opened the table to reopen the data file.
1227
1227
      That makes the latest changes become visible to them.
1228
 
      Update local_data_file_version as no need to reopen it in the 
 
1228
      Update local_data_file_version as no need to reopen it in the
1229
1229
      current thread.
1230
1230
    */
1231
1231
    share->data_file_version++;
1236
1236
      Here we record this fact to the meta-file.
1237
1237
    */
1238
1238
    (void)write_meta_file(share->meta_file, share->rows_recorded, false);
1239
 
    /* 
1240
 
      Update local_saved_data_file_length with the real length of the 
 
1239
    /*
 
1240
      Update local_saved_data_file_length with the real length of the
1241
1241
      data file.
1242
1242
    */
1243
1243
    local_saved_data_file_length= temp_file_length;
1424
1424
  return to;
1425
1425
}
1426
1426
 
1427
 
/* 
 
1427
/*
1428
1428
  Create a table. You do not want to leave the table open after a call to
1429
1429
  this (the database will call ::open() if it needs to).
1430
1430
*/
1445
1445
      return(HA_ERR_UNSUPPORTED);
1446
1446
    }
1447
1447
  }
1448
 
  
 
1448
 
1449
1449
 
1450
1450
  if ((create_file= my_create(fn_format(name_buff, name, "", CSM_EXT,
1451
1451
                                        MY_REPLACE_EXT|MY_UNPACK_FILENAME), 0,
1499
1499
    count--;
1500
1500
    current_position= next_position;
1501
1501
  }
1502
 
  
 
1502
 
1503
1503
  free_root(&blobroot, MYF(0));
1504
1504
 
1505
1505
  free((char*)buf);