Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

matejk
Copy link
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
147 checks passed
@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
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant