@@ -150,18 +150,8 @@ impl From<&ExecuteResponse> for StatementEndedExecutionReason {
150
150
fn from ( value : & ExecuteResponse ) -> StatementEndedExecutionReason {
151
151
match value {
152
152
ExecuteResponse :: CopyTo { resp, .. } => match resp. as_ref ( ) {
153
- // NB [btv]: It's not clear that this combination
154
- // can ever actually happen.
155
153
ExecuteResponse :: SendingRowsImmediate { rows, .. } => {
156
- // Note(parkmycar): It potentially feels bad here to iterate over the entire
157
- // iterator _just_ to get the encoded result size. As noted above, it's not
158
- // entirely clear this case ever happens, so the simplicity is worth it.
159
- let result_size: usize = rows. box_clone ( ) . map ( |row| row. byte_len ( ) ) . sum ( ) ;
160
- StatementEndedExecutionReason :: Success {
161
- result_size : Some ( u64:: cast_from ( result_size) ) ,
162
- rows_returned : Some ( u64:: cast_from ( rows. count ( ) ) ) ,
163
- execution_strategy : Some ( StatementExecutionStrategy :: Constant ) ,
164
- }
154
+ panic ! ( "SELECTs terminate on peek finalization, not here." )
165
155
}
166
156
ExecuteResponse :: SendingRows { .. } => {
167
157
panic ! ( "SELECTs terminate on peek finalization, not here." )
@@ -185,17 +175,7 @@ impl From<&ExecuteResponse> for StatementEndedExecutionReason {
185
175
}
186
176
187
177
ExecuteResponse :: SendingRowsImmediate { rows, .. } => {
188
- // Note(parkmycar): It potentially feels bad here to iterate over the entire
189
- // iterator _just_ to get the encoded result size, the number of Rows returned here
190
- // shouldn't be too large though. An alternative is to pre-compute some of the
191
- // result size, but that would require always decoding Rows to handle projecting
192
- // away columns, which has a negative impact for much larger response sizes.
193
- let result_size: usize = rows. box_clone ( ) . map ( |row| row. byte_len ( ) ) . sum ( ) ;
194
- StatementEndedExecutionReason :: Success {
195
- result_size : Some ( u64:: cast_from ( result_size) ) ,
196
- rows_returned : Some ( u64:: cast_from ( rows. count ( ) ) ) ,
197
- execution_strategy : Some ( StatementExecutionStrategy :: Constant ) ,
198
- }
178
+ panic ! ( "SELECTs terminate on peek finalization, not here." )
199
179
}
200
180
201
181
ExecuteResponse :: AlteredDefaultPrivileges
0 commit comments