Conversation
The alias rewrite before the parse replaced each alias that stands between whitespace, also inside a quoted value. Title eq "salt and pepper" compared with "salt && pepper". Read the aliases only in the grammar, so a quoted value does not change. The query-name rewrite accepts a comparison alias after the query name. BREAKING CHANGE: with custom operator aliases, alias text inside a quoted value is no longer replaced with its operator. The filter compares with the value as written.
pdevito3
force-pushed
the
fm/qk-breaking-alias-in-value
branch
from
October 1, 2026 21:37
1b22df7 to
f59a9a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 alias rewrite to keep v1.x compatible (restore commit
f5209e5). This PR re-applies39312a1. The captain decides on this PR separately.Summary
ParseFilterno longer runsReplaceLogicalAliasesandReplaceComparisonAliaseson the whole input before the parse. These two methods are removed.name eq "x"), because the aliases are not replaced yet when it runs.v1.14.2 behavior (and main)
The rewrite before the parse replaces every alias that stands between whitespace with its operator. It does not know about quotes, so it also changes the text inside a quoted value.
New behavior
An alias is an operator only where the grammar expects an operator. A quoted value keeps its text.
Example
x => ((x.Title == "salt && pepper || == gt") AndAlso (x.Rating > 3)).x => ((x.Title == "salt and pepper or eq gt") AndAlso (x.Rating > 3)).Justification
A quoted value is data. The parser must not change it. With the old rewrite, a caller with word aliases (
and,or,eq) cannot search for a value that holds one of these words.Migration
None for most callers. A caller that relied on the rewrite inside a quoted value must write the canonical operator in the value.
README
The Custom Operators section now tells that operator text inside a quoted value does not change.
Tests
These tests come back from main before #134:
OperatorAliasTests.alias_text_inside_quoted_value_is_replaced->alias_text_inside_quoted_value_is_not_replacedOperatorAliasTests.case_insensitive_alias_text_inside_quoted_value_is_replaced->case_insensitive_alias_text_inside_quoted_value_is_not_replacedOperatorAliasTests.can_use_alias_operator_with_query_name_and_alias_text_in_the_value_is_replaced->can_use_alias_operator_with_query_nameFilterParsingRegressionTests.operator_alias_text_inside_quoted_value_is_replaced->operator_alias_text_inside_quoted_value_is_kept(Postgres)dotnet test: 470 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main. Main checks only the input length before the parse, and counts the nesting depth in the grammar. So
ParseFilterkeepsEnsureWithinInputLengthand then callsReplaceQueryNamesWithPropertyPaths.