From c5ae592370d98fccbadb914ee7a700ffd32a2023 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 21 Jan 2019 18:48:51 +0100 Subject: [PATCH] Actually set MYSQLI_OPT_LOCAL_INFILE 1e6b740e tried to set this but failed due to https://bugs.php.net/77496 and nobody probably ever tested it. Tested: Executed `LOAD DATA LOCAL INFILE 'README' INTO TABLE text(text)` SQL command successfully before, unsuceesfully after. Signed-off-by: Jakub Vrana --- libraries/classes/Dbi/DbiMysqli.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/classes/Dbi/DbiMysqli.php b/libraries/classes/Dbi/DbiMysqli.php index 196fd364ce..cb9605fb2b 100644 --- a/libraries/classes/Dbi/DbiMysqli.php +++ b/libraries/classes/Dbi/DbiMysqli.php @@ -58,12 +58,6 @@ class DbiMysqli implements DbiExtension $mysqli = \mysqli_init(); - if (defined('PMA_ENABLE_LDI')) { - $mysqli->options(MYSQLI_OPT_LOCAL_INFILE, true); - } else { - $mysqli->options(MYSQLI_OPT_LOCAL_INFILE, false); - } - $client_flags = 0; /* Optionally compress connection */ @@ -142,6 +136,12 @@ class DbiMysqli implements DbiExtension return false; } + if (defined('PMA_ENABLE_LDI')) { + $mysqli->options(MYSQLI_OPT_LOCAL_INFILE, true); + } else { + $mysqli->options(MYSQLI_OPT_LOCAL_INFILE, false); + } + return $mysqli; }