From 7474fe7713da4bbf13805f2b72951d1a89d48064 Mon Sep 17 00:00:00 2001 From: wangxuan Date: Thu, 16 Jul 2020 17:08:56 +0800 Subject: [PATCH] fix parse statement execute proto bug --- proxy/server/conn_stmt.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/server/conn_stmt.go b/proxy/server/conn_stmt.go index a5d258a8..6c8d18d4 100644 --- a/proxy/server/conn_stmt.go +++ b/proxy/server/conn_stmt.go @@ -45,6 +45,7 @@ type Stmt struct { columns int args []interface{} + paramTypes []byte s sqlparser.Statement @@ -204,7 +205,6 @@ func (c *ClientConn) handleStmtExecute(data []byte) error { pos += 4 var nullBitmaps []byte - var paramTypes []byte var paramValues []byte paramNum := s.params @@ -224,13 +224,13 @@ func (c *ClientConn) handleStmtExecute(data []byte) error { return mysql.ErrMalformPacket } - paramTypes = data[pos : pos+(paramNum<<1)] + s.paramTypes = data[pos : pos+(paramNum<<1)] pos += (paramNum << 1) - paramValues = data[pos:] } + paramValues = data[pos:] - if err := c.bindStmtArgs(s, nullBitmaps, paramTypes, paramValues); err != nil { + if err := c.bindStmtArgs(s, nullBitmaps, s.paramTypes, paramValues); err != nil { return err } }