-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.5.3
-
Component/s: Querying
-
Environment:> db.serverBuildInfo()
{
"version" : "2.5.4-pre-",
"gitVersion" : "3b87e21f115188af7b47e7c50486133450a5d029",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "tcmalloc",
"versionArray" : [
2,
5,
4,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}
> db.serverBuildInfo() { "version" : "2.5.4-pre-", "gitVersion" : "3b87e21f115188af7b47e7c50486133450a5d029", "OpenSSLVersion" : "", "sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49", "loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6", "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6", "allocator" : "tcmalloc", "versionArray" : [ 2, 5, 4, -100 ], "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "ok" : 1 }
Problem:
Appears to be a duplication of confirming if an expression is a RegEx. Its the first check in _parseRegexElement which is then checked as the first step of RegexMatchExpression.init()
expression_leaf_parser.cpp:441
StatusWithMatchExpression MatchExpressionParser::_parseRegexElement( const char* name, const BSONElement& e ) { if ( e.type() != RegEx ) return StatusWithMatchExpression( ErrorCodes::BadValue, "not a regex" ); std::auto_ptr<RegexMatchExpression> temp( new RegexMatchExpression() ); Status s = temp->init( name, e.regex(), e.regexFlags() ); if ( !s.isOK() ) return StatusWithMatchExpression( s ); return StatusWithMatchExpression( temp.release() ); }
exprssion_leaf.cpp:201
Status RegexMatchExpression::init( const StringData& path, const BSONElement& e ) { if ( e.type() != RegEx ) return Status( ErrorCodes::BadValue, "regex not a regex" ); return init( path, e.regex(), e.regexFlags() ); }