Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20500

Server prints bad error message when user executes LOAD DATA LOCAL and it is disabled

    XMLWordPrintable

Details

    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

      Attachments

        Activity

          People

            robertbindar Robert Bindar
            GeoffMontee Geoff Montee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.