Skip to content

Commit

Permalink
fix: make_empty_query_result correct match arms (#13)
Browse files Browse the repository at this point in the history
# Rationale for this change

Recently it was observed that a function within the
verifiable_query_result file has an incorrect type mapping:

```rust
fn make_empty_query_result<S: Scalar>(result_fields: Vec<ColumnField>) -> QueryResult<S> {
    let table = OwnedTable::try_new(
        result_fields
            .iter()
            .map(|field| {
                (
                    field.name(),
                    match field.data_type() {
                        ColumnType::Boolean => OwnedColumn::Boolean(vec![]),
                        ColumnType::SmallInt => OwnedColumn::SmallInt(vec![]),
                        // needs to map to Int
                        ColumnType::Int => OwnedColumn::SmallInt(vec![]),
                        ...
                    },
                )
            })
            .collect(),
    )?;
    Ok(QueryData {
        table,
        verification_hash: Default::default(),
    })
}
```

# What changes are included in this PR?

Mapping is adjusted to correct type.

# Are these changes tested?

Yes.
  • Loading branch information
Dustin-Ray authored Jun 14, 2024
1 parent 1ed302b commit 5c70a3d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn make_empty_query_result<S: Scalar>(result_fields: Vec<ColumnField>) -> QueryR
match field.data_type() {
ColumnType::Boolean => OwnedColumn::Boolean(vec![]),
ColumnType::SmallInt => OwnedColumn::SmallInt(vec![]),
ColumnType::Int => OwnedColumn::SmallInt(vec![]),
ColumnType::Int => OwnedColumn::Int(vec![]),
ColumnType::BigInt => OwnedColumn::BigInt(vec![]),
ColumnType::Int128 => OwnedColumn::Int128(vec![]),
ColumnType::Decimal75(precision, scale) => {
Expand Down

0 comments on commit 5c70a3d

Please sign in to comment.