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

BSONColumnBuilder can incorrectly start interleaved with no scalars if we transition from arrays to a new empty object

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • v8.0
    • Execution Team 2024-09-02

      Found by the new fuzzer SERVER-92675. The BSONColumnBuilder checks whether new objects have any scalars in them. If the previous element was non-interleaved, it will correctly use this to decide whether to start interleaved or add it as a literal in regular mode. If the previous element was also an object, it will likewise correctly use this to decide whether to start a regular mode or not.

      However, if the previous object was an array, it will always go into interleaved mode, even if there are no scalars to reference from.

      https://github.com/10gen/mongo/blob/7871ee2aa0d3899aa8f6b3826784df96449e5473/src/mongo/bson/util/bsoncolumnbuilder.cpp#L1420

            Assignee:
            binh.vo@mongodb.com Binh Vo
            Reporter:
            binh.vo@mongodb.com Binh Vo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: