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

!include/!includedir not parsed in my.cnf




      The current code in ma_default.c does not care for include keywords (!include, !includedir) in my.cnf.
      The whole parse code looks completely different to the my.cnf parser of the MariaDB Server (mysys/my_default.c)

      The API documentation of mysql_optionsv(... MYSQL_READ_DEFAULT_FILE ...) links to the my.cnf documentation, which says nothing about {{!include}}s only being parseable by the MariaDB server.

      The default location of the MariaDB socket is /tmp/mysql.sock, but many distributions use different locations (eg. CentOS 7: /var/lib/mysql/mysql.sock). This differing location can be specified eg. in /etc/my.cnf.d/client.cnf:

      # These two groups are read by the client library
      # Use it for options that affect all clients, but not the server
      # This group is not read by mysql client library,
      # If you use the same .cnf file for MySQL and MariaDB,
      # use it for MariaDB-only client options

      While above configuration snippet works fine with MySQL Connector/C, the MariaDB Connector/C silently ignores the !includedir keyword. Thus, the socket= directive is not read, and the client looks for the socket at the wrong location.

      A simple local workaround is to hard-code the "correct" location of the MariaDB socket into the application, or ask the user to configure it directly in /etc/my.cnf. But this is neither clean nor portable.

      I don't know what's easier: importing the my.cnf config parser from MariaDB into Connector/C, or to implement the "include" functionality independently. However, it should be better to maintain if there's only one code base for parsing my.cnf files.


        Issue Links



              georg Georg Richter
              klk Klaus Keppler
              0 Vote for this issue
              3 Start watching this issue



                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.