~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

  • Committer: Brian Aker
  • Date: 2010-12-20 19:20:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2016.
  • Revision ID: brian@tangent.org-20101220192057-1ch4b9uo008d8rje
Merge in additional fixes for sign, plus alter table, plus TIME on
processlist.

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->field_index);
 
132
        table->setWriteSet(table->timestamp_field->position());
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->field_index);
174
 
    table->write_set->reset(table->timestamp_field->field_index);
 
173
    timestamp_mark= table->write_set->test(table->timestamp_field->position());
 
174
    table->write_set->reset(table->timestamp_field->position());
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->field_index);
 
192
      table->setWriteSet(table->timestamp_field->position());
193
193
    }
194
194
  }
195
195
  return 0;
1275
1275
  store_values(values);
1276
1276
  session->count_cuted_fields= CHECK_FIELD_IGNORE;
1277
1277
  if (session->is_error())
1278
 
  {
1279
 
    /*
1280
 
     * If we fail mid-way through INSERT..SELECT, we need to remove any
1281
 
     * records that we added to the current Statement message. We can
1282
 
     * use session->row_count to know how many records we have already added.
1283
 
     */
1284
 
    TransactionServices &ts= TransactionServices::singleton();
1285
 
    ts.removeStatementRecords(session, (session->row_count - 1));
1286
1278
    return(1);
1287
 
  }
1288
1279
 
1289
1280
  // Release latches in case bulk insert takes a long time
1290
1281
  plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
1713
1704
 
1714
1705
  /* Mark all fields that are given values */
1715
1706
  for (Field **f= field ; *f ; f++)
1716
 
    table->setWriteSet((*f)->field_index);
 
1707
  {
 
1708
    table->setWriteSet((*f)->position());
 
1709
  }
1717
1710
 
1718
1711
  /* Don't set timestamp if used */
1719
1712
  table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;