summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDon Anderson <dda@ddanderson.com>2015-01-23 08:52:13 -0500
committerDon Anderson <dda@ddanderson.com>2015-01-23 08:52:13 -0500
commit7d677aedfdcaa5458e900e556b662def460d0281 (patch)
treebd12268c6fbe55998be9eb455f550b1c1d412571 /src
parent3af50d39cea5f0230a4653fd5cf189c2bf6c3f25 (diff)
downloadmongo-7d677aedfdcaa5458e900e556b662def460d0281.tar.gz
Fix __wt_schema_get_index to return table pointer in all cases.
This fixes drop index on a newly opened session. Fix __wt_schema_open_index to return WT_NOTFOUND when opening a single index. This fixes opening a cursor on a non-existant index. Refs #1567.
Diffstat (limited to 'src')
-rw-r--r--src/schema/schema_open.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/schema/schema_open.c b/src/schema/schema_open.c
index d613ced00aa..fa655c7108b 100644
--- a/src/schema/schema_open.c
+++ b/src/schema/schema_open.c
@@ -269,6 +269,7 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
cursor = NULL;
idx = NULL;
+ match = 0;
/* Build a search key. */
tablename = table->name;
@@ -343,6 +344,8 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
break;
}
WT_ERR_NOTFOUND_OK(ret);
+ if (idxname != NULL && !match)
+ ret = WT_NOTFOUND;
/* If we did a full pass, we won't need to do it again. */
if (idxname == NULL) {
@@ -557,6 +560,8 @@ __wt_schema_get_index(WT_SESSION_IMPL *session,
/* Otherwise, open it. */
WT_ERR(__wt_schema_open_index(
session, table, tend + 1, strlen(tend + 1), indexp));
+ if (tablep != NULL)
+ *tablep = table;
err: __wt_schema_release_table(session, table);
WT_RET(ret);