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

Converting BinData of type ByteArrayDeprecated from KeyString -> BSON -> KeyString returns a different KeyString

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      diff --git a/src/mongo/db/storage/key_string_test.cpp b/src/mongo/db/storage/key_string_test.cpp
      index 23285183ec..fee6b276b4 100644
      --- a/src/mongo/db/storage/key_string_test.cpp
      +++ b/src/mongo/db/storage/key_string_test.cpp
      @@ -306,6 +306,10 @@ TEST_F(KeyStringBuilderTest, Simple1) {
               }                                                                  \
           } while (0)
       
      +TEST_F(KeyStringBuilderTest, DeprecatedBinData) {
      +    ROUNDTRIP(version, BSON("" << BSONBinData(nullptr, 0, ByteArrayDeprecated)));
      +}
      +
       TEST_F(KeyStringBuilderTest, ActualBytesDouble) {
           // just one test like this for utter sanity
      
      

      Show
      diff --git a/src/mongo/db/storage/key_string_test.cpp b/src/mongo/db/storage/key_string_test.cpp index 23285183ec..fee6b276b4 100644 --- a/src/mongo/db/storage/key_string_test.cpp +++ b/src/mongo/db/storage/key_string_test.cpp @@ - 306 , 6 + 306 , 10 @@ TEST_F(KeyStringBuilderTest, Simple1) { } \ } while ( 0 )   +TEST_F(KeyStringBuilderTest, DeprecatedBinData) { + ROUNDTRIP(version, BSON( "" << BSONBinData(nullptr, 0 , ByteArrayDeprecated))); +} + TEST_F(KeyStringBuilderTest, ActualBytesDouble) { // just one test like this for utter sanity
    • Sprint:
      Execution Team 2019-10-21
    • Linked BF Score:
      50

      Description

      SERVER-41994 changed the way we convert KeyString to BSON objects for BinData of type ByteArrayDeprecated. Creating the BSONElement for this type will now try to fix previously improperly made ByteArrayDeprecated elements by the shell. However, this causes a different KeyString to be created when converting from KeyString -> BSON -> KeyString for this type.

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gregory.wlodarek Gregory Wlodarek
              Reporter:
              gregory.wlodarek Gregory Wlodarek
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: