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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.2
    • Generic
    • None

    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

            georg Georg Richter
            qm2k Marat Khalili
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.