-
Notifications
You must be signed in to change notification settings - Fork 73
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
CBL-6626: SQL++ query not return expected results #2209
base: release/3.2
Are you sure you want to change the base?
Conversation
Code Coverage Results:
|
@snej I see Blob&&subtype==0 is being used in fl_result. I would defer to you whether to accept it as a patch to isNull() function. |
Please also fix fl_result where we only check blob's subtype but not the size. Also for isNull(), size of the blob (being 0) is sufficient. Subtype is secondary. (non-zero size with subtype fleecenull reveals a bug) |
@jianminzhao I've added the fix to I'm unsure about removing the check for |
// Untagged blob with size is already Fleece data | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it equivalent to:
case 0:
case kFleeceNullSubtype:
if (size > 0) break; // untagged blob ...
else {
// Fleece/JSON null
return;
}
The issue which caused the customer's query to not return the correct results is that litecore thinks the null value is not null.
The underlying cause of that is an issue with indexes which causes some values in certain indexes to not be correctly typed as null when passing into the query engine.
So this does not fix the underlying problem, but it is a good workaround that @snej agreed with.
Basically the problematic values do not get given the Null subtype when they should, so our usual check for the null subtype fails. Now, we also check if the size is 0 if the subtype has not been set.