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

Please add support for accessing st_mysql_stmt.bind field

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Hi!
      First of all, an excellent library, a pleasure to work with.

      I'm fetching a statement execution result into unrelated C++ types, and i do it row by row via `mysql_stmt_bind_result`
      call for each new row like this:

      1. Create an instance of my C++ type
      2. set up an array of `MYSQL_BIND` structures to point into that instance
      3. call `mysql_stmt_bind_result` with that array
      4. call `mysql_stmt_fetch` and somehow resolve potential truncations with `mysql_stmt_fetch_column` calls

      and it works wonders.

      Doing some benchmarks i noticed that `mysql_stmt_bind_result` call seems to be very costly, because it copies the whole array into `st_mysql_stmt.bind` field and that `memcpy` shows.
      However in my cases this copy is actually redundant and instead of doing 2. and 3. in aforementioned process i can just update the result bind array stored in `st_mysql_stmt` in place, and not only it works just fine, but also allows one to avoid copying binds array for every new row.

      Right now i'm accessing that `st_mysql_stmt.bind` field directly, but it would be much more convenient to access it via an API call instead, something in the lines of `mysql_stmt_get_result_bind` or like that.

      I do know that `STMT_ATTR_CB_RESULT` exists, however it's not documented and i'm perfectly fine with mariadb-connector-c taking the burden of fetching/parsing data into `MYSQL_BIND` for me.

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              i.trofimow Ivan
              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.