diff options
author | Martin Neupauer <martin.neupauer@mongodb.com> | 2019-02-26 16:11:27 -0500 |
---|---|---|
committer | Martin Neupauer <martin.neupauer@mongodb.com> | 2019-03-26 10:26:11 -0400 |
commit | b3c4979387d711a46dc5837ac861b9c2e34eb631 (patch) | |
tree | e83b2fdd3176c1bbacb707d404394a66ecba5a42 /src/mongo/db/pipeline/expression_context.cpp | |
parent | 1053cf8347e7aeaca24d47039980c765dae75d5b (diff) | |
download | mongo-b3c4979387d711a46dc5837ac861b9c2e34eb631.tar.gz |
SERVER-40209 Implement $$NOW and $$CLUSTER_TIME
Diffstat (limited to 'src/mongo/db/pipeline/expression_context.cpp')
-rw-r--r-- | src/mongo/db/pipeline/expression_context.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/expression_context.cpp b/src/mongo/db/pipeline/expression_context.cpp index 508f51788c2..21651f6f2b8 100644 --- a/src/mongo/db/pipeline/expression_context.cpp +++ b/src/mongo/db/pipeline/expression_context.cpp @@ -62,6 +62,11 @@ ExpressionContext::ExpressionContext(OperationContext* opCtx, _ownedCollator = std::move(collator); _resolvedNamespaces = std::move(resolvedNamespaces); uuid = std::move(collUUID); + if (request.getRuntimeConstants()) { + variables.setRuntimeConstants(request.getRuntimeConstants().get()); + } else { + variables.generateRuntimeConstants(opCtx); + } } ExpressionContext::ExpressionContext(OperationContext* opCtx, const CollatorInterface* collator) @@ -170,6 +175,9 @@ intrusive_ptr<ExpressionContext> ExpressionContext::copyWith( expCtx->_resolvedNamespaces = _resolvedNamespaces; + expCtx->variables = variables; + expCtx->variablesParseState = variablesParseState.copyWith(expCtx->variables.useIdGenerator()); + // Note that we intentionally skip copying the value of '_interruptCounter' because 'expCtx' is // intended to be used for executing a separate aggregation pipeline. |