File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ func newCompIO(mc *mysqlConn) *compIO {
96
96
}
97
97
}
98
98
99
+ func (c * compIO ) reset () {
100
+ c .buff .Reset ()
101
+ }
102
+
99
103
func (c * compIO ) readNext (need int , r readwriteFunc ) ([]byte , error ) {
100
104
for c .buff .Len () < need {
101
105
if err := c .readCompressedPacket (r ); err != nil {
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ func (mc *mysqlConn) syncSequenceNr() {
97
97
// https://github.com/mysql/mysql-server/blob/824e2b4064053f7daf17d7f3f84b7a3ed92e5fb4/sql-common/net_serv.cc#L293
98
98
if mc .compress {
99
99
mc .sequence = mc .compressSequence
100
+ mc .compIO .reset ()
100
101
}
101
102
}
102
103
Original file line number Diff line number Diff line change @@ -971,12 +971,16 @@ func TestDateTime(t *testing.T) {
971
971
var err error
972
972
rows , err = dbt .db .Query (`SELECT cast("00:00:00.1" as TIME(1)) = "00:00:00.1"` )
973
973
if err == nil {
974
- rows .Scan (& microsecsSupported )
974
+ if rows .Next () {
975
+ rows .Scan (& microsecsSupported )
976
+ }
975
977
rows .Close ()
976
978
}
977
979
rows , err = dbt .db .Query (`SELECT cast("0000-00-00" as DATE) = "0000-00-00"` )
978
980
if err == nil {
979
- rows .Scan (& zeroDateSupported )
981
+ if rows .Next () {
982
+ rows .Scan (& zeroDateSupported )
983
+ }
980
984
rows .Close ()
981
985
}
982
986
for _ , setups := range testcases {
You can’t perform that action at this time.
0 commit comments