throws IOException {
//
int unusedColumnCount = 0;
final byte[] types = tme.getColumnTypes();
final Metadata metadata = tme.getColumnMetadata();
final BitColumn nullColumns = is.readBit(types.length, true);
final List<Column> columns = new ArrayList<Column>(types.length);
for(int i = 0; i < types.length; ++i) {
//
int length = 0;
final int meta = metadata.getMetadata(i);
int type = CodecUtils.toUnsigned(types[i]);
if(type == MySQLConstants.TYPE_STRING && meta > 256) {
final int meta0 = meta >> 8;
final int meta1 = meta & 0xFF;
if ((meta0 & 0x30) != 0x30) { // a long CHAR() field: see #37426
type = meta0 | 0x30;
length = meta1 | (((meta0 & 0x30) ^ 0x30) << 4);
} else {
switch (meta0) {
case MySQLConstants.TYPE_SET:
case MySQLConstants.TYPE_ENUM:
case MySQLConstants.TYPE_STRING:
type = meta0;
length = meta1;
break;
default:
throw new NestableRuntimeException("assertion failed, unknown column type: " + type);
}
}
}
//
if(!usedColumns.get(i)) {
unusedColumnCount++;
continue;
} else if(nullColumns.get(i - unusedColumnCount)) {
columns.add(NullColumn.valueOf(type));
continue;
}
//