You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: response_proxy.go
    path of file: ./repos/acra/decryptor/mysql
    
    the code of the file until where you have to start completion: /*
Copyright 2016, Cossack Labs Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed
    
func (handler *Handler) handleStatementExecute(ctx context.Context, packet *Packet) (uint32, error) {
	packetData := packet.GetData()
	if len(packetData) < 2 {
		handler.logger.Debug("Execute statement packet has not enough data")
		return 0, ErrInvalidResponseLength
	}

	var (
		paramsNumber int
		statement    sqlparser.Statement
		stmtID       = binary.LittleEndian.Uint32(packet.GetData()[1:])
		log          *logrus.Entry
	)

	// https://mariadb.com/kb/en/com_stmt_execute/#statement-id
	// Since MariaDB server version 10.2, value -1 (0xFFFFFFFF) can be used to indicate to use the last
	// statement prepared on current connection if no COM_STMT_PREPARE has fail since.
	if stmtID == MariaDBDirectStatementID {
		log = handler.logger.WithField("proxy", "client").WithField("statement", -1)
		log.Debug("Statement Execute")

		var err error
		var queryObj = handler.protocolState.PendingParse()

		statement, err = queryObj.Statement()
		if err != nil {
			handler.logger.WithError(err).Error("Can't parse sqlparser statement")
			return 0, err
		}

		// during mariadb_stmt_execute_direct param_count is not known, we manually calculate it via sqlparser
		paramsNumber, err = getParamsCount(statement)
		if err != nil {
			handler.logger.WithError(err).Error("Failed to count params number of MariaDB Execute -1 statement")
			return 0, err
		}
	} else {
		log = handler.logger.WithField("proxy", "client").WithField("statement", stmtID)
		log.Debug("Statement Execute")
		stmtItem, err := handler.registry.StatementByID(strconv.FormatUint(uint64(stmtID), 10))
		if err != nil {
			log.WithError(err).Error("Can't find prepared statement in registry")
			return 0, nil
		}

		preparedStmt := stmtItem.Statement()
		paramsNumber = preparedStmt.ParamsNum()
		statement = preparedStmt.Query()
	}

	// https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_com_stmt_execute.html
	// we expect list of parameters if the paramsNum > 0
	if paramsNum := paramsNumber; paramsNum > 0 {
		parameters, err := packet.GetBindParameters(paramsNum)
		if err != nil {
			log.WithError(err).Error("Can't parse OnBind parameters")
			return 0, err
		}

		newParameters, changed, err := handler.queryObserverManager.OnBind(ctx, statement, parameters)
		if err != nil {
			// Security: here we should interrupt proxying in case of any keys read related errors
			// in other cases we just stop the processing to let db protocol handle the error.
			if filesystem.IsKeyReadError(err) {
				return 0, err
			}

			log.WithError(err).Error("Failed to handle Bind packet")
			return 0, nil
		}

		// Finally, if the parameter values have been changed, update the packet.
		if changed {
			if err := packet.SetParameters(newParameters); err != nil {
				log.WithError(err).Error("Failed to update Bind packet")
				return 0, err
			}
		}
	}

	return stmtID, nil
}