Search in sources :

Example 31 with MySQLMessage

use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.

the class FieldPacket method read.

/**
 * 把字节数组转变成FieldPacket
 */
public void read(byte[] data) {
    MySQLMessage mm = new MySQLMessage(data);
    this.packetLength = mm.readUB3();
    this.packetId = mm.read();
    readBody(mm);
}
Also used : MySQLMessage(io.mycat.backend.mysql.MySQLMessage)

Example 32 with MySQLMessage

use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.

the class FieldPacket method read.

/**
 * 把BinaryPacket转变成FieldPacket
 */
public void read(BinaryPacket bin) {
    this.packetLength = bin.packetLength;
    this.packetId = bin.packetId;
    readBody(new MySQLMessage(bin.data));
}
Also used : MySQLMessage(io.mycat.backend.mysql.MySQLMessage)

Example 33 with MySQLMessage

use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.

the class HandshakePacket method read.

public void read(byte[] data) {
    MySQLMessage mm = new MySQLMessage(data);
    packetLength = mm.readUB3();
    packetId = mm.read();
    protocolVersion = mm.read();
    serverVersion = mm.readBytesWithNull();
    threadId = mm.readUB4();
    seed = mm.readBytesWithNull();
    serverCapabilities = mm.readUB2();
    serverCharsetIndex = mm.read();
    serverStatus = mm.readUB2();
    mm.move(13);
    restOfScrambleBuff = mm.readBytesWithNull();
}
Also used : MySQLMessage(io.mycat.backend.mysql.MySQLMessage)

Example 34 with MySQLMessage

use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.

the class HandshakePacket method read.

public void read(BinaryPacket bin) {
    packetLength = bin.packetLength;
    packetId = bin.packetId;
    MySQLMessage mm = new MySQLMessage(bin.data);
    protocolVersion = mm.read();
    serverVersion = mm.readBytesWithNull();
    threadId = mm.readUB4();
    seed = mm.readBytesWithNull();
    serverCapabilities = mm.readUB2();
    serverCharsetIndex = mm.read();
    serverStatus = mm.readUB2();
    mm.move(13);
    restOfScrambleBuff = mm.readBytesWithNull();
}
Also used : MySQLMessage(io.mycat.backend.mysql.MySQLMessage)

Example 35 with MySQLMessage

use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.

the class LongDataPacket method read.

public void read(byte[] data) {
    MySQLMessage mm = new MySQLMessage(data);
    packetLength = mm.readUB3();
    packetId = mm.read();
    byte code = mm.read();
    assert code == PACKET_FALG;
    pstmtId = mm.readUB4();
    paramId = mm.readUB2();
    this.longData = mm.readBytes(packetLength - (1 + 4 + 2));
}
Also used : MySQLMessage(io.mycat.backend.mysql.MySQLMessage)

Aggregations

MySQLMessage (io.mycat.backend.mysql.MySQLMessage)56 Test (org.junit.Test)6 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 ByteBuffer (java.nio.ByteBuffer)4 BindValue (io.mycat.backend.mysql.BindValue)2 BufferHolder (io.mycat.memory.unsafe.row.BufferHolder)2 UnsafeRow (io.mycat.memory.unsafe.row.UnsafeRow)2 UnsafeRowWriter (io.mycat.memory.unsafe.row.UnsafeRowWriter)2 EOFPacket (io.mycat.net.mysql.EOFPacket)2 ServerConnection (io.mycat.server.ServerConnection)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2