summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/schema/schema_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/schema/schema_open.c')
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_open.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/src/schema/schema_open.c b/src/third_party/wiredtiger/src/schema/schema_open.c
index fa655c7108b..5bc589f0781 100644
--- a/src/third_party/wiredtiger/src/schema/schema_open.c
+++ b/src/third_party/wiredtiger/src/schema/schema_open.c
@@ -130,7 +130,7 @@ static int
__open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
{
WT_CONFIG colconf;
- WT_CONFIG_ITEM ckey, cval;
+ WT_CONFIG_ITEM ckey, cval, metadata;
WT_DECL_ITEM(buf);
WT_DECL_ITEM(plan);
WT_DECL_RET;
@@ -147,6 +147,22 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
if (cval.val)
F_SET(idx, WT_INDEX_IMMUTABLE);
+ /*
+ * Compatibility: we didn't always maintain collator information in
+ * index metadata, cope when it isn't found.
+ */
+ WT_CLEAR(cval);
+ WT_ERR_NOTFOUND_OK(__wt_config_getones(
+ session, idx->config, "collator", &cval));
+ if (cval.len != 0) {
+ WT_CLEAR(metadata);
+ WT_ERR_NOTFOUND_OK(__wt_config_getones(
+ session, idx->config, "app_metadata", &metadata));
+ WT_ERR(__wt_collator_config(
+ session, idx->name, &cval, &metadata,
+ &idx->collator, &idx->collator_owned));
+ }
+
WT_ERR(__wt_extractor_config(
session, idx->config, &idx->extractor, &idx->extractor_owned));