summaryrefslogtreecommitdiff
path: root/src/schema
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-10-16 22:00:10 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-10-16 22:00:10 +1100
commitc6a63a7a9a91dc143acb0ffa8a3f60865782ae00 (patch)
treeea5e96180e5f1aecc6236899ccee73cca31bd8ed /src/schema
parentd6125b358d8d467ecd930fb5fdb235943b8f3a33 (diff)
downloadmongo-c6a63a7a9a91dc143acb0ffa8a3f60865782ae00.tar.gz
Handle custom extractors where the last key column is a WT_ITEM.
refs #1199
Diffstat (limited to 'src/schema')
-rw-r--r--src/schema/schema_open.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/schema/schema_open.c b/src/schema/schema_open.c
index 4741b33ea7d..a4794eb61c0 100644
--- a/src/schema/schema_open.c
+++ b/src/schema/schema_open.c
@@ -217,6 +217,12 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
WT_ERR(__wt_buf_init(session, buf, 0));
WT_ERR(__wt_struct_truncate(session,
idx->key_format, npublic_cols, buf));
+ /*
+ * Add a trailing padding byte to the format. This ensures that there
+ * will be no special optimization of the last column, so the primary
+ * key columns can be simply appended.
+ */
+ WT_ERR(__wt_buf_catfmt(session, buf, "x"));
WT_ERR(__wt_strndup(
session, buf->data, buf->size, &idx->idxkey_format));