use of io.mycat.net.mysql.ResultSetHeaderPacket in project Mycat-Server by MyCATApache.
the class MysqlProcHandler method handle.
public static void handle(String stmt, ServerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
ResultSetHeaderPacket header = PacketUtil.getHeader(FIELD_COUNT);
byte packetId = header.packetId;
buffer = header.write(buffer, c, true);
// write fields
for (FieldPacket field : fields) {
field.packetId = ++packetId;
buffer = field.write(buffer, c, true);
}
// write eof
EOFPacket eof = new EOFPacket();
eof.packetId = ++packetId;
buffer = eof.write(buffer, c, true);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c, true);
// post write
c.write(buffer);
}
Aggregations