diff --git a/mariadb/cursors.py b/mariadb/cursors.py index 3ef8c2b..76d2743 100644 --- a/mariadb/cursors.py +++ b/mariadb/cursors.py @@ -353,7 +353,7 @@ def _fetch_row(self): if not self.field_count: raise mariadb.ProgrammingError("Cursor doesn't have a result set") row= super().fetchone() - if self._connection._converter: + if self._connection._converter and row: l= list(row) if not self._description: self._description= super().description diff --git a/testing/test/integration/test_cursor.py b/testing/test/integration/test_cursor.py index 80cdb39..21558a7 100644 --- a/testing/test/integration/test_cursor.py +++ b/testing/test/integration/test_cursor.py @@ -1333,7 +1333,18 @@ def test_conpy209(self): self.assertEqual(transformed, cursor._transformed_statement) del cursor - + def test_conpy213(self): + conversions= { **{FIELD_TYPE.NEWDECIMAL : float}} + connection = create_connection({"converter": conversions}) + cursor= connection.cursor() + cursor.execute("SELECT 1.1") + rows= cursor.fetchall() + self.assertEqual(rows[0][0], 1.1) + cursor.execute("SELECT 1.1") + row= cursor.fetchone() + self.assertEqual(row[0], 1.1) + del cursor + del connection def test_conpy91(self): with create_connection() as connection: