fix: and-or simple query that contains string literals #10632
Merged
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.
fixes #8354
fixes #8472
fixes #9143
fixes #10542
fixes https://discuss.logseq.com/t/simple-query-errors-on-combination-of-or-and-and-free-text-search-advanced-query-version-works/16897
Result
How and Why
In the case of
(and e1.. (or e2..))
, if a free string is found ine1
ore2
, the formq
will be wrapped one more time inadd-bindings!
:logseq/src/main/frontend/db/query_dsl.cljs
Lines 500 to 508 in 5761f20
(Note
[q]
)This creates a malformed query:
(Note the double
((
)You can more easily check it by
(parse "(and \"foo\" (or \"bar\" \"baz\"))")
.It turns out that there's no need to add yet another
:block/content
, as it is already handled by the(block-content)
rule.