use of io.mycat.net.mysql.RowDataPacket in project Mycat_plus by coderczp.
the class ResultSetUtil method parseRowData.
public static RowDataPacket parseRowData(byte[] row, List<byte[]> fieldValues) {
RowDataPacket rowDataPkg = new RowDataPacket(fieldValues.size());
rowDataPkg.read(row);
return rowDataPkg;
}
use of io.mycat.net.mysql.RowDataPacket in project Mycat_plus by coderczp.
the class ResultSetUtil method getColumnVal.
public static byte[] getColumnVal(byte[] row, List<byte[]> fieldValues, int columnIndex) {
RowDataPacket rowDataPkg = new RowDataPacket(fieldValues.size());
rowDataPkg.read(row);
byte[] columnData = rowDataPkg.fieldValues.get(columnIndex);
return columnData;
}
use of io.mycat.net.mysql.RowDataPacket in project Mycat_plus by coderczp.
the class RowDataPacketGrouper method filterHaving.
private void filterHaving() {
if (havingCols.getColMeta() == null || result == null) {
return;
}
Iterator<RowDataPacket> it = result.iterator();
byte[] right = havingCols.getRight().getBytes(StandardCharsets.UTF_8);
int index = havingCols.getColMeta().getColIndex();
// Added by winbill. 20160312.
int colType = havingCols.getColMeta().getColType();
while (it.hasNext()) {
RowDataPacket rowDataPacket = it.next();
switch(havingCols.getOperator()) {
case "=":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (eq(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
case ">":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (gt(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
case "<":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (lt(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
case ">=":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (gt(rowDataPacket.fieldValues.get(index), right, colType) && eq(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
case "<=":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (lt(rowDataPacket.fieldValues.get(index), right, colType) && eq(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
case "!=":
/* Add parameter of colType, Modified by winbill. 20160312. */
if (neq(rowDataPacket.fieldValues.get(index), right, colType)) {
it.remove();
}
break;
}
}
}
use of io.mycat.net.mysql.RowDataPacket in project Mycat_plus by coderczp.
the class MaxHeap method swap.
private void swap(int i, int j) {
RowDataPacket tmp = data.get(i);
RowDataPacket elementAt = data.get(j);
data.set(i, elementAt);
data.set(j, tmp);
}
use of io.mycat.net.mysql.RowDataPacket in project Mycat_plus by coderczp.
the class MinHeap method swap.
private void swap(int i, int j) {
RowDataPacket tmp = data.get(i);
RowDataPacket elementAt = data.get(j);
data.set(i, elementAt);
data.set(j, tmp);
}
Aggregations