Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-95346

Unintended object copying from use of "auto"

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL

      SERVER-82228 introduced unwanted copying through use of "auto" when "auto&" was probably intended.

      E.g. run_aggregate.cpp parsePipelineAndRegisterQueryState() now has line

      auto requestForQueryStats = aggExState.getOriginalRequest(); 

      getOriginalRequest() returns const AggregateCommandRequest& but assigning it to "auto" will drop the "&" and copy the object into requestForQueryStats.

      There may be more similar unintended copies - I just noticed this one.

            Assignee:
            joseph.shalabi@mongodb.com Joe Shalabi
            Reporter:
            kevin.cherkauer@mongodb.com Kevin Cherkauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: