MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / _parse_field_descriptor

Method _parse_field_descriptor

pymysql/protocol.py:236–255  ·  view source on GitHub ↗

Parse the 'Field Descriptor' (Metadata) packet. This is compatible with MySQL 4.1+ (not compatible with MySQL 4.0).

(self, encoding)

Source from the content-addressed store, hash-verified

234 self._parse_field_descriptor(encoding)
235
236 def _parse_field_descriptor(self, encoding):
237 """Parse the 'Field Descriptor' (Metadata) packet.
238
239 This is compatible with MySQL 4.1+ (not compatible with MySQL 4.0).
240 """
241 self.catalog = self.read_length_coded_string()
242 self.db = self.read_length_coded_string()
243 self.table_name = self.read_length_coded_string().decode(encoding)
244 self.org_table = self.read_length_coded_string().decode(encoding)
245 self.name = self.read_length_coded_string().decode(encoding)
246 self.org_name = self.read_length_coded_string().decode(encoding)
247 (
248 self.charsetnr,
249 self.length,
250 self.type_code,
251 self.flags,
252 self.scale,
253 ) = self.read_struct("<xHIBHBxx")
254 # 'default' is a length coded binary and is still in the buffer?
255 # not used for normal result sets...
256
257 def description(self):
258 """Provides a 7-item tuple compatible with the Python PEP249 DB Spec."""

Callers 1

__init__Method · 0.95

Calls 2

read_structMethod · 0.80

Tested by

no test coverage detected