-
Notifications
You must be signed in to change notification settings - Fork 181
Fix replication of large decimals #4521
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
Conversation
cf89838
to
d80deb1
Compare
d80deb1
to
ffcbfb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is something wrong. See comments.
Also, concerning approach: wouldn't it be better to serialize/deserialize the 2 words separately. Should be easier to understand. Any reason not to ?
constexpr int bits_per_byte = 7; | ||
using uchar = unsigned char; | ||
char* ptr = buffer; | ||
while (value_0 >> (bits_per_byte - 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems wrong. 1) why the "bits_per_byte-1", 2) isn't there a risk for too early out since value_1 is not part of the condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "bits_per_byte-1" because there should be room for the sign bit in the last byte (always 0 in this case).
- An error - well spotted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps add a comment :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has tests been updated to catch the error Finn spotted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jedelbo Yes, but I was more wondering if you added tests that would have found this error instead of Finn :-)
@finnschiermer it would be a change in the protocol if we changed the way we serialize the values. |
ffcbfb8
to
e0d0e5e
Compare
@jedelbo what was the root-cause for having this issue in the first place? Not creating an issue to fix the "FIXME"? |
@bmunkholm yes, the root cause was me forgetting the FIXME. |
What, How & Why?
Fixes #4519
☑️ ToDos