def __parse_field_descriptor(self):
    self.catalog = self.read_length_coded_string()
    self.db = self.read_length_coded_string()
    self.table_name = self.read_length_coded_string()
    self.org_table = self.read_length_coded_string()
    self.name = self.read_length_coded_string().decode(self.connection.charset)
    self.org_name = self.read_length_coded_string()
    self.advance(1)  # non-null filler
    self.charsetnr = struct.unpack('<H', self.read(2))[0]
    self.length = struct.unpack('<I', self.read(4))[0]
    self.type_code = byte2int(self.read(1))
    self.flags = struct.unpack('<H', self.read(2))[0]
    self.scale = byte2int(self.read(1))  # "decimals"
    self.advance(2)  # filler (always 0x00)

    # 'default' is a length coded binary and is still in the buffer?
    # not used for normal result sets...
Parse the 'Field Descriptor' (Metadata) packet.
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/pymysql/connections.py/FieldDescriptorPacket.__parse_field_descriptor