Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
The text gives examples how to enable/disable LOAD LOCAL DATA INFILE
mysql_optionsv(mysql, MYSQL_OPT_LOCAL_INFILE, NULL); /* disable */
mysql_optionsv(mysql, MYSQL_OPT_LOCAL_INFILE, (void )"1"); / enable */
while looking at the code,
case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/
if (!arg1 || test(*(unsigned int *) arg1))
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
else
mysql->options.client_flag&= ~CLIENT_LOCAL_FILES;
if (arg1) {
CHECK_OPT_EXTENSION_SET(&mysql->options);
mysql->extension->auto_local_infile= *(uint*)arg1 == LOCAL_INFILE_MODE_AUTO
? WAIT_FOR_QUERY : ALWAYS_ACCEPT;
}
break ;
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
#define LOCAL_INFILE_MODE_ON 1
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_AUTO
{"report":{"fcp":1085,"ttfb":298.6000003814697,"pageVisibility":"visible","entityId":106534,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b9dc124c-090c-4247-b1e9-cf4d09423201","navigationType":0,"readyForUser":1157.6999998092651,"redirectCount":0,"resourceLoadedEnd":1195.8999996185303,"resourceLoadedStart":304.19999980926514,"resourceTiming":[{"duration":165.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":304.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":304.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":469.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":181.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":304.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":304.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":486,"responseStart":0,"secureConnectionStart":0},{"duration":265.29999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":304.6000003814697,"connectEnd":304.6000003814697,"connectStart":304.6000003814697,"domainLookupEnd":304.6000003814697,"domainLookupStart":304.6000003814697,"fetchStart":304.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":304.6000003814697,"responseEnd":569.8999996185303,"responseStart":569.8999996185303,"secureConnectionStart":304.6000003814697},{"duration":339.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":304.80000019073486,"connectEnd":304.80000019073486,"connectStart":304.80000019073486,"domainLookupEnd":304.80000019073486,"domainLookupStart":304.80000019073486,"fetchStart":304.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":304.80000019073486,"responseEnd":644.3999996185303,"responseStart":644.3999996185303,"secureConnectionStart":304.80000019073486},{"duration":343.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":305.1000003814697,"connectEnd":305.1000003814697,"connectStart":305.1000003814697,"domainLookupEnd":305.1000003814697,"domainLookupStart":305.1000003814697,"fetchStart":305.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":305.1000003814697,"responseEnd":648.1999998092651,"responseStart":648.1999998092651,"secureConnectionStart":305.1000003814697},{"duration":343.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":305.19999980926514,"connectEnd":305.19999980926514,"connectStart":305.19999980926514,"domainLookupEnd":305.19999980926514,"domainLookupStart":305.19999980926514,"fetchStart":305.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":305.19999980926514,"responseEnd":648.6999998092651,"responseStart":648.6000003814697,"secureConnectionStart":305.19999980926514},{"duration":343.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":305.3999996185303,"connectEnd":305.3999996185303,"connectStart":305.3999996185303,"domainLookupEnd":305.3999996185303,"domainLookupStart":305.3999996185303,"fetchStart":305.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":305.3999996185303,"responseEnd":649,"responseStart":649,"secureConnectionStart":305.3999996185303},{"duration":409.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":305.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":305.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":714.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":343.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":305.80000019073486,"connectEnd":305.80000019073486,"connectStart":305.80000019073486,"domainLookupEnd":305.80000019073486,"domainLookupStart":305.80000019073486,"fetchStart":305.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":305.80000019073486,"responseEnd":649.5,"responseStart":649.5,"secureConnectionStart":305.80000019073486},{"duration":408.8999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":306,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":306,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":714.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":343.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":306.19999980926514,"connectEnd":306.19999980926514,"connectStart":306.19999980926514,"domainLookupEnd":306.19999980926514,"domainLookupStart":306.19999980926514,"fetchStart":306.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":306.19999980926514,"responseEnd":650,"responseStart":650,"secureConnectionStart":306.19999980926514},{"duration":529.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":306.8999996185303,"connectEnd":306.8999996185303,"connectStart":306.8999996185303,"domainLookupEnd":306.8999996185303,"domainLookupStart":306.8999996185303,"fetchStart":306.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":306.8999996185303,"responseEnd":836.1999998092651,"responseStart":836.1999998092651,"secureConnectionStart":306.8999996185303},{"duration":817.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":307,"connectEnd":307,"connectStart":307,"domainLookupEnd":307,"domainLookupStart":307,"fetchStart":307,"redirectEnd":0,"redirectStart":0,"requestStart":307,"responseEnd":1124.6000003814697,"responseStart":1124.6000003814697,"secureConnectionStart":307},{"duration":109.70000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":726.8999996185303,"connectEnd":726.8999996185303,"connectStart":726.8999996185303,"domainLookupEnd":726.8999996185303,"domainLookupStart":726.8999996185303,"fetchStart":726.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":726.8999996185303,"responseEnd":836.6000003814697,"responseStart":836.6000003814697,"secureConnectionStart":726.8999996185303},{"duration":196.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":986.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":986.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1183.5,"responseStart":0,"secureConnectionStart":0},{"duration":197.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":987.8000001907349,"connectEnd":987.8000001907349,"connectStart":987.8000001907349,"domainLookupEnd":987.8000001907349,"domainLookupStart":987.8000001907349,"fetchStart":987.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":987.8000001907349,"responseEnd":1185.6999998092651,"responseStart":1185.6000003814697,"secureConnectionStart":987.8000001907349},{"duration":177.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1078.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1078.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1256,"responseStart":0,"secureConnectionStart":0},{"duration":207.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":988.3000001907349,"connectEnd":988.3000001907349,"connectStart":988.3000001907349,"domainLookupEnd":988.3000001907349,"domainLookupStart":988.3000001907349,"fetchStart":988.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":988.3000001907349,"responseEnd":1195.8999996185303,"responseStart":1195.8999996185303,"secureConnectionStart":988.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":131,"responseStart":299,"responseEnd":300,"domLoading":302,"domInteractive":1211,"domContentLoadedEventStart":1211,"domContentLoadedEventEnd":1249,"domComplete":1554,"loadEventStart":1554,"loadEventEnd":1554,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1198.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1199.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1199.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1200.6000003814697},{"name":"activityTabFullyLoaded","time":1266.6999998092651}],"measures":[],"correlationId":"5095f844c327ad","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Fxed in documentation:
https://github.com/mariadb-corporation/mariadb-connector-c/wiki/mysql_optionsv