File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1076,6 +1076,11 @@ func (rows *binaryRows) readRow(dest []driver.Value) error {
1076
1076
dstlen = 8
1077
1077
case 1 , 2 , 3 , 4 , 5 , 6 :
1078
1078
dstlen = 8 + 1 + decimals
1079
+ default :
1080
+ return fmt .Errorf (
1081
+ "MySQL protocol error, illegal decimals value %d" ,
1082
+ rows .columns [i ].decimals ,
1083
+ )
1079
1084
}
1080
1085
dest [i ], err = formatBinaryDateTime (data [pos :pos + int (num )], dstlen , true )
1081
1086
case rows .mc .parseTime :
@@ -1091,9 +1096,10 @@ func (rows *binaryRows) readRow(dest []driver.Value) error {
1091
1096
case 1 , 2 , 3 , 4 , 5 , 6 :
1092
1097
dstlen = 19 + 1 + decimals
1093
1098
default :
1094
- panic (fmt .Sprintf ("unexpected decimals value in column %d: %#v" ,
1095
- i , rows .columns [i ],
1096
- ))
1099
+ return fmt .Errorf (
1100
+ "MySQL protocol error, illegal decimals value %d" ,
1101
+ rows .columns [i ].decimals ,
1102
+ )
1097
1103
}
1098
1104
}
1099
1105
dest [i ], err = formatBinaryDateTime (data [pos :pos + int (num )], dstlen , false )
You can’t perform that action at this time.
0 commit comments