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

Query not restore float as float after "Fix loss of precision encoding..." #221

Closed
Dushistov opened this issue Jun 1, 2024 · 1 comment

Comments

@Dushistov
Copy link
Contributor

Before #207

if save document like this into couchbase-lite database:

        FLEncoder_BeginDict(enc, 1);
        FLEncoder_WriteKey(enc, FLSTR("float"));
        FLEncoder_WriteFloat(enc, 1.5f);
        FLEncoder_EndDict(enc));

and then run query like this SELECT float FROM _default,

then such asserts were passed without any problem:

            FLValue val = FLArrayIterator_GetValue(&e->columns);
            REQUIRED(kFLNumber == FLValue_GetType(val));
            REQUIRED(!FLValue_IsDouble(val));

but after #207 , last test failed REQUIRED(!FLValue_IsDouble(val)).
So I got double instead of float after #207.

Is this expected behaviour?

full_test_code.zip

Dushistov pushed a commit to Dushistov/couchbase-lite-rust that referenced this issue Jun 2, 2024
Dushistov pushed a commit to Dushistov/couchbase-lite-rust that referenced this issue Jun 4, 2024
@snej
Copy link
Contributor

snej commented Jun 6, 2024

It sounds like the first code block is part of saving a Couchbase Lite document, and the second is after a query that returns data from that document?

Sounds like, if this is a bug, it's something to do with LiteCore, not Fleece.

@snej snej closed this as completed Jun 6, 2024
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

No branches or pull requests

2 participants