diff --git a/scylla/src/transport/connection.rs b/scylla/src/transport/connection.rs index 6d8af2aeb5..1a1a029dbe 100644 --- a/scylla/src/transport/connection.rs +++ b/scylla/src/transport/connection.rs @@ -256,14 +256,15 @@ impl NonErrorQueryResponse { } pub(crate) fn into_query_result(self) -> Result { - let (rows, paging_state, col_specs, serialized_size) = match self.response { + let (rows, paging_state, table_spec, col_specs, serialized_size) = match self.response { NonErrorResponse::Result(result::Result::Rows(rs)) => ( Some(rs.rows), rs.metadata.paging_state, + rs.metadata.table_spec, rs.metadata.col_specs, rs.serialized_size, ), - NonErrorResponse::Result(_) => (None, None, vec![], 0), + NonErrorResponse::Result(_) => (None, None, None, vec![], 0), _ => { return Err(QueryError::ProtocolError( "Unexpected server response, expected Result or Error", @@ -276,6 +277,7 @@ impl NonErrorQueryResponse { warnings: self.warnings, tracing_id: self.tracing_id, paging_state, + table_spec, col_specs, serialized_size, }) diff --git a/scylla/src/transport/query_result.rs b/scylla/src/transport/query_result.rs index 1d17b93ad9..9acff773f5 100644 --- a/scylla/src/transport/query_result.rs +++ b/scylla/src/transport/query_result.rs @@ -3,6 +3,7 @@ use crate::frame::response::result::ColumnSpec; use crate::frame::response::result::Row; use crate::transport::session::{IntoTypedRows, TypedRowIter}; use bytes::Bytes; +use scylla_cql::frame::response::result::TableSpec; use thiserror::Error; use uuid::Uuid; @@ -21,6 +22,8 @@ pub struct QueryResult { pub tracing_id: Option, /// Paging state returned from the server pub paging_state: Option, + /// Table specification returned from the server + pub table_spec: Option, /// Column specification returned from the server pub col_specs: Vec, /// The original size of the serialized rows in request @@ -300,6 +303,7 @@ mod tests { warnings: vec![], tracing_id: None, paging_state: None, + table_spec: None, col_specs: vec![column_spec], serialized_size: 0, }