Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 01, 2012
U-tellus\cwestin SERVER-4674 d5bcc46
U-tellus\cwestin SERVER-4843 00498dc
U-tellus\cwestin SERVER-4968 4bc0143
View
6 src/mongo/db/pipeline/document_source_group.cpp
@@ -297,8 +297,10 @@ namespace mongo {
/* get the _id document */
intrusive_ptr<const Value> pId(pIdExpression->evaluate(pDocument));
- uassert(15956, "the _id field for a group must not be undefined",
- pId->getType() != Undefined);
+
+ /* treat Undefined the same as NULL SERVER-4674 */
+ if (pId->getType() == Undefined)
+ pId = Value::getNull();
/*
Look for the _id value in the map; if it's not there, add a
View
11 src/mongo/db/pipeline/document_source_skip.cpp
@@ -107,14 +107,17 @@ namespace mongo {
intrusive_ptr<DocumentSource> DocumentSourceSkip::createFromBson(
BSONElement *pBsonElement,
const intrusive_ptr<ExpressionContext> &pExpCtx) {
- uassert(15972, str::stream() << "the value to " <<
- skipName << " must be a number", pBsonElement->isNumber());
+ uassert(15972, str::stream() << DocumentSourceSkip::skipName <<
+ ": the value to skip must be a number",
+ pBsonElement->isNumber());
intrusive_ptr<DocumentSourceSkip> pSkip(
DocumentSourceSkip::create(pExpCtx));
- pSkip->skip = (int)pBsonElement->numberLong();
- assert(pSkip->skip > 0); // CW TODO error code
+ pSkip->skip = pBsonElement->numberLong();
+ uassert(15956, str::stream() << DocumentSourceSkip::skipName <<
+ ": the number to skip cannot be negative",
+ pSkip->skip >= 0);
return pSkip;
}
View
6 src/mongo/db/pipeline/value.cpp
@@ -169,9 +169,6 @@ namespace mongo {
case BinData:
case Symbol:
case CodeWScope:
- uassert(16002, str::stream() <<
- "can't create Value of type " << type, false);
- break;
/* these shouldn't happen in this context */
case MinKey:
@@ -180,7 +177,8 @@ namespace mongo {
case DBRef:
case Code:
case MaxKey:
- assert(false); // CW TODO better message
+ uassert(16002, str::stream() <<
+ "can't create Value of BSON type " << type, false);
break;
}
}

No commit comments for this range

Something went wrong with that request. Please try again.