I have two documents in my test database:
{“name”: “Rudolf”}
{“name”: “Rudolf”, “email”: “example.com”}
This is the query I’m trying to run:
SELECT name, email where name ="Rudolf"
I get this error and the app crashes.
4:11:00.949073| [Query]: {Query#9} Compiling N1QL query: SELECT name, email where name =“Rudolf”
04:11:00.950533| [Query]: {QueryEnum#10}==> class litecore::SQLiteQueryEnumerator 000001DA72455E40 @000001DA72455E40
04:11:00.950977| [Query]: {QueryEnum#10} Created on {Query#7} with 2 rows (44 bytes) in 0.324ms
04:11:00.951288| [Query]: {Query#9} Compiled as SELECT fl_result(fl_value(_doc.body, ‘name’)), fl_result(fl_value(_doc.body, ‘email’)) FROM kv_default AS _doc WHERE (fl_value(_doc.body, ‘name’) = ‘Rudolf’) AND (_doc.flags & 1 = 0)
FAILED ASSERTIONn == 2*_count
in class fleece::impl::internal::HeapArray *__cdecl fleece::impl::internal::HeapDict::kvArray(void) (at HeapDict.cc line 216)
04:11:00.952932| [Query]: {QueryEnum#11}==> class litecore::SQLiteQueryEnumerator 000001DA72455F20 @000001DA72455F20
04:11:00.953306| [Query]: {QueryEnum#11} Created on {Query#9} with 2 rows (44 bytes) in 0.292ms
04:11:00.953700| [Query]: {LiveQuerier#8} Results changed at seq 32 (5.165ms)
Lost connection to device.
These queries work as expected, the error seems to happen only if some of the documents are missing some of the fields.
SELECT name WHERE name =“Rudolf”
SELECT * WHERE name =“Rudolf”