~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/blitzindex.cc

  • Committer: Lee Bieber
  • Date: 2011-01-12 04:30:24 UTC
  • mfrom: (2075.1.3 build)
  • Revision ID: kalebral@gmail.com-20110112043024-zgws6jzd54oym9um
Merge Brian - fix bug 527084 - DROP TABLE: getTableDefiniton returns EEXIST but doDropTable returns ENOENT leads to SIGSEGV
Merge Shrews - fix bug 686781 - Transaction message segmenting does not work in all cases 
Merge Stewart - fix bug 376299: sum_distinct-big test fails after resetting max_heap_table_size

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  char buf[FN_REFLEN];
29
29
 
30
30
  if ((btree = tcbdbnew()) == NULL)
31
 
    return HA_ERR_OUT_OF_MEM;
 
31
    return drizzled::HA_ERR_OUT_OF_MEM;
32
32
 
33
33
  if (!tcbdbsetmutex(btree)) {
34
34
    tcbdbdel(btree);
35
 
    return HA_ERR_GENERIC;
 
35
    return drizzled::HA_ERR_GENERIC;
36
36
  }
37
37
 
38
38
  if (blitz_estimated_rows != 0) {
39
39
    uint64_t tree_buckets = blitz_estimated_rows / 10;
40
40
    if (!tcbdbtune(btree, 0, 0, tree_buckets, -1, -1, 0)) {
41
41
      tcbdbdel(btree);
42
 
      return HA_ERR_GENERIC;
 
42
      return drizzled::HA_ERR_GENERIC;
43
43
    }
44
44
  }
45
45
 
46
46
  if (!tcbdbsetcmpfunc(btree, blitz_keycmp_cb, this)) {
47
47
    tcbdbdel(btree);
48
 
    return HA_ERR_GENERIC;
 
48
    return drizzled::HA_ERR_GENERIC;
49
49
  }
50
50
 
51
51
  snprintf(buf, FN_REFLEN, "%s_%02d%s", path, key_num, BLITZ_INDEX_EXT);
52
52
 
53
53
  if (!tcbdbopen(btree, buf, mode)) {
54
54
    tcbdbdel(btree);
55
 
    return HA_ERR_CRASHED_ON_USAGE;
 
55
    return drizzled::HA_ERR_CRASHED_ON_USAGE;
56
56
  }
57
57
 
58
58
  return 0;
92
92
 
93
93
  if (!tcbdbclose(btree)) {
94
94
    tcbdbdel(btree);
95
 
    return HA_ERR_CRASHED_ON_USAGE;
 
95
    return drizzled::HA_ERR_CRASHED_ON_USAGE;
96
96
  }
97
97
 
98
98
  tcbdbdel(btree);
127
127
int BlitzTree::write_unique(const char *key, const size_t klen) {
128
128
  if (!tcbdbputkeep(btree, key, klen, "", 0)) {
129
129
    if (tcbdbecode(btree) == TCEKEEP) {
130
 
      errno = HA_ERR_FOUND_DUPP_KEY;
131
 
      return HA_ERR_FOUND_DUPP_KEY;
 
130
      errno = drizzled::HA_ERR_FOUND_DUPP_KEY;
 
131
      return drizzled::HA_ERR_FOUND_DUPP_KEY;
132
132
    }
133
133
  }
134
134
  return 0;