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

Callback support for session tracking

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.3.1
    • 3.3.2
    • Protocol
    • None

    Description

      Currently the API functions mysql_session_track_get_first/get_next() provide access to session tracking data sent by server in it's OK packet.

      It would be more convenient to offer the possibility to register a callback function, which will be called if the server sends session track information to the client.

      Callback function:

      void session_track_cb(void *userdata, enum enum_session_state_type type,
                                 char *val1, size_t len1, char *val2, size_t len2)
      {
        switch (type) {
          case SESSION_TRACK_SCHEMA:
            printf("New schema: %.*s\n", len1, val1);
            break;
          case SESSION_TRACK_SYSTEM_VARIABLES:
            printf("Variable: "%.*s  Value: %.*s\n", len1, val1, len2, val2);
            break;
        }
      }
      

      Registering the callback function:

      if (mysql_optionsv(handle, MARIADB_OPT_SESSION_TRACK_CALLBACK, session_track_cb, data))
      {
        printf("Error: %s\n", mysql_error(handle));
      }
      

      Attachments

        Issue Links

          Activity

            People

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