[CONPY-94] Subtypes not supported Created: 2020-08-06  Updated: 2020-08-06  Resolved: 2020-08-06

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.0.0
Fix Version/s: 1.0.1

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: sqlalchemy


 Description   

When creating a subtype of int, it can't be used in execute()/executemany() methods:

The following snippet

import mariadb
 
class foo(int):
  def bar(self):pass
 
x=foo(2)
 
conn=mariadb.connect(db="test")
cursor=conn.cursor()
cursor.execute("SELECT ?", (x,))

fails with

Traceback (most recent call last):
  File "x.py", line 10, in <module>
    cursor.execute("SELECT ?", (x,))
mariadb.DatabaseError.DataError: Data type 'foo' in column 0 not supported in MariaDB Connector/Python


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