-
Notifications
You must be signed in to change notification settings - Fork 118
Closed
Labels
Description
Bug Report
1. Describe the bug
convert bytes to long error in TiChunkColumnVector#getLongFromBinary
2. Minimal reproduce step (Required)
when one byte of the byte[] < 0, you may get the wrong answer.
For example
// generate byte[]
ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.putLong(255);
byte[] bytes = buffer.array();
// copy the code from getLongFromBinary
long result = 0;
for (byte b : bytes) {
result = (result << 8) | b;
}
// answer is -1 rather than 255
System.out.println(result);
5. What is your Java Client and TiKV version? (Required)
- Client Java: master