Skip to content

Commit 97f5408

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 21d8e15 commit 97f5408

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
@@ -1143,6 +1143,11 @@ pub unsafe extern "C" fn cass_value_get_bytes(
11431143
*output = bytes.as_ptr() as *const cass_byte_t;
11441144
*output_size = bytes.len() as u64;
11451145
}
1146+
Some(Value::RegularValue(CqlValue::Varint(varint))) => {
1147+
let bytes = varint.as_signed_bytes_be_slice();
1148+
std::ptr::write(output, bytes.as_ptr());
1149+
std::ptr::write(output_size, bytes.len() as size_t);
1150+
}
11461151
Some(_) => return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE,
11471152
None => return CassError::CASS_ERROR_LIB_NULL_VALUE,
11481153
}

0 commit comments

Comments
 (0)