From 45bedc48fdc3c054ce3eedf9cd67dfb76215b674 Mon Sep 17 00:00:00 2001 From: Ruben de Vries Date: Wed, 22 Mar 2017 16:59:00 +0100 Subject: [PATCH] avoid returning empty MySQLWarnings in odd edge case scenario --- AUTHORS | 1 + errors.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/AUTHORS b/AUTHORS index 100370758..1eeb33ada 100644 --- a/AUTHORS +++ b/AUTHORS @@ -49,6 +49,7 @@ Xiangyu Hu Xiaobing Jiang Xiuming Chen Zhenye Xie +Ruben de Vries # Organizations diff --git a/errors.go b/errors.go index 857854e14..2c50f2a32 100644 --- a/errors.go +++ b/errors.go @@ -122,6 +122,10 @@ func (mc *mysqlConn) getWarnings() (err error) { warnings = append(warnings, warning) case io.EOF: + if len(warnings) == 0 { + return nil + } + return warnings default: