Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-94

Subtypes not supported

    XMLWordPrintable

Details

    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
      

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.