connections.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Problematica-public 作者: TechMaz 项目源码 文件源码
def __parse_field_descriptor(self):
    """Parse the 'Field Descriptor' (Metadata) packet.

    This is compatible with MySQL 4.1+ (not compatible with MySQL 4.0).
    """
    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...
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号