Bug #94396 Error message too broad: The used command is not allowed with this MySQL version
Submitted: 19 Feb 17:09 Modified: 19 Feb 18:58
Reporter: Bill Karwin (Candidate Quality Contributor) (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[19 Feb 17:09] Bill Karwin
Description:
When using LOAD DATA LOCAL INFILE without enabling the right options, the error message does not tell the user what it means, or what they should do to fix the problem.

The error in the code is ER_NOT_ALLOWED_COMMAND, which occurs when the client executes LOAD DATA LOCAL INFILE without enabling the local_infile option.

The same error was also emitted in past versions of MySQL Server, if MySQL Server was built with with a compile macro DONT_ALLOW_SHOW_COMMANDS, and the client tried to execute a SHOW command. But that code seems to have been removed in 2013 for BUG#16391701

https://github.com/mysql/mysql-server/commit/5ec33b9093a5a73ca225377884ff89efa5a06f7d

The error "The used command is not allowed with this MySQL version" is now too broad, covering an error case that no longer exists in the code, and also is too vague, not telling the user how to fix it.

Also, the reference to "this MySQL version" is misleading, because it gives the impression that the error could be fixed by upgrading or downgrading MySQL.

How to repeat:
mysql> load data local infile 'foo.txt' into table foo;

ERROR 1148 (42000): The used command is not allowed with this MySQL version

Suggested fix:
Change the wording of the error message to help the user understand what to do when local_infile is not configured.

Any error message should explain enough to make the user understand what they need to do, or at least what they need to read about.

Here's a suggestion for wording:

Loading local data is disabled; set local_infile=1 in both the server and client options to enable.
[19 Feb 18:58] Miguel Solorzano
Thank you for the bug report.