~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2010-07-30 20:31:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1679.
  • Revision ID: brian@gaz-20100730203119-89g2ye4zwnvcacxg
First pass in encapsulating row

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
  If we got a duplicate key error, we want to write an error
44
44
  message containing the value of the duplicate key. If we do not have
45
 
  all fields of the key value in record[0], we need to re-read the
 
45
  all fields of the key value in getInsertRecord(), we need to re-read the
46
46
  record with a proper read_set.
47
47
 
48
48
  @param[in] error   error number
89
89
    return;
90
90
 
91
91
  /* Get identifier of last read record into table->cursor->ref. */
92
 
  table->cursor->position(table->record[0]);
 
92
  table->cursor->position(table->getInsertRecord());
93
93
  /* Add all fields used by unique index to read_set. */
94
94
  bitmap_union(table->read_set, &unique_map);
95
95
  /* Read record that is identified by table->cursor->ref. */
96
 
  (void) table->cursor->rnd_pos(table->record[1], table->cursor->ref);
 
96
  (void) table->cursor->rnd_pos(table->getUpdateRecord(), table->cursor->ref);
97
97
  /* Copy the newly read columns into the new record. */
98
98
  for (field_p= table->getFields(); (field= *field_p); field_p++)
99
99
  {
368
368
          if (table->cursor->was_semi_consistent_read())
369
369
            continue;  /* repeat the read of the same row if it still exists */
370
370
 
371
 
          table->cursor->position(table->record[0]);
 
371
          table->cursor->position(table->getInsertRecord());
372
372
          if (my_b_write(&tempfile,table->cursor->ref,
373
373
                         table->cursor->ref_length))
374
374
          {
470
470
      if (!can_compare_record || table->compare_record())
471
471
      {
472
472
        /* Non-batched update */
473
 
        error= table->cursor->updateRecord(table->record[1],
474
 
                                            table->record[0]);
 
473
        error= table->cursor->updateRecord(table->getUpdateRecord(),
 
474
                                            table->getInsertRecord());
475
475
 
476
476
        table->auto_increment_field_not_null= false;
477
477