~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

  • Committer: Brian Aker
  • Date: 2010-12-02 01:39:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1968.
  • Revision ID: brian@tangent.org-20101202013953-9ie7kafjag0e051q
Style cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
      }
130
130
      else
131
131
      {
132
 
        table->setWriteSet(table->timestamp_field->position());
 
132
        table->setWriteSet(table->timestamp_field->field_index);
133
133
      }
134
134
    }
135
135
  }
170
170
      Unmark the timestamp field so that we can check if this is modified
171
171
      by update_fields
172
172
    */
173
 
    timestamp_mark= table->write_set->test(table->timestamp_field->position());
174
 
    table->write_set->reset(table->timestamp_field->position());
 
173
    timestamp_mark= table->write_set->test(table->timestamp_field->field_index);
 
174
    table->write_set->reset(table->timestamp_field->field_index);
175
175
  }
176
176
 
177
177
  /* Check the fields we are going to modify */
189
189
 
190
190
    if (timestamp_mark)
191
191
    {
192
 
      table->setWriteSet(table->timestamp_field->position());
 
192
      table->setWriteSet(table->timestamp_field->field_index);
193
193
    }
194
194
  }
195
195
  return 0;
846
846
          table->cursor->adjust_next_insert_id_after_explicit_value(
847
847
            table->next_number_field->val_int());
848
848
        info->touched++;
849
 
 
850
 
        if (! table->records_are_comparable() || table->compare_records())
 
849
        if ((table->cursor->getEngine()->check_flag(HTON_BIT_PARTIAL_COLUMN_READ) &&
 
850
            ! table->write_set->is_subset_of(*table->read_set)) ||
 
851
            table->compare_record())
851
852
        {
852
853
          if ((error=table->cursor->updateRecord(table->getUpdateRecord(),
853
854
                                                table->getInsertRecord())) &&
1275
1276
  store_values(values);
1276
1277
  session->count_cuted_fields= CHECK_FIELD_IGNORE;
1277
1278
  if (session->is_error())
 
1279
  {
 
1280
    /*
 
1281
     * If we fail mid-way through INSERT..SELECT, we need to remove any
 
1282
     * records that we added to the current Statement message. We can
 
1283
     * use session->row_count to know how many records we have already added.
 
1284
     */
 
1285
    TransactionServices &ts= TransactionServices::singleton();
 
1286
    ts.removeStatementRecords(session, (session->row_count - 1));
1278
1287
    return(1);
 
1288
  }
1279
1289
 
1280
1290
  // Release latches in case bulk insert takes a long time
1281
1291
  plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
1704
1714
 
1705
1715
  /* Mark all fields that are given values */
1706
1716
  for (Field **f= field ; *f ; f++)
1707
 
  {
1708
 
    table->setWriteSet((*f)->position());
1709
 
  }
 
1717
    table->setWriteSet((*f)->field_index);
1710
1718
 
1711
1719
  /* Don't set timestamp if used */
1712
1720
  table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;