[CONC-395] Dashes and underscores are not interchangeable in options in my.cnf Created: 2019-03-23  Updated: 2019-06-01  Resolved: 2019-04-06

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.8
Fix Version/s: 3.1.1

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-19035 Make MariaDB Connector/C handle my.cn... Open
Relates
relates to CONC-327 !include/!includedir not parsed in my... Closed
relates to CONC-396 !includedir in my.cnf does not includ... Open
relates to CONC-402 Replace underscores with dashes in co... Closed
relates to CONC-404 Add option that corresponds to --defa... Open
relates to CONC-394 Some TLS-related options are not sett... Closed
relates to CONC-399 Add option that corresponds to --defa... Open
relates to CONC-415 Option prefixes not supported in my.cnf Open
relates to CONC-416 On Windows, C/C looks for first my.cn... Closed
relates to ODBC-229 Add parameters that correspond to MYS... Closed

 Description   

When the server parses my.cnf or other option/configuration files, dashes and underscores are interchangeable in options:

Dashes (-) and underscores (_) in options are interchangeable.

https://mariadb.com/kb/en/library/configuring-mariadb-with-option-files/#option-file-syntax

This is not the case with MariaDB Connector/C:

Unlike with the server, dashes (-) and underscores (_) in options are not interchangeable for MariaDB Connector/C. Options must be specified exactly as they are defined.

https://mariadb.com/kb/en/library/configuring-mariadb-connectorc-with-option-files/#option-file-syntax

I think it would be pretty easy to fix this.

One potential fix would be to modify the _mariadb_set_conf_option function, so that it makes a copy of the config_option C-string argument and replaces all underscores (_) with dashes (-) before doing the strcmp:

https://github.com/MariaDB/mariadb-connector-c/blob/1285dc72a043f09d9a51abcfc3a4fbfb5192067e/libmariadb/mariadb_lib.c#L696



 Comments   
Comment by Sergei Golubchik [ 2019-03-24 ]

I agree, it should behave as in the server

Generated at Thu Feb 08 03:05:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.