@@ -31,7 +31,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
31
31
if err != nil {
32
32
errLog .Print (err )
33
33
mc .Close ()
34
- return nil , driver . ErrBadConn
34
+ return nil , ErrInvalidConn
35
35
}
36
36
37
37
// Packet Length [24 bit]
@@ -40,7 +40,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
40
40
if pktLen < 1 {
41
41
errLog .Print (ErrMalformPkt )
42
42
mc .Close ()
43
- return nil , driver . ErrBadConn
43
+ return nil , ErrInvalidConn
44
44
}
45
45
46
46
// Check Packet Sync [8 bit]
@@ -58,7 +58,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
58
58
if err != nil {
59
59
errLog .Print (err )
60
60
mc .Close ()
61
- return nil , driver . ErrBadConn
61
+ return nil , ErrInvalidConn
62
62
}
63
63
64
64
isLastPacket := (pktLen < maxPacketSize )
@@ -117,7 +117,7 @@ func (mc *mysqlConn) writePacket(data []byte) error {
117
117
} else {
118
118
errLog .Print (err )
119
119
}
120
- return driver . ErrBadConn
120
+ return ErrInvalidConn
121
121
}
122
122
}
123
123
@@ -241,7 +241,7 @@ func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
241
241
if data == nil {
242
242
// can not take the buffer. Something must be wrong with the connection
243
243
errLog .Print (ErrBusyBuffer )
244
- return driver . ErrBadConn
244
+ return ErrInvalidConn
245
245
}
246
246
247
247
// ClientFlags [32 bit]
@@ -312,7 +312,7 @@ func (mc *mysqlConn) writeOldAuthPacket(cipher []byte) error {
312
312
if data == nil {
313
313
// can not take the buffer. Something must be wrong with the connection
314
314
errLog .Print (ErrBusyBuffer )
315
- return driver . ErrBadConn
315
+ return ErrInvalidConn
316
316
}
317
317
318
318
// Add the scrambled password [null terminated string]
@@ -334,7 +334,7 @@ func (mc *mysqlConn) writeCommandPacket(command byte) error {
334
334
if data == nil {
335
335
// can not take the buffer. Something must be wrong with the connection
336
336
errLog .Print (ErrBusyBuffer )
337
- return driver . ErrBadConn
337
+ return ErrInvalidConn
338
338
}
339
339
340
340
// Add command byte
@@ -353,7 +353,7 @@ func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error {
353
353
if data == nil {
354
354
// can not take the buffer. Something must be wrong with the connection
355
355
errLog .Print (ErrBusyBuffer )
356
- return driver . ErrBadConn
356
+ return ErrInvalidConn
357
357
}
358
358
359
359
// Add command byte
@@ -374,7 +374,7 @@ func (mc *mysqlConn) writeCommandPacketUint32(command byte, arg uint32) error {
374
374
if data == nil {
375
375
// can not take the buffer. Something must be wrong with the connection
376
376
errLog .Print (ErrBusyBuffer )
377
- return driver . ErrBadConn
377
+ return ErrInvalidConn
378
378
}
379
379
380
380
// Add command byte
@@ -767,7 +767,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
767
767
if data == nil {
768
768
// can not take the buffer. Something must be wrong with the connection
769
769
errLog .Print (ErrBusyBuffer )
770
- return driver . ErrBadConn
770
+ return ErrInvalidConn
771
771
}
772
772
773
773
// command [1 byte]
0 commit comments