Files
documentdb/pg_helio_api
Duan Pei✨ ce79fc0ac5 Merged PR 1501001: [Fix] add memory check for maxN/minN accumulator
### 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
![image (2).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1501001/attachments/image%20%282%29.png)
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.
2024-11-04 17:14:58 +08:00
..