Bug #77956 [Opn]: When mysqli.allow_local_infile = Off, use a meaningful error message

From: Date: Wed, 01 May 2019 15:29:12 +0000
Subject: Bug #77956 [Opn]: When mysqli.allow_local_infile = Off, use a meaningful error message
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220669@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77956&edit=1 ID: 77956 User updated by: j dot knappen at mx dot uni-saarland dot de Reported by: j dot knappen at mx dot uni-saarland dot de Summary: When mysqli.allow_local_infile = Off, use a meaningful error message Status: Open Type: Bug Package: MySQLi related Operating System: ubuntu 18.04 LTS PHP Version: 7.2.17 Block user comment: N Private report: N New Comment: As I have learned, the php error message is just the error number, in this case the uninformative code "0" meaning "no error at all". There should be an error code for "Forbidden by configuration" that the application can translate into something meaningful. Previous Comments: ------------------------------------------------------------------------ [2019-05-01 14:38:33] j dot knappen at mx dot uni-saarland dot de Description: ------------ php has changed the default value for mysqli.allow_local_infile to "Off". However, when an application tries to execute a LOAD DATA LOCAL INFILE a completely uninformative and misleading error message is thrown: === A MySQL query did not run successfully! Original query: LOAD DATA LOCAL INFILE '/data2/cqpweb/cach/tab_dist_fycel9oplk' INTO TABLE db_dist_g2f3ndxf40 FIELDS ESCAPED BY '' /* from User: knappen | Function: create_db() | 2019-Apr-25 11:23:01 */ Error # 0: === It seems to blame MySQL for not running the query although the cause of failure is the php configuration. The error message should say something like "MySQL query forbidden by configuration, mysqli.allow_local_infile = Off". In this case it is possible to search for the cause of this behaviour and for a remedy. php --version PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS ) mysql --version mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper Test script: --------------- https://askubuntu.com/q/1138415/284224 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77956&edit=1

« previous php.bugs (#220669) next »