Search in sources :

Example 1 with ResetPacket

use of io.mycat.net.mysql.ResetPacket in project Mycat-Server by MyCATApache.

the class ServerPrepareHandler method reset.

@Override
public void reset(byte[] data) {
    ResetPacket packet = new ResetPacket();
    packet.read(data);
    long pstmtId = packet.getPstmtId();
    PreparedStatement pstmt = pstmtForId.get(pstmtId);
    if (pstmt != null) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("reset prepare sql : " + pstmtForId.get(pstmtId));
        }
        pstmt.resetLongData();
        source.write(OkPacket.OK);
    } else {
        source.writeErrMessage(ErrorCode.ERR_FOUND_EXCEPION, "can not reset prepare statement : " + pstmtForId.get(pstmtId));
    }
}
Also used : PreparedStatement(io.mycat.backend.mysql.PreparedStatement) ResetPacket(io.mycat.net.mysql.ResetPacket)

Aggregations

PreparedStatement (io.mycat.backend.mysql.PreparedStatement)1 ResetPacket (io.mycat.net.mysql.ResetPacket)1