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

Add generate_request functions (stmt_execute and bulk_execute) to internal API

    XMLWordPrintable

Details

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

    Description

      When using C/C within python, every api call needs to be encapsulated by BEGIN/END Threads, e.g.

      Py_BEGIN_ALLOW_THREADS()
      rc= mysql_stmt_execute(self->stmt);
      Py_END_ALLOW_THREADS()
      

      This causes a lot of overhead, in case of callback function for filling values was specified: Whenever calling python code inside mysql_stmt_execute() we need to call Py_END_ALLOW_THREADS and Py_BEGIN_ALLOW_THREADS() again.

      Instead of it would be much easier to have a call which fills the buffer and another call which executes the stmt:

      buffer= self->connection->mysql->methods->generate_execute_request(self->stmt, &buflen)
      PY_BEGIN_ALLOW_THREADS()
      rc= self-connection->mysql->methods->send_command(COM_STMT_EXECUTE, buffer, buflen, ...)
      PY_BEGIN_END_THREADS()
      

      PY_END_ALLOW_THREADS()

      Attachments

        Activity

          People

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