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

Cleanup export headers

    XMLWordPrintable

Details

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

    Description

      The purpose of this task is to cleanup export headers (mysql.h in first place) such that it does only includes structures needed by the API (MYSQL, MYSQL_BIND, MYSQL_STMT, MYSQL_ROW, perhaps couple of others), minimum needed defines, and reduce the number of additional #includes to the minimum. This helps to avoid conflicts when including mariadb headers elsewhere. The extraneous stuff should be either moved to internal headers, or completely removed

      Brief inspection of hings that should not be there (no client needs it)
      https://github.com/MariaDB/mariadb-connector-c/blob/master/include/mysql.h

      1. #include "mariadb_com.h"
        #include "mariadb_version.h"
        #include "ma_list.h"
        #include "mariadb_ctype.h"
        

      1. Internal use Structs MA_USED_MEM; MA_MEM_ROOT;
      2. something that should not be there at all

        extern unsigned int mysql_port;
        extern char *mysql_unix_port;
        

      1. something for internal consumption

        extern unsigned int mariadb_deinitialize_ssl;
        #define IS_PRI_KEY(n)	((n) & PRI_KEY_FLAG)
        #define IS_NOT_NULL(n)	((n) & NOT_NULL_FLAG)
        #define IS_BLOB(n)	((n) & BLOB_FLAG)
        #define INTERNAL_NUM_FIELD(f)...
        #define SET_CLIENT_ERROR(a, b, c, d)
        /* For mysql_async.c */
        #define set_mariadb_error(A,B,C) SET_CLIENT_ERROR((A),(B),(C),0)
        #define unknown_sqlstate SQLSTATE_UNKNOWN
        #define CLEAR_CLIENT_ERROR(a)
        #define MYSQL_COUNT_ERROR
        enum mysql_status 
        #define AUTO_SEC_PART_DIGITS 31
        #define SEC_PART_DIGITS 6
        #define MARIADB_INVALID_SOCKET -1
        /* Local infile support functions */
        #define LOCAL_INFILE_ERROR_LEN 512
         
        void my_set_error(MYSQL *mysql, unsigned int error_nr, 
                          const char *sqlstate, const char *format, ...);
        struct st_mariadb_api 
        struct st_mariadb_methods
        #define HAVE_MYSQL_REAL_CONNECT
        

      Attachments

        Activity

          People

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