[CONC-416] On Windows, C/C looks for first my.cnf/my.ini in GetSystemDirectory() instead of GetSystemWindowsDirectory() Created: 2019-06-01  Updated: 2019-06-03  Resolved: 2019-06-03

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.8, 3.1.0
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-394 Some TLS-related options are not sett... Closed
relates to CONC-395 Dashes and underscores are not interc... Closed
relates to CONC-396 !includedir in my.cnf does not includ... Open
relates to CONC-399 Add option that corresponds to --defa... 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-415 Option prefixes not supported in my.cnf Open
relates to ODBC-229 Add parameters that correspond to MYS... Closed

 Description   

On Windows, MariaDB Connector/C looks for its first my.cnf/my.ini directory by calling GetSystemDirectory():

https://github.com/MariaDB/mariadb-connector-c/blob/v3.1.0/libmariadb/ma_default.c#L89

https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemdirectorya

https://mariadb.com/kb/en/library/configuring-mariadb-connectorc-with-option-files/#default-option-file-locations-on-windows

In contrast, on Windows, MariaDB Server looks for its first my.cnf/my.ini directory by calling GetSystemWindowsDirectory():

https://github.com/MariaDB/server/blob/mariadb-10.4.5/mysys/my_default.c#L1177

https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemwindowsdirectorya

https://mariadb.com/kb/en/library/configuring-mariadb-with-option-files/#default-option-file-locations-on-windows



 Comments   
Comment by Georg Richter [ 2019-06-03 ]

commit dfa8b03c602efc4f695d2953786f3cf13c8861b6 (HEAD -> 3.1, origin/HEAD, origin/3.1)
Author: Georg Richter <georg@mariadb.com>
Date: Mon Jun 3 10:17:08 2019 +0200

CONC-416:

Changed order for lookup configuration files on Windows:
1) GetSystemWindowsDirectory
2) GetSystemDirectory
3) Windows directory
4) C:\

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