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

cursor dictionary and named_tuple parameter do not work anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.3, 1.1.2
    • Fix Version/s: 1.1.4
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Python Version:
      3.9

      Description

      Both named_tuple and dictionary are not working with the newer connector, both parameter will just a list of tuples on a fetchall.

      Minimal example:

      import mariadb
       
      conn_params = {"user": "root", "password": "xxx", "host": "localhost", "database": "myDB"}
      connection = mariadb.connect(**conn_params)
       
      # cursor = connection.cursor(named_tuple=True)
      cursor = connection.cursor(dictionary=True)
      cursor.execute("SELECT field FROM myTable")
      rows = cursor.fetchall()
      print(rows)
      # will print list of tuples without field names
      

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            fehrlich Franz Ehrlich
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.