diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_metadata.c')
-rw-r--r-- | src/third_party/wiredtiger/src/cursor/cur_metadata.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_metadata.c b/src/third_party/wiredtiger/src/cursor/cur_metadata.c index 543f6221333..66e2ec5b77b 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_metadata.c +++ b/src/third_party/wiredtiger/src/cursor/cur_metadata.c @@ -60,8 +60,9 @@ err: * __schema_create_collapse -- * Discard any configuration information from a schema entry that is not applicable to an * session.create call. For a table URI that contains no named column groups, fold in the - * configuration from the implicit column group and its source. For a named column group URI, - * fold in its source. + * configuration from the implicit column group and its source. For a named column group or + * index URI, fold in its source. For a table URI that contains named column groups, we return + * only the table portion. */ static int __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, const char *key, @@ -79,14 +80,17 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons c = NULL; if (key != NULL && WT_PREFIX_SKIP(key, "table:")) { /* - * Check if the table has declared column groups. If it does, don't attempt to open the - * automatically created column group for simple tables. + * Check if the table has declared column groups. If it does, return just the table info. + * One can get the creation metadata for an index or column group table itself or for simple + * tables. */ WT_RET(__wt_config_getones(session, value, "colgroups", &cgconf)); __wt_config_subinit(session, &cparser, &cgconf); - if ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0) + if ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0) { + firstcfg = cfg; goto skip; + } WT_RET_NOTFOUND_OK(ret); c = mdc->create_cursor; @@ -103,7 +107,7 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons WT_ERR(c->get_value(c, &v)); WT_ERR(__wt_strdup(session, v, --cfg)); WT_ERR(__schema_source_config(session, c, v, --cfg)); - } else if (key != NULL && WT_PREFIX_SKIP(key, "colgroup:")) { + } else if (key != NULL && (WT_PREFIX_SKIP(key, "colgroup:") || WT_PREFIX_SKIP(key, "index:"))) { if (strchr(key, ':') != NULL) { c = mdc->create_cursor; WT_ERR(__wt_strdup(session, value, --cfg)); @@ -111,9 +115,9 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons } } -skip: firstcfg = cfg; *--firstcfg = WT_CONFIG_BASE(session, WT_SESSION_create); +skip: WT_ERR(__wt_config_collapse(session, firstcfg, value_ret)); err: |