Unintended object copying from use of "auto"

XMLWordPrintableJSON

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

      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:
            Joe Shalabi
            Reporter:
            Kevin Cherkauer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: