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

Wrong type for SQL type JSON

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.3
    • Component/s: Generic
    • Labels:
      None

      Description

      Since MariaDB Server 10.5 data type JSON is not returned as MYSQL_TYPE_JSON anymore, but as MYSQL_TYPE_BLOB with extended field attributes, which results in wrong data type:

      import mariadb
       
      conn=mariadb.connect(db="test")
      cursor=conn.cursor()
      cursor.execute("create temporary table t1(a json)")
      cursor.execute("insert into t1 values ('{}')")
      cursor.execute("select * from t1");
      fieldinfo= mariadb.fieldinfo()
      info= cursor.description
      print(fieldinfo.type(info[0]))
      del cursor
      del connection
      

      Output:

      BLOB
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: