@@ -96,32 +96,31 @@ use crate::routing::partitioner::{Partitioner, PartitionerHasher, PartitionerNam
9696pub struct PreparedStatement {
9797 pub ( crate ) config : StatementConfig ,
9898 /// Tracing IDs of all queries used to prepare this statement.
99+ // TODO(2.0): Unpub this, move this to PreparedStatementSharedData, and expose a getter.
99100 pub prepare_tracing_ids : Vec < Uuid > ,
100101
101- id : Bytes ,
102102 shared : Arc < PreparedStatementSharedData > ,
103103 page_size : PageSize ,
104104 partitioner_name : PartitionerName ,
105- is_confirmed_lwt : bool ,
106105}
107106
108107#[ derive( Debug ) ]
109108struct PreparedStatementSharedData {
109+ id : Bytes ,
110110 metadata : PreparedMetadata ,
111111 result_metadata : Arc < ResultMetadata < ' static > > ,
112112 statement : String ,
113+ is_confirmed_lwt : bool ,
113114}
114115
115116impl Clone for PreparedStatement {
116117 fn clone ( & self ) -> Self {
117118 Self {
118119 config : self . config . clone ( ) ,
119120 prepare_tracing_ids : Vec :: new ( ) ,
120- id : self . id . clone ( ) ,
121121 shared : self . shared . clone ( ) ,
122122 page_size : self . page_size ,
123123 partitioner_name : self . partitioner_name . clone ( ) ,
124- is_confirmed_lwt : self . is_confirmed_lwt ,
125124 }
126125 }
127126}
@@ -137,23 +136,23 @@ impl PreparedStatement {
137136 config : StatementConfig ,
138137 ) -> Self {
139138 Self {
140- id,
141139 shared : Arc :: new ( PreparedStatementSharedData {
140+ id,
142141 metadata,
143142 result_metadata,
144143 statement,
144+ is_confirmed_lwt : is_lwt,
145145 } ) ,
146146 prepare_tracing_ids : Vec :: new ( ) ,
147147 page_size,
148- config,
149148 partitioner_name : Default :: default ( ) ,
150- is_confirmed_lwt : is_lwt ,
149+ config ,
151150 }
152151 }
153152
154153 /// Retrieves the ID of this prepared statement.
155154 pub fn get_id ( & self ) -> & Bytes {
156- & self . id
155+ & self . shared . id
157156 }
158157
159158 /// Retrieves the statement string of this prepared statement.
@@ -200,7 +199,7 @@ impl PreparedStatement {
200199 /// Note: this a Scylla-specific optimisation. Therefore, the result
201200 /// will be always false for Cassandra.
202201 pub fn is_confirmed_lwt ( & self ) -> bool {
203- self . is_confirmed_lwt
202+ self . shared . is_confirmed_lwt
204203 }
205204
206205 /// Computes the partition key of the target table from given values —
0 commit comments