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

[C-API] Querying on Decimal128 field with value NaN does not find objects #6182

Closed
rorbech opened this issue Jan 9, 2023 · 0 comments · Fixed by #6184
Closed

[C-API] Querying on Decimal128 field with value NaN does not find objects #6182

rorbech opened this issue Jan 9, 2023 · 0 comments · Fixed by #6184
Assignees

Comments

@rorbech
Copy link
Contributor

rorbech commented Jan 9, 2023

Performing a query on a Decimal128 field with value NaN does not match object with NaN values for that fields.

Expected results

The following model and test should yield a query result with one object:

class Decimal128Object : RealmObject {
    var decimal128Field : Decimal128
}

fun test() {
    realm.write {
        copyToRealm(Decimal128Object().apply { decimal128Field = Decimal128.NaN })
    }
    assertEquals(1, realm.query<Decimal128Object>("decimal128Field = $0", Decimal128.NaN).find().size)

From the corresponding test in realm-java it seems that we should be able to query objects by Decimal128.NaN
https://github.com/realm/realm-java/blob/master/realm/realm-library/src/androidTest/kotlin/io/realm/Decimal128Tests.kt#L284

Actual Results

The query results are not holding any objects

Steps & Code to Reproduce

The test in Realm Kotlin in https://github.com/realm/realm-kotlin/blob/gagik/decimalsupport/packages/test-base/src/androidAndroidTest/kotlin/io/realm/kotlin/test/shared/Decimal128Tests.kt#L35 is failing, but only for the NaN and NEGATIVE_NaN values.

I have verified that the object written is in fact holding the right value by opening the realm file in Realm Studio and from debugging it also seems like the query argument is transferred correctly into Core.

Core version

Core version: 13.1.2

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants