Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Fixed
-
5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
LOAD DATA LOCAL can be disabled in two different ways:
- It can be disabled on the server side by setting local_infile=0.
https://mariadb.com/kb/en/library/server-system-variables/#local_infile
- It can be disabled on the client side by unsetting the CLIENT_LOCAL_FILES capability flag with mysql_real_connect or by unsetting the MYSQL_OPT_LOCAL_INFILE option with mysql_optionsv.
https://mariadb.com/kb/en/library/mysql_real_connect/
https://mariadb.com/kb/en/library/mysql_optionsv/
When LOAD DATA LOCAL is disabled and the user tries executing LOAD DATA LOCAL, the server throws an error with error code ER_NOT_ALLOWED_COMMAND:
https://github.com/MariaDB/server/blob/mariadb-10.2.26/sql/sql_parse.cc#L4568
The generic error message for this error code is the following:
The used command is not allowed with this MariaDB version
https://github.com/MariaDB/server/blob/mariadb-10.2.26/sql/share/errmsg-utf8.txt#L3373
Unfortunately, this error message isn't really true in this case. The command is allowed with this MariaDB version. It is not allowed with the current configuration.
It would be more accurate if the generic error message said something like the following:
The used command is not allowed by the MariaDB server or client
It would be the least ambiguous if the error message said something like the following in this specific circumstance:
The used command is not allowed because the MariaDB server or client has disabled the local infile capability