Golang MySQL存储过程的使用
使用前阅读
ref-1:问题来源 [支付系统数据库设计的关键问题 ]
ref-2:[Golang 用go-sql-driver 调用MySQL存储过程时的问题排查]
编辑文件src/github.com/go-sql-driver/mysql/packets.go文件,在函数writeAuthPacket(cipher []byte) (大约在210行)的客户端标志位处添加下面两个标志:
func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
// Adjust client flags based on server support
clientFlags := clientProtocol41 |
clientSecureConn |
clientLongPassword |
clientTransactions |
clientLocalFiles |
**clientMultiStatements | // 添加这行
clientMultiResults |** //再添加这行
mc.flags&clientLongFlag
if mc.cfg.clientFoundRows {
clientFlags |= clientFoundRows
}