~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/blitzcmp.cc

  • Committer: Brian Aker
  • Date: 2010-10-10 02:00:34 UTC
  • mfrom: (1830.1.5 trunk-drizzle)
  • Revision ID: brian@tangent.org-20101010020034-d67x3d09fssxq1v6
Merge rollup of utf8 and table encapsulation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
  /* For now, we are only interested in supporting a PRIMARY KEY. In the
36
36
     next phase of BlitzDB, this should loop through the key array. */
37
37
  if (share->primary_key_exists) {
38
 
    KeyInfo *pk = &table->key_info[table->s->getPrimaryKey()];
 
38
    KeyInfo *pk = &table->key_info[table->getMutableShare()->getPrimaryKey()];
39
39
    KeyPartInfo *key_part = pk->key_part;
40
40
    KeyPartInfo *key_part_end = key_part + pk->key_parts;
41
41
    int key_changed = 0;
67
67
       would violate the unique contraint. */
68
68
    if (key_changed) {
69
69
      key = key_buffer;
70
 
      key_len = make_index_key(key, table->s->getPrimaryKey(), new_row);
 
70
      key_len = make_index_key(key, table->getMutableShare()->getPrimaryKey(), new_row);
71
71
      fetched = share->dict.get_row(key, key_len, &fetched_len);
72
72
 
73
73
      /* Key Exists. It's a violation. */
74
74
      if (fetched != NULL) {
75
75
        free(fetched);
76
 
        this->errkey_id = table->s->getPrimaryKey();
 
76
        this->errkey_id = table->getMutableShare()->getPrimaryKey();
77
77
        return HA_ERR_FOUND_DUPP_KEY;
78
78
      }
79
79
    }