@@ -30,8 +30,6 @@ public async Task<ResultSet> ReadResultSetHeaderAsync(IOBehavior ioBehavior)
30
30
RecordsAffected = null ;
31
31
State = ResultSetState . None ;
32
32
m_columnDefinitionPayloadUsedBytes = 0 ;
33
- m_dataLengths = null ;
34
- m_dataOffsets = null ;
35
33
m_readBuffer . Clear ( ) ;
36
34
m_row = null ;
37
35
m_rowBuffered = null ;
@@ -106,8 +104,6 @@ int ReadColumnCount(ArraySegment<byte> arraySegment)
106
104
107
105
ColumnDefinitions = new ColumnDefinitionPayload [ columnCount ] ;
108
106
ColumnTypes = new MySqlDbType [ columnCount ] ;
109
- m_dataOffsets = new int [ columnCount ] ;
110
- m_dataLengths = new int [ columnCount ] ;
111
107
112
108
for ( var column = 0 ; column < ColumnDefinitions . Length ; column ++ )
113
109
{
@@ -171,7 +167,6 @@ public Task<bool> ReadAsync(CancellationToken cancellationToken) =>
171
167
172
168
public async Task < bool > ReadAsync ( IOBehavior ioBehavior , CancellationToken cancellationToken )
173
169
{
174
- m_row ? . ClearData ( ) ;
175
170
m_row = m_readBuffer . Count > 0
176
171
? m_readBuffer . Dequeue ( )
177
172
: await ScanRowAsync ( ioBehavior , m_row , cancellationToken ) . ConfigureAwait ( false ) ;
@@ -187,7 +182,7 @@ public async Task<bool> ReadAsync(IOBehavior ioBehavior, CancellationToken cance
187
182
188
183
public async Task < Row > BufferReadAsync ( IOBehavior ioBehavior , CancellationToken cancellationToken )
189
184
{
190
- m_rowBuffered ? . BufferData ( ) ;
185
+ m_rowBuffered = m_rowBuffered ? . Clone ( ) ;
191
186
// ScanRowAsync sets m_rowBuffered to the next row if there is one
192
187
if ( await ScanRowAsync ( ioBehavior , null , cancellationToken ) . ConfigureAwait ( false ) == null )
193
188
return null ;
@@ -246,18 +241,9 @@ Row ScanRowAsyncRemainder(PayloadData payload, Row row_)
246
241
}
247
242
}
248
243
249
- var reader = new ByteArrayReader ( payload . ArraySegment ) ;
250
- for ( var column = 0 ; column < m_dataOffsets . Length ; column ++ )
251
- {
252
- var length = reader . ReadLengthEncodedIntegerOrNull ( ) ;
253
- m_dataLengths [ column ] = length == - 1 ? 0 : length ;
254
- m_dataOffsets [ column ] = length == - 1 ? - 1 : reader . Offset + payload . ArraySegment . Offset ;
255
- reader . Offset += m_dataLengths [ column ] ;
256
- }
257
-
258
244
if ( row_ == null )
259
- row_ = new Row ( this ) ;
260
- row_ . SetData ( m_dataLengths , m_dataOffsets , payload . ArraySegment ) ;
245
+ row_ = new TextRow ( this ) ;
246
+ row_ . SetData ( payload . ArraySegment ) ;
261
247
m_rowBuffered = row_ ;
262
248
m_hasRows = true ;
263
249
BufferState = ResultSetState . ReadingRows ;
@@ -346,8 +332,6 @@ public Row GetCurrentRow()
346
332
347
333
ResizableArray < byte > m_columnDefinitionPayloads ;
348
334
int m_columnDefinitionPayloadUsedBytes ;
349
- int [ ] m_dataLengths ;
350
- int [ ] m_dataOffsets ;
351
335
readonly Queue < Row > m_readBuffer = new Queue < Row > ( ) ;
352
336
Row m_row ;
353
337
Row m_rowBuffered ;
0 commit comments