You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn push(&mut self, value: Value) {
let bs: String = String::from(value);
let l = cmp::min(bs.len(), self.str_len);
let old_len = self.buffer.len();
self.buffer.extend_from_slice(&bs.as_bytes()[0..l]);
self.buffer.resize(old_len + (self.str_len - l), 0_u8);
}
In the case when the string in value is of the correct size, l = self.str_len() and we extend self.buffer with the new string, then we proceed to call self.buffer.resize(old_len, 0u8) which truncates the buffer to what it was before we did the write. We should probably resize starting at the new length, not the old one?
The text was updated successfully, but these errors were encountered:
This line doesn't seem correct to me:
clickhouse-rs/src/types/column/fixed_string.rs
Line 70 in b7f0df4
Let's take a closer look at the implementation:
In the case when the string in value is of the correct size,
l = self.str_len()
and we extendself.buffer
with the new string, then we proceed to callself.buffer.resize(old_len, 0u8)
which truncates the buffer to what it was before we did the write. We should probably resize starting at the new length, not the old one?The text was updated successfully, but these errors were encountered: