From 81a24df15f5b96db6bd2558a7894dd7647dcd67d Mon Sep 17 00:00:00 2001 From: Kirill Shvakov Date: Mon, 6 Nov 2017 16:42:35 +0200 Subject: [PATCH] fix: recive block without rows --- rows.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rows.go b/rows.go index 530bd22d64..d79e1acfe8 100644 --- a/rows.go +++ b/rows.go @@ -47,8 +47,6 @@ func (rows *rows) Next(dest []driver.Value) error { return err } return io.EOF - case block.NumRows == 0: - return io.EOF default: rows.block = block rows.offset = 0 @@ -120,6 +118,9 @@ func (rows *rows) receiveData() error { return rows.setError(err) } rows.ch.logf("[rows] <- data: packet=%d, columns=%d, rows=%d, elapsed=%s", packet, block.NumColumns, block.NumRows, time.Since(begin)) + if block.NumRows == 0 { + continue + } switch packet { case protocol.ServerData: rows.stream <- block