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

Decimal values returned as strings when passing in paramaters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.58
    • Component/s: DBAPI 2.0
    • Labels:
      None

      Description

      Passing in parameters causes decimals to be returned as strings.

      conn = mariadb.connect(**config)
      cur = conn.cursor()
      query = "select round(.75 * (? / 3), 2) as val"
      cur.execute(query,[5])
      print(result)

      1. returns ('1.25',)

      conn = mariadb.connect(**config)
      cur = conn.cursor()
      query = "select round(.75 * (6 / 3), 2) as val"
      cur.execute(query)
      print(result)

      1. returns (Decimal('1.50'),)

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            rhedgpeth Rob Hedgpeth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: