-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Queries with multiple OR statements does not work on RLMArrays #1725
Comments
@dzz0615, would it be possible to provide us with a sample project that demonstrates the deviation from expected results? That would make it much easier to track down what's going on. Thanks! |
This is possibly related, I recently noticed what seems to be a problem with OR queries as well, but it only seemed to happen after a certain combination of updates.
would return expected the results expected initially but after updating some properties and deleting a record the same queries no longer returns the expected results. As expected the priority that was deleted, is no longer returned, what is strange is that an additional record is also not returned even though its properties still match the query.
The above two queries as well as accessing self.priorities will return expected results, which led me to believe the problem might lie with the OR operand. I am still investigating. |
@nacrossweb if you could share your project (or another that reproduces the issue) with us (you can do so privately at help@realm.io if you prefer) would be incredibly helpful. |
@segiddins I managed to track this down. Now that I have I am less sure if it is the same problem but it is definitely a bug. It seems to be some how connected to the deletion of the first child in an RLMArray, after this child is deleted subsequent OR queries give unreliable results. If you dump this gist into an empty project you should be able to see what I mean. Deleting any other child will not trigger the bug. |
@nacrossweb thanks! We've seen some bugs in that scenario before, I'll dig into the repro case on Monday. |
After looking through the Core's history, I can see that we potentially have a fix in the pipeline. |
I can confirm this bug is still an issue, and have made a ticket for our core team. Thanks @nacrossweb ! |
This was fixed in 0.92.3. |
Here's my use case, I have a pretty big RLMArrays of contacts, I'm trying to implement search through the list of contacts.
Right now my contacts schema contains: firstname, lastname, email.
My query is: "firstname BEGINSWITH[c] %@ OR lastname BEGINSWITH[c] %@ OR email BEGINSWITH[c] %@". However, this always seem to reproduce incomplete results.
If I cut the query down to just one field, e.g. "firstname BEGINSWITH[c] %@", without any OR statements, it works as intended.
I also tried different comparators like "CONTAINS" and with/without case insensitivity, it doesn't make any difference.
I can reproduce this issue on both iOS and Android, so seems like an realm core issue.
The text was updated successfully, but these errors were encountered: