[CONPY-213] Converters are ignored on queries from cursor.fetchall Created: 2022-07-06  Updated: 2022-07-07  Resolved: 2022-07-07

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.1.2
Fix Version/s: 1.1.4

Type: Bug Priority: Major
Reporter: Gavin D'souza Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Python Version: 3.10

 Description   

Values aren't being casted accurately in 1.1.x. Casting worked fine until last 1.0.x. Setting the converter option with a map that looks like the following block:

# converter map
{
	FIELD_TYPE.NEWDECIMAL: float,
	FIELD_TYPE.DATETIME: get_datetime,
}
 
# sample snippet
>>> cursor.execute("select 1.1-2.1")
>>> cursor.fetchall()
[(Decimal('-1.0'),)] # in version 1.1.3
[(-1.0,),] # in version 1.0.x


Generated at Thu Feb 08 03:31:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.