Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-873

Avoid copying result set metadata on every prepared statement execution

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 3.4
    • None
    • None

    Description

      When the server skips the column definitions in the COM_STMT_EXECUTE response (MARIADB_CLIENT_CACHE_METADATA), mthd_stmt_read_execute_response() rebuilds mysql->fields by deep copying stmt->fields. That is six string duplications per column on every execution.

      Nothing reads this copy in the common case: it is copied back field by field onto stmt->fields (a no-op) and freed with the next command. So the network saving of metadata caching is partly lost on the client side.

      Change
      Only make the copy when stmt->fields is going to be rebuilt from mysql->fields (more result sets follow, or stmt->field_count was reset). Otherwise mysql->fields stays NULL and the statement keeps using its own metadata.

      Attachments

        Activity

          People

            georg Georg Richter
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.