Skip to content

Fix type mapping for derived tsquery parameters - #4058

Merged
roji merged 1 commit into
mainfrom
roji-full-text-type-mapping
Oct 20, 2026
Merged

roji merged 1 commit into
mainfrom
roji-full-text-type-mapping

Conversation

@roji

@roji roji commented Oct 20, 2026

Copy link
Copy Markdown
Member

Capturing a variable typed as NpgsqlTsQueryLexeme (or another tsquery subclass) in a full-text query fails because only the base NpgsqlTsQuery CLR type has a mapping.

Register the built-in subclasses with the existing tsquery mapping, leaving the generic mapping lookup and SQL translation unchanged. Includes mapping coverage for all built-in subclasses and sync/async Matches regression coverage.

The separate empty-query driver failure in #886 remains out of scope.

Fixes: #3041

Register built-in NpgsqlTsQuery subclasses with the existing tsquery mapping and cover mapping lookup and Matches query execution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27b39402-3976-4bec-8473-42859b3dd0db
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The localized change has focused regression coverage and no identified blocking issues; tests were not executed.

No open issues 🎉

What changed in this PR

Fixes #3041 by mapping built-in NpgsqlTsQuery subclasses to the existing PostgreSQL tsquery mapping, without changing SQL translation.

Changes:

  • Registers derived tsquery types.
  • Adds mapping coverage and synchronous/asynchronous Matches regression tests.
  • Leaves the separate empty-query driver issue (#886) out of scope.
File Description
test/​EFCore.PG.Tests/​Storage/​NpgsqlTypeMappingSourceTest.cs Verifies mappings for built-in tsquery types.
test/​EFCore.PG.FunctionalTests/​Query/​Translations/​FullTextSearchTranslationsTest.cs Tests derived parameters, results, and generated SQL.
src/​EFCore.PG/​Storage/​Internal/​NpgsqlTypeMappingSource.cs Registers subclasses with the existing mapping.

Review effort: Balanced

@roji
roji merged commit baa07f7 into main Oct 20, 2026
16 checks passed
@roji
roji deleted the roji-full-text-type-mapping branch October 20, 2026 14:51
roji added a commit that referenced this pull request Oct 20, 2026
Backport #4058 to hotfix/9.0.5. Register the built-in NpgsqlTsQuery subclasses with the existing tsquery mapping and adapt sync/async regression coverage to the 9.0 full-text test fixture.

(cherry picked from commit baa07f7)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 080d9558-9c5e-4d3a-be78-d5b52c37ea3a
roji added a commit that referenced this pull request Oct 20, 2026
Backport #4058, adapting the sync/async regression to the existing Northwind full-text test fixture.

(cherry picked from commit baa07f7)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 40214a4a-3c33-48c2-ad9a-cd1cf0716245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full Text Search method "Matches" fails when not using a string query

2 participants