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

Invalid predicate: 'desc CONTAINS[c] $0': syntax error #7705

Closed
Pro-55 opened this issue Jul 18, 2022 · 3 comments
Closed

Invalid predicate: 'desc CONTAINS[c] $0': syntax error #7705

Pro-55 opened this issue Jul 18, 2022 · 3 comments
Assignees

Comments

@Pro-55
Copy link

Pro-55 commented Jul 18, 2022

How frequently does the bug occur?

All the time

Description

The app crashes when the query is run. We have several pojos with field public String desc;.

Stacktrace & log output

Process: in.bizanalyst.debug, PID: 25439
    java.lang.IllegalArgumentException: Illegal Argument: Invalid predicate: 'desc CONTAINS[c] $0': syntax error, unexpected descending in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_TableQuery.cpp line 512
        at io.realm.internal.TableQuery.nativeRawPredicate(Native Method)
        at io.realm.internal.TableQuery.rawPredicateWithPointers(TableQuery.java:185)
        at io.realm.RealmAnyNativeFunctionsImpl.callRawPredicate(RealmAnyNativeFunctionsImpl.java:52)
        at io.realm.internal.TableQuery.containsInsensitive(TableQuery.java:294)
        at io.realm.RealmQuery.contains(RealmQuery.java:1670)
        at io.realm.RealmQuery.contains(RealmQuery.java:1652)
        at in.bizanalyst.dao.InventoryDao.getBySubstrAndStockAvailability(InventoryDao.java:139)
        at in.bizanalyst.adapter.InventoryArrayAdapter.filterResults(InventoryArrayAdapter.java:103)
        at in.bizanalyst.adapter.InventoryArrayAdapter$InventoryFilter.publishResults(InventoryArrayAdapter.java:128)
        at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:284)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7870)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Can you reproduce the bug?

Yes, always

Reproduction Steps

Just need to trigger this query.

Version

10.11.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android [12]

Build environment

Android Studio version: AS Chipmunk | 2021.2.1 Patch 1
Android Build Tools version: 31
Gradle version: 7.1.3

@novecapa
Copy link

novecapa commented Jul 19, 2022

With no internet connection, same error in Realm 10.10.1 and Gradle 7.1.2, but with internet connection the error not appear 🧐

@Pro-55
Copy link
Author

Pro-55 commented Jul 20, 2022

In my case I'm just accessing the local data so its not dependant on the network state.

@rorbech
Copy link
Contributor

rorbech commented Aug 9, 2022

Hi @Pro-55. Thanks for the report. I was able to reproduce and have filed an issue in the query parser.

@sync-by-unito sync-by-unito bot closed this as completed Aug 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants