Skip to content

MongoDB: use constants instead of typed enum in OpMsgMessage#4822

Merged
matejk merged 2 commits intomainfrom
4810-mongodb-opmsg-payload-constants
Dec 17, 2024
Merged

MongoDB: use constants instead of typed enum in OpMsgMessage#4822
matejk merged 2 commits intomainfrom
4810-mongodb-opmsg-payload-constants

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Dec 16, 2024

Some compilers improperly use BinaryWriter::operator << (int) instead of unsigned char for a typed enum, causing the binary structure to become invalid.

The enum is replaced with constants.

See #4810 for discussion.

@matejk matejk added this to the Release 1.14.1 milestone Dec 16, 2024
@matejk matejk self-assigned this Dec 16, 2024
@matejk matejk added the bug label Dec 16, 2024
@matejk matejk changed the title MongoDB: use constants instead of types enum in OpMsgMessage MongoDB: use constants instead of typed enum in OpMsgMessage Dec 16, 2024
@matejk matejk merged commit 3f76ad6 into main Dec 17, 2024
@matejk matejk deleted the 4810-mongodb-opmsg-payload-constants branch December 17, 2024 08:25
matejk added a commit that referenced this pull request Dec 17, 2024
* fix(MongoDB): Use constants for payload types instead of enum to avoid improper binary serialisation with some compilers (int instead of unsigned char).

* enh(MongoDB): Minor code improvements to use string literals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant