Skip to content

Commit dbfe6d9

Browse files
committed
handle case where a field's type doesn't have a decoder,
this occurs with SELECT NULL, '' for example.
1 parent fecc4a6 commit dbfe6d9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pymysql/connections.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,15 +897,13 @@ def _read_rowdata_packet(self):
897897

898898
row = []
899899
for field in self.fields:
900+
data = packet.read_length_coded_string()
901+
converted = None
900902
if field.type_code in self.connection.decoders:
901903
converter = self.connection.decoders[field.type_code]
902-
903904
if DEBUG: print "DEBUG: field=%s, converter=%s" % (field, converter)
904-
data = packet.read_length_coded_string()
905-
converted = None
906905
if data != None:
907906
converted = converter(self.connection, field, data)
908-
909907
row.append(converted)
910908

911909
rows.append(tuple(row))

0 commit comments

Comments
 (0)