mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes; yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support `collation` with query operator using an internal UDF: ``` bson_query_match(document bson, query bson, collationString text, variableSpec bson) ``` Enable feature with `EnableCollationAndLetForQueryMatch` GUC. Collation on sharded collections with collation-aware shard keys not supported yet. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds collation support for query operators in the engine. - `query_operator.c`: Added logic to handle collation strings in BSON query operators and expanded function to support collation and variable specifications. - `metadata_cache.c`: Introduced a new function to get the OID of `bson_query_match` with collation and let arguments. - `feature_flag_configs.c`: Added a new feature flag to enable collation and let for write commands. - `bson_query_match--0.102.sql` and `bson_query_match--latest.sql`: Added new SQL functions to support collation in BSON queries. - `documents_planner.c`: Updated planner to recognize and handle the new collation and let functionality in queries. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
14 lines
562 B
PL/PgSQL
14 lines
562 B
PL/PgSQL
#include "udfs/metadata/list_databases--0.102-0.sql"
|
|
#include "udfs/ttl/ttl_support_functions--0.102-0.sql"
|
|
#include "udfs/commands_diagnostic/current_op--0.102-0.sql"
|
|
#include "udfs/query/bson_query_match--0.102-0.sql"
|
|
|
|
-- Schedule TTL Cron job to prune TTL indexes on every documentdb instance.
|
|
DO LANGUAGE plpgsql $cmd$
|
|
BEGIN
|
|
IF NOT EXISTS(SELECT 1 FROM cron.job where jobname = 'documentdb_ttl_task') THEN
|
|
PERFORM cron.schedule('documentdb_ttl_task', '* * * * *', $$CALL documentdb_api_internal.delete_expired_rows();$$);
|
|
END IF;
|
|
END;
|
|
$cmd$;
|