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

Add callback support for prepared statement

    XMLWordPrintable

Details

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

    Description

      In case an application uses a data type which has no corresponding MariaDB data type, additional memory needs to be allocated, and the data needs to be converted.

      Speaking of bulk insert, additional memory needs to be allocated for all parameters, so it would be much more efficient to have a callback function which retrieves the parameters from the application for each row.

      When retrieving information (mysql_stmt_fetch) raw data will be converted to the bind buffers, afterwards the application needs to convert the bind buffers to the application specific format.
      It would be much more efficient to allow the application to access the raw data and convert the data directly into required types.

      Proposal:

      callback functions:

      int mariadb_param_callback(void *data, MYSQL_BIND* bind, unsigned int row_number)
      void mariadb_result_callback(void *data, unsigned char *raw_data)
      

      New parameters for mysql_stmt_attr_set/get:

      • STMT_ATTR_CB_DATA: registers user data which will be passed to the callback functions as first parameter
      • STMT_ATTR_CB_PARAM: registers the call back function for parameters
      • STMT_ATTR_CB_RESULT: registers the call back function for result fetching

      Attachments

        Issue Links

          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.