@@ -46,19 +46,20 @@ use super::connection::SslConfig;
4646use super :: errors:: TracingProtocolError ;
4747use super :: execution_profile:: { ExecutionProfile , ExecutionProfileHandle , ExecutionProfileInner } ;
4848use super :: iterator:: QueryPager ;
49- use super :: legacy_query_result:: MaybeFirstRowTypedError ;
5049#[ cfg( feature = "cloud" ) ]
5150use super :: node:: CloudEndpoint ;
5251use super :: node:: { InternalKnownNode , KnownNode } ;
5352use super :: partitioner:: PartitionerName ;
53+ use super :: query_result:: MaybeFirstRowError ;
54+ use super :: query_result:: RowsError ;
5455use super :: topology:: UntranslatedPeer ;
5556use super :: { NodeRef , SelfIdentity } ;
5657use crate :: frame:: response:: result;
5758use crate :: prepared_statement:: PreparedStatement ;
5859use crate :: query:: Query ;
5960use crate :: routing:: { Shard , Token } ;
6061use crate :: statement:: { Consistency , PageSize , PagingState , PagingStateResponse } ;
61- use crate :: tracing:: { TracingEvent , TracingInfo } ;
62+ use crate :: tracing:: TracingInfo ;
6263use crate :: transport:: cluster:: { Cluster , ClusterData , ClusterNeatDebug } ;
6364use crate :: transport:: connection:: { Connection , ConnectionConfig , VerifiedKeyspaceName } ;
6465use crate :: transport:: connection_pool:: PoolConfig ;
@@ -1790,15 +1791,18 @@ where
17901791
17911792 // Get tracing info
17921793 let maybe_tracing_info: Option < TracingInfo > = traces_session_res
1793- . into_legacy_result ( ) ?
1794- . maybe_first_row_typed ( )
1794+ . into_rows_result ( ) ?
1795+ . ok_or ( ProtocolError :: Tracing (
1796+ TracingProtocolError :: TracesSessionNotRows ,
1797+ ) ) ?
1798+ . maybe_first_row ( )
17951799 . map_err ( |err| match err {
1796- MaybeFirstRowTypedError :: RowsExpected ( e) => {
1797- ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionNotRows ( e) )
1798- }
1799- MaybeFirstRowTypedError :: FromRowError ( e) => {
1800+ MaybeFirstRowError :: TypeCheckFailed ( e) => {
18001801 ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionInvalidColumnType ( e) )
18011802 }
1803+ MaybeFirstRowError :: DeserializationFailed ( e) => ProtocolError :: Tracing (
1804+ TracingProtocolError :: TracesSessionDeserializationFailed ( e) ,
1805+ ) ,
18021806 } ) ?;
18031807
18041808 let mut tracing_info = match maybe_tracing_info {
@@ -1807,20 +1811,23 @@ where
18071811 } ;
18081812
18091813 // Get tracing events
1810- let tracing_event_rows = traces_events_res
1811- . into_legacy_result ( ) ?
1812- . rows_typed ( )
1813- . map_err ( |err| {
1814- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsNotRows ( err) )
1815- } ) ?;
1816-
1817- for event in tracing_event_rows {
1818- let tracing_event: TracingEvent = event. map_err ( |err| {
1814+ let tracing_event_rows_result =
1815+ traces_events_res
1816+ . into_rows_result ( ) ?
1817+ . ok_or ( ProtocolError :: Tracing (
1818+ TracingProtocolError :: TracesEventsNotRows ,
1819+ ) ) ?;
1820+ let tracing_event_rows = tracing_event_rows_result. rows ( ) . map_err ( |err| match err {
1821+ RowsError :: TypeCheckFailed ( err) => {
18191822 ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsInvalidColumnType ( err) )
1820- } ) ?;
1823+ }
1824+ } ) ?;
18211825
1822- tracing_info. events . push ( tracing_event) ;
1823- }
1826+ tracing_info. events = tracing_event_rows
1827+ . collect :: < Result < _ , _ > > ( )
1828+ . map_err ( |err| {
1829+ ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsDeserializationFailed ( err) )
1830+ } ) ?;
18241831
18251832 if tracing_info. events . is_empty ( ) {
18261833 return Ok ( None ) ;
0 commit comments