use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.
the class OkPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
fieldCount = mm.read();
affectedRows = mm.readLength();
insertId = mm.readLength();
serverStatus = mm.readUB2();
warningCount = mm.readUB2();
if (mm.hasRemaining()) {
this.message = mm.readBytesWithLength();
}
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.
the class AuthPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
clientFlags = mm.readUB4();
maxPacketSize = mm.readUB4();
charsetIndex = (mm.read() & 0xff);
// read extra
int current = mm.position();
int len = (int) mm.readLength();
if (len > 0 && len < FILLER.length) {
byte[] ab = new byte[len];
System.arraycopy(mm.bytes(), mm.position(), ab, 0, len);
this.extra = ab;
}
mm.position(current + FILLER.length);
user = mm.readStringWithNull();
password = mm.readBytesWithLength();
if (((clientFlags & Capabilities.CLIENT_CONNECT_WITH_DB) != 0) && mm.hasRemaining()) {
database = mm.readStringWithNull();
}
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.
the class CommandPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
command = mm.read();
arg = mm.readBytes();
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.
the class ErrorPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
fieldCount = mm.read();
errno = mm.readUB2();
if (mm.hasRemaining() && (mm.read(mm.position()) == SQLSTATE_MARKER)) {
mm.read();
sqlState = mm.readBytes(5);
}
message = mm.readBytes();
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat_plus by coderczp.
the class ErrorPacket method read.
public void read(BinaryPacket bin) {
packetLength = bin.packetLength;
packetId = bin.packetId;
MySQLMessage mm = new MySQLMessage(bin.data);
fieldCount = mm.read();
errno = mm.readUB2();
if (mm.hasRemaining() && (mm.read(mm.position()) == SQLSTATE_MARKER)) {
mm.read();
sqlState = mm.readBytes(5);
}
message = mm.readBytes();
}
Aggregations