~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/blitzindex.cc

  • Committer: Stewart Smith
  • Date: 2010-07-27 00:49:32 UTC
  • mto: (1720.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1721.
  • Revision ID: stewart@flamingspork.com-20100727004932-basq3vx9szmmbswm
fix storing and manipulating foreign keys in the proto around ALTER TABLE, CREATE TABLE and ALTER TABLE ADD/DROP FOREIGN KEY. We also (mostly) emulate the naming of innodb foreign keys in the upper layer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <config.h>
21
21
#include "ha_blitz.h"
22
22
 
23
23
/* Unlike the data dictionary, don't tune the btree by default
32
32
 
33
33
  if (!tcbdbsetmutex(btree)) {
34
34
    tcbdbdel(btree);
35
 
    return HA_ERR_GENERIC;
36
 
  }
37
 
 
38
 
  if (blitz_estimated_rows != 0) {
39
 
    uint64_t tree_buckets = blitz_estimated_rows / 10;
40
 
    if (!tcbdbtune(btree, 0, 0, tree_buckets, -1, -1, 0)) {
41
 
      tcbdbdel(btree);
42
 
      return HA_ERR_GENERIC;
43
 
    }
 
35
    return HA_ERR_CRASHED_ON_USAGE;
44
36
  }
45
37
 
46
38
  if (!tcbdbsetcmpfunc(btree, blitz_keycmp_cb, this)) {
47
39
    tcbdbdel(btree);
48
 
    return HA_ERR_GENERIC;
 
40
    return HA_ERR_CRASHED_ON_USAGE;
49
41
  }
50
42
 
51
43
  snprintf(buf, FN_REFLEN, "%s_%02d%s", path, key_num, BLITZ_INDEX_EXT);