mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### 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? ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description - Invalidate Collection cache trigger was missing in OSS - Explain should show IXScan if the index had object_id - ErrCode 16020 should be Location16020 and not EXPRESSIONTAKESEXACTLYNARGS - row_get_bson should be prefixed with schema. ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request addresses several bugs identified from OSS and incidents, including updates to SQL functions, error codes, and triggers. - Added new SQL functions and triggers in `collection_metadata_functions--1.23-0.sql` and updated `collection_metadata_functions--latest.sql`. - Modified `PostgresExplainHelper.cs` to refine the condition for reporting `COLLSCAN`. - Updated error codes in `helio_errors.h`, `mongoerrors.csv`, and `helio_codes.txt`. - Adjusted SQL queries in `users.c` and `create_indexes_background.c` to use `CoreSchemaName`. - Added a new trigger in `collection_metadata--1.23-0.sql` and included it in `pg_helio_api--1.22-0--1.23-0.sql` and `pgmongo--1.22-0--1.23-0.sql`.
29 lines
956 B
PL/PgSQL
29 lines
956 B
PL/PgSQL
|
|
CREATE OR REPLACE FUNCTION __API_SCHEMA_INTERNAL__.__EXTENSION_OBJECT__(_get_next_collection_id)()
|
|
RETURNS bigint
|
|
LANGUAGE c
|
|
STRICT
|
|
AS 'MODULE_PATHNAME', $function$command_get_next_collection_id$function$;
|
|
COMMENT ON FUNCTION __API_SCHEMA_INTERNAL__.__EXTENSION_OBJECT__(_get_next_collection_id)()
|
|
IS 'get next unique collection id to be used in __API_CATALOG_SCHEMA__.collections';
|
|
|
|
CREATE OR REPLACE FUNCTION __API_SCHEMA_INTERNAL__.ensure_valid_db_coll(text, text)
|
|
RETURNS bool
|
|
LANGUAGE c
|
|
STRICT
|
|
AS 'MODULE_PATHNAME', $function$command_ensure_valid_db_coll$function$;
|
|
|
|
CREATE FUNCTION helio_api_internal.collection_update_trigger()
|
|
RETURNS trigger
|
|
LANGUAGE plpgsql
|
|
AS $function$
|
|
BEGIN
|
|
PERFORM helio_api_internal.invalidate_collection_cache();
|
|
RETURN NULL;
|
|
END;
|
|
$function$;
|
|
|
|
CREATE OR REPLACE FUNCTION helio_api_internal.invalidate_collection_cache()
|
|
RETURNS void
|
|
LANGUAGE c
|
|
AS 'MODULE_PATHNAME', $$command_invalidate_collection_cache$$; |