~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2010-06-03 08:52:10 UTC
  • mfrom: (1578.2.12 drizzle)
  • Revision ID: brian@gaz-20100603085210-clp9vyrtt0wzomx7
Merge Brian, mostly encapsulation around TableShare.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3549
3549
    the clustered index */
3550
3550
  }
3551
3551
 
3552
 
  n_fields = (ulint)table->getShare()->fields; /* number of columns */
 
3552
  n_fields = (ulint)table->getShare()->sizeFields(); /* number of columns */
3553
3553
 
3554
3554
  if (!prebuilt->mysql_template) {
3555
3555
    prebuilt->mysql_template = (mysql_row_templ_t*)
4041
4041
  dict_index_t* clust_index;
4042
4042
  uint    i= 0;
4043
4043
 
4044
 
  n_fields = table->getShare()->fields;
 
4044
  n_fields = table->getShare()->sizeFields();
4045
4045
  clust_index = dict_table_get_first_index(prebuilt->table);
4046
4046
 
4047
4047
  /* We use upd_buff to convert changed fields */
4661
4661
  ut_ad(user_session == ha_session());
4662
4662
  ut_a(prebuilt->trx == session_to_trx(user_session));
4663
4663
 
4664
 
  if (keynr != MAX_KEY && table->getShare()->keys > 0) 
 
4664
  if (keynr != MAX_KEY && table->getShare()->sizeKeys() > 0) 
4665
4665
  {
4666
4666
    index = dict_table_get_index_on_name(prebuilt->table,
4667
4667
                                         table->getShare()->getTableProto()->indexes(keynr).name().c_str());
5102
5102
  ulint   charset_no;
5103
5103
  ulint   i;
5104
5104
 
5105
 
  n_cols = form->getShare()->fields;
 
5105
  n_cols = form->getShare()->sizeFields();
5106
5106
 
5107
5107
  /* We pass 0 as the space id, and determine at a lower level the space
5108
5108
  id where to store the table */
5248
5248
    the length of the key part versus the column. */
5249
5249
 
5250
5250
    field = NULL;
5251
 
    for (j = 0; j < form->getShare()->fields; j++) {
 
5251
    for (j = 0; j < form->getShare()->sizeFields(); j++)
 
5252
    {
5252
5253
 
5253
5254
      field = form->field[j];
5254
5255
 
5261
5262
      }
5262
5263
    }
5263
5264
 
5264
 
    ut_a(j < form->getShare()->fields);
 
5265
    ut_a(j < form->getShare()->sizeFields());
5265
5266
 
5266
5267
    col_type = get_innobase_type_from_mysql_type(
5267
5268
          &is_unsigned, key_part->field);
5398
5399
 
5399
5400
  const char *table_name= identifier.getPath().c_str();
5400
5401
 
5401
 
  if (form.getShare()->fields > 1000) {
 
5402
  if (form.getShare()->sizeFields() > 1000) {
5402
5403
    /* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
5403
5404
      but we play safe here */
5404
5405
 
5529
5530
 
5530
5531
  /* Create the keys */
5531
5532
 
5532
 
  if (form.getShare()->keys == 0 || primary_key_no == -1) {
 
5533
  if (form.getShare()->sizeKeys() == 0 || primary_key_no == -1) {
5533
5534
    /* Create an index which is used as the clustered index;
5534
5535
      order the rows by their row id which is internally generated
5535
5536
      by InnoDB */
5548
5549
    }
5549
5550
  }
5550
5551
 
5551
 
  for (i = 0; i < form.getShare()->keys; i++) {
 
5552
  for (i = 0; i < form.getShare()->sizeKeys(); i++) {
5552
5553
    if (i != (uint) primary_key_no) {
5553
5554
 
5554
5555
      if ((error = create_index(trx, &form, iflags, norm_name,
6388
6389
      index = dict_table_get_next_index(index);
6389
6390
    }
6390
6391
 
6391
 
    for (i = 0; i < table->getShare()->keys; i++) {
 
6392
    for (i = 0; i < table->getShare()->sizeKeys(); i++) {
6392
6393
      if (index == NULL) {
6393
6394
        errmsg_printf(ERRMSG_LVL_ERROR, "Table %s contains fewer "
6394
6395
            "indexes inside InnoDB than "