mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
rollback mysql driver
this https://github.com/go-sql-driver/mysql/pull/302 seems to have pretty much crippled the ability to use mysql, so we need to lock a version before that until that issue gets fixed.
This commit is contained in:
28
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
28
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
@@ -35,7 +35,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
|
||||
}
|
||||
errLog.Print(err)
|
||||
mc.Close()
|
||||
return nil, ErrInvalidConn
|
||||
return nil, driver.ErrBadConn
|
||||
}
|
||||
|
||||
// packet length [24 bit]
|
||||
@@ -57,7 +57,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
|
||||
if prevData == nil {
|
||||
errLog.Print(ErrMalformPkt)
|
||||
mc.Close()
|
||||
return nil, ErrInvalidConn
|
||||
return nil, driver.ErrBadConn
|
||||
}
|
||||
|
||||
return prevData, nil
|
||||
@@ -71,7 +71,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
|
||||
}
|
||||
errLog.Print(err)
|
||||
mc.Close()
|
||||
return nil, ErrInvalidConn
|
||||
return nil, driver.ErrBadConn
|
||||
}
|
||||
|
||||
// return data if this was the last packet
|
||||
@@ -137,14 +137,10 @@ func (mc *mysqlConn) writePacket(data []byte) error {
|
||||
if cerr := mc.canceled.Value(); cerr != nil {
|
||||
return cerr
|
||||
}
|
||||
if n == 0 && pktLen == len(data)-4 {
|
||||
// only for the first loop iteration when nothing was written yet
|
||||
return errBadConnNoWrite
|
||||
}
|
||||
mc.cleanup()
|
||||
errLog.Print(err)
|
||||
}
|
||||
return ErrInvalidConn
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +274,7 @@ func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// ClientFlags [32 bit]
|
||||
@@ -366,7 +362,7 @@ func (mc *mysqlConn) writeOldAuthPacket(cipher []byte) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add the scrambled password [null terminated string]
|
||||
@@ -385,7 +381,7 @@ func (mc *mysqlConn) writeClearAuthPacket() error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add the clear password [null terminated string]
|
||||
@@ -408,7 +404,7 @@ func (mc *mysqlConn) writeNativeAuthPacket(cipher []byte) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add the scramble
|
||||
@@ -429,7 +425,7 @@ func (mc *mysqlConn) writeCommandPacket(command byte) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add command byte
|
||||
@@ -448,7 +444,7 @@ func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add command byte
|
||||
@@ -469,7 +465,7 @@ func (mc *mysqlConn) writeCommandPacketUint32(command byte, arg uint32) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// Add command byte
|
||||
@@ -935,7 +931,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
|
||||
if data == nil {
|
||||
// can not take the buffer. Something must be wrong with the connection
|
||||
errLog.Print(ErrBusyBuffer)
|
||||
return errBadConnNoWrite
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
// command [1 byte]
|
||||
|
||||
Reference in New Issue
Block a user