Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-802

Set<Mixed> should not consider string and binary data equivilent

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      The MongoDB behaviour is to consider a string and a binary different even if they contain the same data, but in a Realm Set<Mixed> they are considered the same. Realm should align to the MongoDB behaviour. In practice this should be a rare case because most strings have a null byte at the end while binaries do not.

       

      Set<Mixed> set;
      set.insert(StringData("abc", 3));
      set.insert(BinaryData("abc", 3));
      REALM_ASSERT(set.size() == 2); // currently fails with size of 1
      

      This change will require a file format bump, but no data migration will be needed.

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            james.stone@mongodb.com James Stone
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: