You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FreeTextTable: query filter of the source entity is applied with an undeclared alias #39686
When the entity passed to FreeTextTable has a global query filter, the filter is appended to the TVF query referencing a table alias that is never declared, so SQL Server rejects the query.
DECLARE @p nvarchar(4000) = N'search';
SELECT [f].[KEY] AS [Key], [f].[RANK] AS [Rank]
FROM FREETEXTTABLE([Posts], *, @p) AS [f]
WHERE [p].[IsDeleted] = CAST(0ASbit)
Executing it fails with The multi-part identifier "p.IsDeleted" could not be bound. Joining the result back to ctx.Posts (the documented pattern) produces the same dangling WHERE after the join.
Expected
Either the filter is not applied to the TVF itself (its rows are keys and ranks, not entities; the filter applies when joining back to the entity set), or it is applied through a correctly aliased join to the table. Today there is no workaround short of IgnoreQueryFilters() on the whole query, which also removes the filter from the join — not acceptable for multi-tenant filters.
Activity
cincuranet commentedon Nov 18, 2026
As a workaround you can use named query filters and ignore only the one for
IsDeleted. Nonetheless it's a bug and will be fixed.