[SERVER-30985] MatchExpressions in matcher/schema/ should override MatchExpression::numChildren() where appropriate Created: 07/Sep/17  Updated: 30/Oct/23  Resolved: 12/Sep/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Major Change
Operating System: ALL
Sprint: Query 2017-10-02
Participants:

 Description   

InternalSchemaObjectMatchExpression does not override MatchExpression::numChildren() which means it will report 0 which is incorrect. We should fix and make sure other schema MatchExpressions are not subject to the same problem.



 Comments   
Comment by Ramon Fernandez Marina [ 12/Sep/17 ]

Author:

{'username': u'jameswahlin', 'name': u'James Wahlin', 'email': u'james@mongodb.com'}

Message:SERVER-30985 Implement numChildren() in InternalSchemaObjectMatchExpression
Branch:master
https://github.com/mongodb/mongo/commit/dec4e20f236803c9a356dd88e95b4e8f27910029

Comment by James Wahlin [ 07/Sep/17 ]

As part of this we could consider adding to the default MatchExpression::numChildren() implementation the following invariant, which would help expose cases where we override getChild() but not numChildren().

invariant(!getChild(0));

Generated at Thu Feb 08 04:25:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.