[SERVER-54741] Add overload with consts to Expression walk for read-only usage Created: 24/Feb/21  Updated: 04/Jun/21  Resolved: 04/Jun/21

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jacob Evans Assignee: Hana Pearlman
Resolution: Done Votes: 0
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The existing Expression walk always operates with visit methods that take 'Expression*' and allows replacement of the current Expression node. We should add an overload which accepts walkers with 'const Expression&' visit methods and disallows node replacement for read-only use cases.

When we work on this ticket and modify the entrypoint to the walk function we should consider changing the mutable walk syntax from

if (auto changed = walk(&walker, root.get()))
    root = changed.release();

to something like

root = walk(&walker, std::move(root));



 Comments   
Comment by Githook User [ 04/Jun/21 ]

Author:

{'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}

Message: SERVER-54741: Extend expression walker to support read-only use cases
Branch: master
https://github.com/mongodb/mongo/commit/23a2da00df0c39a5292e3fc51e7e9bbfb9b12318

Comment by Githook User [ 04/Jun/21 ]

Author:

{'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}

Message: SERVER-54741: Extend expression walker to support read-only use cases
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/7cd076c959c2a875e19c3e55680f54ba492f7da4

Generated at Thu Feb 08 05:34:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.