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 {
9696 }
9797}
9898
99+ func (c * compIO ) reset () {
100+ c .buff .Reset ()
101+ }
102+
99103func (c * compIO ) readNext (need int , r readwriteFunc ) ([]byte , error ) {
100104 for c .buff .Len () < need {
101105 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() {
9797 // https://github.com/mysql/mysql-server/blob/824e2b4064053f7daf17d7f3f84b7a3ed92e5fb4/sql-common/net_serv.cc#L293
9898 if mc .compress {
9999 mc .sequence = mc .compressSequence
100+ mc .compIO .reset ()
100101 }
101102}
102103
Original file line number Diff line number Diff line change @@ -971,12 +971,16 @@ func TestDateTime(t *testing.T) {
971971 var err error
972972 rows , err = dbt .db .Query (`SELECT cast("00:00:00.1" as TIME(1)) = "00:00:00.1"` )
973973 if err == nil {
974- rows .Scan (& microsecsSupported )
974+ if rows .Next () {
975+ rows .Scan (& microsecsSupported )
976+ }
975977 rows .Close ()
976978 }
977979 rows , err = dbt .db .Query (`SELECT cast("0000-00-00" as DATE) = "0000-00-00"` )
978980 if err == nil {
979- rows .Scan (& zeroDateSupported )
981+ if rows .Next () {
982+ rows .Scan (& zeroDateSupported )
983+ }
980984 rows .Close ()
981985 }
982986 for _ , setups := range testcases {
You can’t perform that action at this time.
0 commit comments