Files
documentdb/pg_documentdb
Xiaochun Liang 972d08522a Merged PR 1540691: Fix error in case of onNull type is BSON_TYPE_EOD
### 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
In `db.date_from_string_on_null.aggregate(
            {$project: {date: {$dateFromString: {dateString: "$missing", onNull: "$missing"}}}})` case,
type of onNull would be BSON_TYPE_EOD, which result in error "unknown BSON type code 0". Add special logic in `HandlePreParsedDollarDateFromString` to handle it.

Unit test was added as well.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
Fixes an error when the `onNull` type is `BSON_TYPE_EOD` in the `$dateFromString` operator.
- `oss/pg_documentdb/src/operators/bson_expression_date_operators.c`: Added a check to return directly if `onNull` type is `BSON_TYPE_EOD`.
- `oss/internal/pg_helio_distributed/src/test/regress/expected/bson_aggregation_date_operators_tests.out` and `oss/internal/pg_helio_distributed/src/test/regress/sql/bson_aggregation_date_operators_tests.sql`: Added test cases to validate the fix.
2025-01-15 07:48:40 +00:00
..