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

Add support for prepared cursor

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 0.9.1
    • 0.9.52
    • Generic
    • None

    Description

      Add support for prepared cursors:

      cursor= connection.cursor(Prepared=True)
      

      When executing a SQL statement via cursor.execute() the first time, the sql statement will be parsed, prepared and executed. Subsequent calls to cursor.execute()`will irgnore the statement string, since it was already prepared but executing it again using the values specified in 2nd parameter of execute().

      Example:

      cursor= connection.cursor(Prepared=True)
      cursor.execute("INSERT INTO t1 VALUES (?,?)", (1,2))
      cursor.execute("INSERT INTO t1 VALUES (?,?)", (3,4))
      # this will also work, since the sql statement will be ignored
      cursor.execute("", (2,3))
      

      Attachments

        Activity

          People

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