diff --git a/scylla/src/transport/connection.rs b/scylla/src/transport/connection.rs index 52795c30d3..798bb7e813 100644 --- a/scylla/src/transport/connection.rs +++ b/scylla/src/transport/connection.rs @@ -258,14 +258,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", @@ -278,6 +279,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 cc97f037fd..f4d15579f3 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 @@ -305,6 +308,7 @@ mod tests { warnings: vec![], tracing_id: None, paging_state: None, + table_spec: None, col_specs: vec![column_spec], serialized_size: 0, }