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

Restore 1.x prepared cursor option for migration compatibility (deprecated)

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-rc3
    • Other
    • None

    Description

      The 1.x connector supported conn.cursor(prepared=True), where the first execute() prepares the statement and every subsequent execute() ignores its SQL argument, re-running the prepared statement with new parameters. This option was dropped in 2.0, breaking code that relied on it.

      Re-add prepared as a deprecated compatibility option across all sync cursor implementations (pure-Python and C ) (async was not available in 1.1)

      First execute() prepares via the binary protocol, later calls ignore their SQL and rebind params (exact 1.x behavior, including empty-string SQL).

      Emit a DeprecationWarning pointing users to binary=True, which reuses prepared statements while the SQL is unchanged without the ignored-SQL footgun.

      Migration: cursor(prepared=True) -> cursor(binary=True), keep executing the same SQL.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            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.