check local_infile
This commit is contained in:
@@ -10,6 +10,8 @@ $Source$
|
|||||||
switching from one server to the other
|
switching from one server to the other
|
||||||
* db_details_qbe.php3: bug 661758 (undefined offset when doing a qbe
|
* db_details_qbe.php3: bug 661758 (undefined offset when doing a qbe
|
||||||
and only table selected)
|
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>
|
2003-02-03 Michal Cihar <nijel@users.sourceforge.net>
|
||||||
* libraries/display_tbl.lib.php3, tbl_change.php3: Show blob size (RFE
|
* libraries/display_tbl.lib.php3, tbl_change.php3: Show blob size (RFE
|
||||||
|
@@ -70,16 +70,22 @@ if (isset($btnLDI) && ($textfile != 'none')) {
|
|||||||
// have FILE priv, and even if the file is on the server
|
// have FILE priv, and even if the file is on the server
|
||||||
// (which is the present case)
|
// (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
|
// we could also code our own loader, but LOAD DATA INFILE is optimized
|
||||||
// for speed
|
// for speed
|
||||||
|
|
||||||
if (PMA_MYSQL_INT_VERSION < 32349) {
|
if (PMA_MYSQL_INT_VERSION < 32349) {
|
||||||
$query .= ' LOCAL';
|
$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 . '\'';
|
$query .= ' INFILE \'' . $textfile . '\'';
|
||||||
if (!empty($replace)) {
|
if (!empty($replace)) {
|
||||||
$query .= ' ' . $replace;
|
$query .= ' ' . $replace;
|
||||||
|
Reference in New Issue
Block a user