mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### 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? ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary  This pull request adds a memory usage check for the `maxN` and `minN` accumulators to prevent excessive memory consumption. - `oss/pg_helio_api/src/aggregation/bson_aggregates.c`: Added a memory check to ensure the total size does not exceed the allowed limit, raising an error if it does. - `oss/internal/pg_helio_distributed/src/test/regress/sql/bson_aggregation_pipeline_tests_maxnminn_group.sql`: Added test cases to verify the memory limit enforcement for `maxN` and `minN`. - `oss/internal/pg_helio_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_maxnminn_group.out`: Updated expected output to include error messages for exceeding memory limits. - `pgmongo/src/test/helio_compat/expected/bson_aggregation_pipeline_tests_maxnminn_group.out`: Updated expected output to include error messages for exceeding memory limits.