Skip to content

Commit

Permalink
copy row slice (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 authored May 12, 2020
1 parent 59cf4a6 commit 9fba8d7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ extension MySQLProtocol {
if nullBitmap.isNull(at: i) {
storage = nil
} else {
var slice: ByteBuffer
if let length = column.columnType.encodingLength {
guard let data = packet.payload.readSlice(length: length) else {
fatalError()
}
storage = data
slice = data
} else {
guard let data = packet.payload.readLengthEncodedSlice() else {
fatalError()
}
storage = data
slice = data
}
var copy = ByteBufferAllocator().buffer(capacity: slice.readableBytes)
copy.writeBuffer(&slice)
storage = copy
}
values.append(storage)
}
Expand Down

0 comments on commit 9fba8d7

Please sign in to comment.