Skip to content

Commit 45bedc4

Browse files
committed
avoid returning empty MySQLWarnings in odd edge case scenario
1 parent 2e00b5c commit 45bedc4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Xiangyu Hu <xiangyu.hu at outlook.com>
4949
Xiaobing Jiang <s7v7nislands at gmail.com>
5050
Xiuming Chen <cc at cxm.cc>
5151
Zhenye Xie <xiezhenye at gmail.com>
52+
Ruben de Vries <ruben at rubensayshi.com>
5253

5354
# Organizations
5455

errors.go

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ func (mc *mysqlConn) getWarnings() (err error) {
122122
warnings = append(warnings, warning)
123123

124124
case io.EOF:
125+
if len(warnings) == 0 {
126+
return nil
127+
}
128+
125129
return warnings
126130

127131
default:

0 commit comments

Comments
 (0)