[CONC-574] Incorrect documentation for MYSQL_OPT_LOCAL_INFILE option Created: 2022-01-10 Updated: 2022-01-10 Resolved: 2022-01-10 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | API, Documentation |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Lawrin Novitsky | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The text gives examples how to enable/disable LOAD LOCAL DATA INFILE mysql_optionsv(mysql, MYSQL_OPT_LOCAL_INFILE, NULL); /* disable */ while looking at the code,
it's obvious, that NULL value enables, and not disables "LOAD LOCAL DATA INFILE". More over, the value is expected to be pointer to unsigned int, and pointed value is tested as boolean value, while manual page has string "1" as the example of how to enable. Given all that, I guess it can be also considered a bug in the connector, and not only in documentation, and it should be if (!arg1 || !test((unsigned int) arg1)) so NULL and 0 have the same effect - disable LOCAL DATA, and that will be in line with current documentation and more logically consistent. It seems also, that the value pointed by arg1 is also important, and it's not only true/false, since LOCAL_INFILE_MODE_AUTO has value 2. #define LOCAL_INFILE_MODE_OFF 0 |
| Comments |
| Comment by Georg Richter [ 2022-01-10 ] |
|
Fxed in documentation: https://github.com/mariadb-corporation/mariadb-connector-c/wiki/mysql_optionsv |