~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Brian Aker
  • Date: 2009-08-18 07:20:29 UTC
  • mfrom: (1117.1.9 merge)
  • Revision ID: brian@gaz-20090818072029-s9ch5lcmltxwidn7
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
    mi_extra(file, HA_EXTRA_WAIT_LOCK, 0);
584
584
  if (!table->s->db_record_offset)
585
585
    int_table_flags|=HA_REC_NOT_IN_SEQ;
586
 
  if (file->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
587
 
    int_table_flags|=HA_HAS_CHECKSUM;
588
586
 
589
587
  keys_with_parts.reset();
590
588
  for (i= 0; i < table->s->keys; i++)
1205
1203
void ha_myisam::start_bulk_insert(ha_rows rows)
1206
1204
{
1207
1205
  Session *session= current_session;
1208
 
  ulong size= min(session->variables.read_buff_size,
1209
 
                  (uint32_t)(table->s->avg_row_length*rows));
 
1206
  ulong size= session->variables.read_buff_size;
1210
1207
 
1211
1208
  /* don't enable row cache if too few rows */
1212
1209
  if (! rows || (rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE))
1232
1229
                          (size_t)session->variables.bulk_insert_buff_size,
1233
1230
                          rows);
1234
1231
    }
1235
 
 
1236
 
  return;
1237
1232
}
1238
1233
 
1239
1234
/*
1607
1602
  return to;
1608
1603
}
1609
1604
 
1610
 
void ha_myisam::update_create_info(HA_CREATE_INFO *create_info)
1611
 
{
1612
 
  ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST);
1613
 
  if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
1614
 
  {
1615
 
    create_info->auto_increment_value= stats.auto_increment_value;
1616
 
  }
1617
 
  create_info->data_file_name=data_file_name;
1618
 
  create_info->index_file_name=index_file_name;
1619
 
}
1620
 
 
1621
 
 
1622
1605
int MyisamEngine::createTableImplementation(Session *, const char *table_name,
1623
1606
                                            Table *table_arg,
1624
1607
                                            HA_CREATE_INFO *ha_create_info,
1625
 
                                            drizzled::message::Table*)
 
1608
                                            drizzled::message::Table* create_proto)
1626
1609
{
1627
1610
  int error;
1628
1611
  uint32_t create_flags= 0, create_records;
1635
1618
  if ((error= table2myisam(table_arg, &keydef, &recinfo, &create_records)))
1636
1619
    return(error); /* purecov: inspected */
1637
1620
  memset(&create_info, 0, sizeof(create_info));
1638
 
  create_info.max_rows= share->max_rows;
1639
 
  create_info.reloc_rows= share->min_rows;
 
1621
  create_info.max_rows= create_proto->options().max_rows();
 
1622
  create_info.reloc_rows= create_proto->options().min_rows();
1640
1623
  create_info.with_auto_increment= share->next_number_key_offset == 0;
1641
1624
  create_info.auto_increment= (ha_create_info->auto_increment_value ?
1642
1625
                               ha_create_info->auto_increment_value -1 :
1643
1626
                               (uint64_t) 0);
1644
 
  create_info.data_file_length= ((uint64_t) share->max_rows *
1645
 
                                 share->avg_row_length);
 
1627
  create_info.data_file_length= (create_proto->options().max_rows() *
 
1628
                                 create_proto->options().avg_row_length());
1646
1629
  create_info.data_file_name= ha_create_info->data_file_name;
1647
1630
  create_info.index_file_name= ha_create_info->index_file_name;
1648
1631
  create_info.language= share->table_charset->number;
1653
1636
    create_flags|= HA_CREATE_KEEP_FILES;
1654
1637
  if (options & HA_OPTION_PACK_RECORD)
1655
1638
    create_flags|= HA_PACK_RECORD;
1656
 
  if (options & HA_OPTION_CHECKSUM)
1657
 
    create_flags|= HA_CREATE_CHECKSUM;
1658
 
  if (options & HA_OPTION_DELAY_KEY_WRITE)
1659
 
    create_flags|= HA_CREATE_DELAY_KEY_WRITE;
1660
1639
 
1661
1640
  /* TODO: Check that the following fn_format is really needed */
1662
1641
  error= mi_create(fn_format(buff, table_name, "", "",