summaryrefslogtreecommitdiff
path: root/src/conn
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-03-20 10:49:41 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-03-20 10:49:41 -0400
commite9bd34719860356f9bcac88a9d8ca6848aeb7855 (patch)
tree149e215ce95ec57dc74042ef5b957a1fcb66697b /src/conn
parent94d3e1ff61eeff4801a64cc6f753eeb7a8eb9650 (diff)
downloadmongo-e9bd34719860356f9bcac88a9d8ca6848aeb7855.tar.gz
Add tests for illegal block compressors.
Diffstat (limited to 'src/conn')
-rw-r--r--src/conn/conn_api.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index 6880387753a..2b09fcec3dc 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -70,24 +70,23 @@ ext_collator_config(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session,
*/
static int
__collator_confchk(
- WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cname, WT_NAMED_COLLATOR **ncollp)
+ WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cname, WT_COLLATOR **collatorp)
{
WT_CONNECTION_IMPL *conn;
WT_NAMED_COLLATOR *ncoll;
- if (ncollp != NULL)
- *ncollp = NULL;
+ if (collatorp != NULL)
+ *collatorp = NULL;
conn = S2C(session);
TAILQ_FOREACH(ncoll, &conn->collqh, q)
- if (WT_STRING_MATCH(ncoll->name, cname->str, cname->len))
- break;
- if (ncoll == NULL)
- WT_RET_MSG(session, EINVAL,
- "unknown collator '%.*s'", (int)cname->len, cname->str);
- if (ncollp != NULL)
- *ncollp = ncoll;
- return (0);
+ if (WT_STRING_MATCH(ncoll->name, cname->str, cname->len)) {
+ if (collatorp != NULL)
+ *collatorp = ncoll->collator;
+ return (0);
+ }
+ WT_RET_MSG(session, EINVAL,
+ "unknown collator '%.*s'", (int)cname->len, cname->str);
}
/*
@@ -110,14 +109,12 @@ __wt_collator_config(WT_SESSION_IMPL *session, const char *uri,
WT_COLLATOR **collatorp, int *ownp)
{
WT_COLLATOR *collator;
- WT_NAMED_COLLATOR *ncoll;
*collatorp = NULL;
*ownp = 0;
- WT_RET(__collator_confchk(session, cname, &ncoll));
+ WT_RET(__collator_confchk(session, cname, &collator));
- collator = ncoll->collator;
if (collator->customize != NULL)
WT_RET(collator->customize(collator,
&session->iface, uri, metadata, collatorp));