Skip to content

Commit 405064c

Browse files
committed
Deserialize: don't use i64 for Counter column
We have a dedicated type for that and such deserialization decreases type safety.
1 parent 1ec6020 commit 405064c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

scylla-cql/src/types/deserialize/row_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn test_tuple_errors() {
320320
assert_matches!(
321321
&err.kind,
322322
super::super::value::BuiltinTypeCheckErrorKind::MismatchedType {
323-
expected: &[ColumnType::BigInt, ColumnType::Counter]
323+
expected: &[ColumnType::BigInt]
324324
}
325325
);
326326
}

scylla-cql/src/types/deserialize/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl_emptiable_strict_type!(
207207
impl_fixed_numeric_type!(i8, TinyInt);
208208
impl_fixed_numeric_type!(i16, SmallInt);
209209
impl_fixed_numeric_type!(i32, Int);
210-
impl_fixed_numeric_type!(i64, [BigInt | Counter]);
210+
impl_fixed_numeric_type!(i64, BigInt);
211211
impl_fixed_numeric_type!(f32, Float);
212212
impl_fixed_numeric_type!(f64, Double);
213213

scylla-cql/src/types/deserialize/value_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ fn test_set_or_list_errors() {
12841284
assert_matches!(
12851285
err.kind,
12861286
BuiltinTypeCheckErrorKind::MismatchedType {
1287-
expected: &[ColumnType::BigInt, ColumnType::Counter]
1287+
expected: &[ColumnType::BigInt]
12881288
}
12891289
);
12901290
}
@@ -1363,7 +1363,7 @@ fn test_map_errors() {
13631363
assert_matches!(
13641364
err.kind,
13651365
BuiltinTypeCheckErrorKind::MismatchedType {
1366-
expected: &[ColumnType::BigInt, ColumnType::Counter]
1366+
expected: &[ColumnType::BigInt]
13671367
}
13681368
);
13691369
}
@@ -1527,7 +1527,7 @@ fn test_tuple_errors() {
15271527
assert_matches!(
15281528
err.kind,
15291529
BuiltinTypeCheckErrorKind::MismatchedType {
1530-
expected: &[ColumnType::BigInt, ColumnType::Counter]
1530+
expected: &[ColumnType::BigInt]
15311531
}
15321532
);
15331533
}

0 commit comments

Comments
 (0)