Skip to content

Commit 134f891

Browse files
committed
value: implement cass_value_get_bytes for varints
Integration tests make use of cass_value_get_bytes function to retrieve varint value from row. This needs to implemented to make these tests pass.
1 parent 2bda46f commit 134f891

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scylla-rust-wrapper/src/query_result.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,11 @@ pub unsafe extern "C" fn cass_value_get_bytes(
11701170
*output = bytes.as_ptr() as *const cass_byte_t;
11711171
*output_size = bytes.len() as u64;
11721172
}
1173+
Some(Value::RegularValue(CqlValue::Varint(varint))) => {
1174+
let bytes = varint.as_signed_bytes_be_slice();
1175+
std::ptr::write(output, bytes.as_ptr());
1176+
std::ptr::write(output_size, bytes.len() as size_t);
1177+
}
11731178
Some(_) => return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE,
11741179
None => return CassError::CASS_ERROR_LIB_NULL_VALUE,
11751180
}

0 commit comments

Comments
 (0)