We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd420db commit c82353cCopy full SHA for c82353c
1 file changed
Sources/CosmoMSSQL/TDS/TDSDecoder.swift
@@ -186,10 +186,11 @@ struct TDSTokenDecoder {
186
let _: UInt16 = buf.readInteger(endianness: .little), // curCmd
187
let count: UInt64 = buf.readInteger(endianness: .little) // rowCount (8 bytes in TDS 7.2+)
188
else { throw TDSError.incomplete }
189
- // Flush current rows into resultSets on any DONE token
190
- if !currentRows.isEmpty {
+ // Flush current rows into resultSets on any DONE token if we have columns (i.e. a result set was started)
+ if !columns.isEmpty {
191
resultSets.append(currentRows)
192
currentRows = []
193
+ columns = [] // Reset columns for next result set
194
}
195
// Only trust the rowcount when the DONE_COUNT bit (0x10) is set
196
if status & 0x10 != 0 {
0 commit comments