@@ -219,11 +219,11 @@ private ValueTask<Row> ScanRowAsync(IOBehavior ioBehavior, Row row, Cancellation
219
219
{
220
220
var payloadValueTask = Session . ReceiveReplyAsync ( ioBehavior , CancellationToken . None ) ;
221
221
return payloadValueTask . IsCompletedSuccessfully
222
- ? new ValueTask < Row > ( ScanRowAsyncRemainder ( payloadValueTask . Result , row ) )
223
- : new ValueTask < Row > ( ScanRowAsyncAwaited ( payloadValueTask . AsTask ( ) , row , cancellationToken ) ) ;
222
+ ? new ValueTask < Row > ( ScanRowAsyncRemainder ( this , payloadValueTask . Result , row ) )
223
+ : new ValueTask < Row > ( ScanRowAsyncAwaited ( this , payloadValueTask . AsTask ( ) , row , cancellationToken ) ) ;
224
224
}
225
225
226
- async Task < Row > ScanRowAsyncAwaited ( Task < PayloadData > payloadTask , Row row_ , CancellationToken token )
226
+ static async Task < Row > ScanRowAsyncAwaited ( ResultSet this_ , Task < PayloadData > payloadTask , Row row_ , CancellationToken token )
227
227
{
228
228
PayloadData payloadData ;
229
229
try
@@ -232,39 +232,39 @@ async Task<Row> ScanRowAsyncAwaited(Task<PayloadData> payloadTask, Row row_, Can
232
232
}
233
233
catch ( MySqlException ex )
234
234
{
235
- BufferState = State = ResultSetState . NoMoreData ;
235
+ this_ . BufferState = this_ . State = ResultSetState . NoMoreData ;
236
236
if ( ex . Number == ( int ) MySqlErrorCode . QueryInterrupted )
237
237
token . ThrowIfCancellationRequested ( ) ;
238
238
throw ;
239
239
}
240
- return ScanRowAsyncRemainder ( payloadData , row_ ) ;
240
+ return ScanRowAsyncRemainder ( this_ , payloadData , row_ ) ;
241
241
}
242
242
243
- Row ScanRowAsyncRemainder ( PayloadData payload , Row row_ )
243
+ static Row ScanRowAsyncRemainder ( ResultSet this_ , PayloadData payload , Row row_ )
244
244
{
245
245
if ( payload . HeaderByte == EofPayload . Signature )
246
246
{
247
247
var span = payload . AsSpan ( ) ;
248
- if ( Session . SupportsDeprecateEof && OkPayload . IsOk ( span , Session . SupportsDeprecateEof ) )
248
+ if ( this_ . Session . SupportsDeprecateEof && OkPayload . IsOk ( span , this_ . Session . SupportsDeprecateEof ) )
249
249
{
250
- var ok = OkPayload . Create ( span , Session . SupportsDeprecateEof , Session . SupportsSessionTrack ) ;
251
- BufferState = ( ok . ServerStatus & ServerStatus . MoreResultsExist ) == 0 ? ResultSetState . NoMoreData : ResultSetState . HasMoreData ;
252
- m_rowBuffered = null ;
250
+ var ok = OkPayload . Create ( span , this_ . Session . SupportsDeprecateEof , this_ . Session . SupportsSessionTrack ) ;
251
+ this_ . BufferState = ( ok . ServerStatus & ServerStatus . MoreResultsExist ) == 0 ? ResultSetState . NoMoreData : ResultSetState . HasMoreData ;
252
+ this_ . m_rowBuffered = null ;
253
253
return null ;
254
254
}
255
- if ( ! Session . SupportsDeprecateEof && EofPayload . IsEof ( payload ) )
255
+ if ( ! this_ . Session . SupportsDeprecateEof && EofPayload . IsEof ( payload ) )
256
256
{
257
257
var eof = EofPayload . Create ( span ) ;
258
- BufferState = ( eof . ServerStatus & ServerStatus . MoreResultsExist ) == 0 ? ResultSetState . NoMoreData : ResultSetState . HasMoreData ;
259
- m_rowBuffered = null ;
258
+ this_ . BufferState = ( eof . ServerStatus & ServerStatus . MoreResultsExist ) == 0 ? ResultSetState . NoMoreData : ResultSetState . HasMoreData ;
259
+ this_ . m_rowBuffered = null ;
260
260
return null ;
261
261
}
262
262
}
263
263
264
264
if ( row_ is null )
265
265
{
266
266
bool isBinaryRow = false ;
267
- if ( payload . HeaderByte == 0 && ! Connection . IgnorePrepare )
267
+ if ( payload . HeaderByte == 0 && ! this_ . Connection . IgnorePrepare )
268
268
{
269
269
// this might be a binary row, but it might also be a text row whose first column is zero bytes long; try reading
270
270
// the row as a series of length-encoded values (the text format) to see if this might plausibly be a text row
@@ -317,7 +317,7 @@ Row ScanRowAsyncRemainder(PayloadData payload, Row row_)
317
317
reader . Offset += length ;
318
318
columnCount ++ ;
319
319
320
- if ( columnCount == ColumnDefinitions . Length )
320
+ if ( columnCount == this_ . ColumnDefinitions . Length )
321
321
{
322
322
// if we used up all the bytes reading exactly 'ColumnDefinitions' length-encoded columns, then assume this is a text row
323
323
if ( reader . BytesRemaining == 0 )
@@ -328,12 +328,12 @@ Row ScanRowAsyncRemainder(PayloadData payload, Row row_)
328
328
329
329
isBinaryRow = ! isTextRow ;
330
330
}
331
- row_ = isBinaryRow ? ( Row ) new BinaryRow ( this ) : new TextRow ( this ) ;
331
+ row_ = isBinaryRow ? ( Row ) new BinaryRow ( this_ ) : new TextRow ( this_ ) ;
332
332
}
333
333
row_ . SetData ( payload . ArraySegment ) ;
334
- m_rowBuffered = row_ ;
335
- m_hasRows = true ;
336
- BufferState = ResultSetState . ReadingRows ;
334
+ this_ . m_rowBuffered = row_ ;
335
+ this_ . m_hasRows = true ;
336
+ this_ . BufferState = ResultSetState . ReadingRows ;
337
337
return row_ ;
338
338
}
339
339
}
0 commit comments