Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Catch sqlite exceptions when filter entities #6601
Catch sqlite exceptions when filter entities #6601
Changes from all commits
1810c8d
565f8c2
ca26c40
350be92
6216dd6
eb66fa8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
works correctly in the optimized way
-- what makes it optimized? This looks like it fell through which I thought would be non-optimized.This test looks identical to https://github.com/getodk/collect/pull/6601/files#diff-4a25b4c0ba0780186c2edabe26d8518d4e3e6a022a482669373e2a71ceac6dfbR585 to me
In this test
not_existing_property
is the reference in the secondary instance and'value'
is a static value.In the test above,
undefined
is the reference in the secondary instance and/data/ref_question
is a static value that came from the form.It's confusing because the order is different and the intended meaning is different! But I believe that from the system's standpoint they should be in the same category. If there's code somewhere that treats them as different we should dig into it, I think.
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.
I made a mistake in the title it's not optimized of course. I will fix that.
If you set
not_existing_property='value'
, it will always return an empty list of entities (becausenot_existing_property
does not exist).However, if you use
undefined=/data/ref_question
or'value'=/data/ref_question
(because we focus too much on theundefined
case), the list won't be empty - as long as the expected value matches the one entered in the question.Wouldn't it be enough to treat these two cases as distinct and have separate tests for each?
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.
And with
not_existing_property=''
, you should always get all Entities. That's the same as theundefined=/data/ref_question
case when/data/ref_question
has a blank value.I sort of see the distinction that you're making, thanks for explaining it again, that was helpful. It doesn't hurt to have a few extra tests and I don't think there's a fundamental misunderstanding here. 👍
This one does definitely feel different from the other two to me. This should be identified as not an expression that can use the optimized filter strategy and bypass before it even gets there (maybe good to double check this?). The other two should be identified as candidates for the filter strategy and then be kicked back to the next one once the column is determined to be unknown.
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.
Correct.
Right, these cases throw an SQLiteException because of the missing columns:
undefined=/data/ref_question
null=/data/ref_question
not_existing_property=""
not_existing_property="value"
These cases are identified as not an expression that can use the optimized:
'value'=/data/ref_question
''=/data/ref_question