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

Generalize jstests/aggregation/expressions/set.js for SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • 200
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      The test verifies the error code of several set operations, including $setUnion.

      const operators = [
          ["$setUnion", 17043],
      ...
      ];
      
      for (const [operator, errorCodes] of operators) {
      ...
              assertErrorCode(coll, [{$project: {output: {[operator]: ["$arr1", "$arr2"]}}}], errorCodes);
      ...
      }
      

      The test expects this failure:

      src/mongo/db/exec/expression/evaluate_array.cpp
              uassert(17043,
                      str::stream() << "All operands of $setUnion must be arrays. One argument"
                                    << " is of type: " << typeName(newEntries.getType()),
      

      An equivalent uassert exists in SBE:

      src/mongo/db/query/stage_builder/sbe/gen_expression.cpp
                          makeABTFail(ErrorCodes::Error{7158100},
                                      str::stream()
                                          << "All operands of $" << operatorName << " must be arrays."),
      

      The test should be updated to expect this also.

            Assignee:
            james.harrison@mongodb.com James Harrison
            Reporter:
            james.harrison@mongodb.com James Harrison
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: