-
Notifications
You must be signed in to change notification settings - Fork 585
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
Trouble query data when query condition has type number on Android #3773
Comments
Hi @DuCaoTien, what is the Realm property type of |
Hi @ironage. Timestamp type is integer |
@DuCaoTien Can you try the same query in Studio? |
Hi @kneth, It works fine when I try the same query in Studio both normal and add " " to cover the number value on statements query. |
Thanks for the info @DuCaoTien, can you confirm if the Android device that is not working is a 32 bit? It looks like you discovered a regression introduced in our new query parser which affects integer constants which use more than 32 bits of storage. It should be addressed by realm/realm-core#4736. But in the meantime, I would recommend passing argument into the query string with argument substitution instead of trying to do the formatting yourself. That would look like this: |
Great. Your idea seems to be correct. I'm working on an emulator 32-bit. I tried to change to a 64-bit and it worked with the old query statements so there is more evidence to confirm that this problem only occurs on 32-bit boards. |
Thanks for confirming the 32 bit issue @DuCaoTien! |
Hi guys! The realm library was so useful for our project. Appreciate your team efforts.
According to what we found out. The feature query with number values did not require quotes (" ") to cover the value. But I don't know why when using the realm version 10.4.0. We can't query data as expected. Two points to note:
Right now, We resolved the trouble by adding quotes (" ") to cover the value like this and it worked:
timestamp >= 1622623523121 AND timestamp <= 162262370312 (not working)
timestamp >= "1622623523121" AND timestamp <= "162262370312" (worked)
Questions:
I. Will there be any trouble if we change all our related codes (add " " to cover the number value on statements query) to solve this problem?
II. Can you explain to me why there is such trouble? (The trouble is only on Android with version realm is 10.4.0. It worked fine on IOS)
Your supports were so helpful to our team. Thanks.
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: