Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RQL IN-operator broken on master #7642

Closed
nielsenko opened this issue Apr 29, 2024 · 4 comments · Fixed by #7650
Closed

RQL IN-operator broken on master #7642

nielsenko opened this issue Apr 29, 2024 · 4 comments · Fixed by #7650

Comments

@nielsenko
Copy link
Contributor

As discussed Friday on slack.

The test:

test('Query on RealmSet with IN-operator', () {
    var config = Configuration.local([TestRealmSets.schema, Car.schema]);
    var realm = getRealm(config);

    final cars = [Car("Tesla"), Car("Ford"), Car("Audi")];
    final testSets = TestRealmSets(1)..objectsSet.addAll(cars);

    realm.write(() {
      realm.add(testSets);
    });
    final result = testSets.objectsSet.query(r'make IN $0', [
      ['Tesla', 'Audi']
    ]);
    expect(result.length, 2);
  });

fails with:

00:00 +0 -1: Query on RealmSet with IN-operator [E]
  Expected: <2>
    Actual: <0>

  package:matcher                 expect
  test/realm_set_test.dart 810:5  main.<fn>

when using head of master on realm-core, ie:
* 8e4887f87 (HEAD -> master, origin/master, origin/HEAD) RCORE-2098: Fix issue with OR of two IN queries (#7628)

Copy link

sync-by-unito bot commented Apr 29, 2024

➤ PM Bot commented:

Jira ticket: RCORE-2102

@nielsenko
Copy link
Contributor Author

nielsenko commented Apr 29, 2024

This is not fixed by je/query-in (#7629) as it looks currently:

* fe11cb88f (HEAD -> je/query-in, origin/je/query-in) Make 'Any' default when using the 'IN' operator

@nielsenko
Copy link
Contributor Author

Running with full log on the realm.storage.query category yields:

dart test test/realm_set_test.dart -n "IN-operator"
00:00 +0: (setUpAll)
Current GroupID 662a460ad73ee0cbb7997c27
Validating initial sync for 662a460ad73ee0cbb7997c34 is complete...
Initial sync for flexible is complete.
Validating initial sync for 662a460fd73ee0cbb7997e8c is complete...
Initial sync for staticSchema is complete.
Current PID 25271; OS macos, 64 bit, CPU arm64
00:00 +0 -1: Query on RealmSet with IN-operator [E]
  Expected: <2>
    Actual: <0>

  package:matcher                 expect
  test/realm_set_test.dart 814:5  main.<fn>

(category: Realm.Storage, level: LogLevel.detail, message: DB: 2081 Thread 0x16de5b000: Open file: /var/folders/8p/4znrjyy500q5qtyknc6jmm9h0000gp/T/realm_test_BALJd1/mcethcczxg.realm)
(category: Realm.Storage.Query, level: LogLevel.debug, message: DB: 2081 Thread 0x16de5b000: Query count: 'make IN {"Tesla", "Audi"} VIEW { 3 element(s) }', limit = -1)
(category: Realm.Storage.Query, level: LogLevel.debug, message: DB: 2081 Thread 0x16de5b000: Query matches: 0, Duration: 9 us)
(category: Realm.Storage.Query, level: LogLevel.debug, message: DB: 2081 Thread 0x16de5b000: Query count: 'make IN {"Tesla", "Audi"} VIEW { 3 element(s) }', limit = -1)
(category: Realm.Storage.Query, level: LogLevel.debug, message: DB: 2081 Thread 0x16de5b000: Query matches: 0, Duration: 4 us)
(category: Realm.Storage, level: LogLevel.detail, message: DB: 2081 Thread 0x16de5b000: DB closed)

To run this test again: /Users/kasper/.puro/envs/stable/flutter/bin/cache/dart-sdk/bin/dart test test/realm_set_test.dart -p vm --plain-name 'Query on RealmSet with IN-operator'
00:00 +0 -1: Some tests failed.

Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
For example, 'dart test --chain-stack-traces'.

@ironage ironage mentioned this issue Apr 30, 2024
4 tasks
@nielsenko
Copy link
Contributor Author

This is fixed by @ironage's PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant