check local_infile

This commit is contained in:
Marc Delisle
2003-02-04 13:40:38 +00:00
parent 1bb13b52ef
commit b64ed72e5e
2 changed files with 12 additions and 4 deletions

View File

@@ -10,6 +10,8 @@ $Source$
switching from one server to the other
* db_details_qbe.php3: bug 661758 (undefined offset when doing a qbe
and only table selected)
* ldi_check.php3: check local_infile on recent MySQL versions,
thanks to Alexander
2003-02-03 Michal Cihar <nijel@users.sourceforge.net>
* libraries/display_tbl.lib.php3, tbl_change.php3: Show blob size (RFE

View File

@@ -70,16 +70,22 @@ if (isset($btnLDI) && ($textfile != 'none')) {
// have FILE priv, and even if the file is on the server
// (which is the present case)
//
// if we find how to check the server about --local-infile
// and --enable-local-infile, we could modify the code
// to use LOCAL for version >= 32349 if the server accepts it
//
// we could also code our own loader, but LOAD DATA INFILE is optimized
// for speed
if (PMA_MYSQL_INT_VERSION < 32349) {
$query .= ' LOCAL';
}
if (PMA_MYSQL_INT_VERSION > 40003) {
$tmp_query = "SHOW VARIABLES LIKE 'local\_infile'";
$result = PMA_mysql_query($tmp_query);
if ($result != FALSE && mysql_num_rows($result) > 0) {
$query .= ' LOCAL';
}
mysql_free_result($result);
}
$query .= ' INFILE \'' . $textfile . '\'';
if (!empty($replace)) {
$query .= ' ' . $replace;