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

Parameters in the %(name)s form substituted incorrectly in some cases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: None
    • Component/s: Generic
    • Labels:
      None
    • Environment:

      Description

      When I execute the following line, server receives zero in the first parameter instead of one:

      cursor.execute(
          'select %(value)s, %(dummy)s',
          dict(value=decimal.Decimal(1), dummy=1),
      )
      

      The following parts are important: parameter count (a minimum of 2), parameter type (should be decimal.Decimal, not int), parameter style (should be %(value)s, not %s or ?).

      Actual query is not important, works as well with insert etc (inseting incorrect values into database). Type of second parameter is not important (reproduces with both str and int).

      Test case is attached.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: