• Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Latest master have a query-regression. Seems to be introduced by https://github.com/realm/realm-core/commit/fd78c1710a3b2a42a1914162ef1572f5362b9fcf

      The now-failing Realm Java test is:

      public class TestClass2 extends RealmObject {
              @PrimaryKey
              public long id;
      
              public TestClass2 child;
      
              @LinkingObjects("child")
              private final RealmResults<TestClass2> parents = null;
          }
      
          @Test
          public void coreQueryRegression2() {
              realm.beginTransaction();
      
              TestClass2 o1 = new TestClass2();
              o1.id = 1L;
              o1.child = o1;
              TestClass2 o1Managed = realm.copyToRealm(o1);
      
              TestClass2 o2 = new TestClass2();
              o2.id = 2L;
              o2.child = o2;
      
              TestClass2 o2managed = realm.copyToRealmOrUpdate(o2);
      
              TestClass2 o3 = new TestClass2();
              o3.id = 3L;
              o3.child = null;
              realm.copyToRealm(o3);
      
              realm.commitTransaction();
      
              RealmResults<TestClass2> all = realm.where(TestClass2.class).findAll();
              assertEquals(3, all.size());
      
              RealmQuery<TestClass2> empty = realm.where(TestClass2.class)
                      .rawPredicate("child.@links.TestClass2.child.@size == 0");
              
              assertEquals(1, empty.count()); // Test fails as the above query matches no entities
          }
      

            Assignee:
            james.stone@mongodb.com James Stone
            Reporter:
            claus.rorbech@mongodb.com Claus Rørbech (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: