Files
documentdb/pg_documentdb/sql/udfs/query/bson_query_match--latest.sql
T
Cornelius Boateng 6e39f125d0 Merged PR 1591206: [engine][collation] Collation Support for Query Match Unsharded
### Does this PR have any customer impact?

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)

### Are you introducing any new config? If yes, do you have tests with and without them being set?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Change signature of `bson_query_match` with `let` and `collation` support to match other internal functions.

Fix schema name for pgmongo.

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Collation support for query match in unsharded collections.

#### PR Summary
This pull request adds collation support for query match operations in unsharded collections, ensuring proper collation enforcement.
- Modified `bson_query_match` function calls in `/pgmongo/src/test/docdb_compat/expected/bson_dollar_ops_collation_tests_runtime.out` to adjust collation parameters.
- Updated collation parameters in `bson_query_match` function calls in `/oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_dollar_ops_collation_tests_runtime.out`.
- Adjusted SQL test cases in `/oss/internal/pg_documentdb_distributed/src/test/regress/sql/bson_dollar_ops_collation_tests_runtime.sql` to reflect new collation support.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #3914004
2025-03-18 21:57:32 -07:00

24 lines
975 B
SQL

CREATE OR REPLACE FUNCTION __API_CATALOG_SCHEMA__.query_match_support(internal)
RETURNS internal
LANGUAGE c
IMMUTABLE PARALLEL SAFE STRICT
AS 'MODULE_PATHNAME', $$query_match_support$$;
CREATE OR REPLACE FUNCTION __API_CATALOG_SCHEMA__.bson_query_match(__CORE_SCHEMA__.bson, __CORE_SCHEMA__.bson)
RETURNS bool
LANGUAGE c
IMMUTABLE PARALLEL SAFE STRICT
SUPPORT __API_CATALOG_SCHEMA__.query_match_support
AS 'MODULE_PATHNAME', $function$bson_query_match$function$;
CREATE OR REPLACE FUNCTION __API_CATALOG_SCHEMA__.bson_true_match(__CORE_SCHEMA__.bson)
RETURNS bool
LANGUAGE c
IMMUTABLE PARALLEL SAFE STRICT
AS 'MODULE_PATHNAME', $function$bson_true_match$function$;
CREATE OR REPLACE FUNCTION __API_SCHEMA_INTERNAL_V2__.bson_query_match(document __CORE_SCHEMA__.bson, query __CORE_SCHEMA__.bson, variableSpec __CORE_SCHEMA__.bson, collationString text)
RETURNS bool
LANGUAGE c
IMMUTABLE PARALLEL SAFE
AS 'MODULE_PATHNAME', $function$bson_query_match$function$;