[SERVER-22931] Redundant assignment of FTSSpec in stage_builder.cpp Created: 02/Mar/16  Updated: 16/Mar/16  Resolved: 04/Mar/16

Status: Closed
Project: Core Server
Component/s: Querying, Text Search
Affects Version/s: None
Fix Version/s: 3.3.3

Type: Bug Priority: Minor - P4
Reporter: J Rassi Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The assignment on line 269 in db/query/stage_builder.cpp is a no-op and should be removed. Credit to paul.pedersen for spotting this.

258     } else if (STAGE_TEXT == root->getType()) {
259         const TextNode* node = static_cast<const TextNode*>(root);
260         IndexDescriptor* desc =
261             collection->getIndexCatalog()->findIndexByKeyPattern(txn, node->indexKeyPattern);
262         invariant(desc);
263         const FTSAccessMethod* fam =
264             static_cast<FTSAccessMethod*>(collection->getIndexCatalog()->getIndex(desc));
265         invariant(fam);
266 
267         TextStageParams params(fam->getSpec());
268         params.index = desc;
269         params.spec = fam->getSpec();
270         params.indexPrefix = node->indexPrefix;
271         // We assume here that node->ftsQuery is an FTSQueryImpl, not an FTSQueryNoop. In practice,
272         // this means that it is illegal to use the StageBuilder on a QuerySolution created by
273         // planning a query that contains "no-op" expressions. TODO: make StageBuilder::build()
274         // fail in this case (this improvement is being tracked by SERVER-21510).
275         params.query = static_cast<FTSQueryImpl&>(*node->ftsQuery);
276         return new TextStage(txn, params, ws, node->filter.get());
277     }



 Comments   
Comment by Githook User [ 04/Mar/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'cswanson310@gmail.com'}

Message: SERVER-22931 Remove redundant assignment of FTSSpec
Branch: master
https://github.com/mongodb/mongo/commit/943984e0a101c97408abbdd1762a5918cabcfa30

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