diff --git a/ChangeLog b/ChangeLog index 8004949b7..61dc56bec 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-05-29 Marc Delisle + * ldi_check.php3, ldi_table.php3, lang/*: bug 740607, now autodetect + the best method (LOCAL or not) in the LOAD dialog, and allow user + to override it + 2003-05-29 Garvin Hicking * index.php3: Add frameborder to allow resizing. Introduces a 1px bar, but cannot be solved. Note that this is only neccessary diff --git a/lang/french-iso-8859-1.inc.php3 b/lang/french-iso-8859-1.inc.php3 index ba90785f8..8ab8cc23a 100644 --- a/lang/french-iso-8859-1.inc.php3 +++ b/lang/french-iso-8859-1.inc.php3 @@ -284,6 +284,8 @@ $strLines = 'Lignes'; $strLinesTerminatedBy = 'Lignes terminées par'; $strLinkNotFound = 'Lien absent'; $strLinksTo = 'Relié à'; +$strLoadExplanation = 'La meilleure méthode a été choisie par défaut, mais vous pouvez la changer si elle échoue.'; +$strLoadMethod = 'Méthode pour le LOAD'; $strLocalhost = 'Local'; $strLocationTextfile = 'Emplacement du fichier texte'; $strLogPassword = 'Mot de passe :'; @@ -638,6 +640,4 @@ $strZeroRemovesTheLimit = 'Note: Une valeur de 0 (zero) enl $strZip = '"zippé"'; // To translate -$strLoadMethod = 'LOAD method'; //to translate -$strLoadExplanation = 'The best method is checked by default, but you can change if it fails.'; //to translate ?> diff --git a/lang/french-utf-8.inc.php3 b/lang/french-utf-8.inc.php3 index 83dda60e2..7585c02f1 100644 --- a/lang/french-utf-8.inc.php3 +++ b/lang/french-utf-8.inc.php3 @@ -285,6 +285,8 @@ $strLines = 'Lignes'; $strLinesTerminatedBy = 'Lignes terminées par'; $strLinkNotFound = 'Lien absent'; $strLinksTo = 'Relié à'; +$strLoadExplanation = 'La meilleure méthode a été choisie par défaut, mais vous pouvez la changer si elle échoue.'; +$strLoadMethod = 'Méthode pour le LOAD'; $strLocalhost = 'Local'; $strLocationTextfile = 'Emplacement du fichier texte'; $strLogPassword = 'Mot de passe :'; @@ -639,6 +641,4 @@ $strZeroRemovesTheLimit = 'Note: Une valeur de 0 (zero) enlève la limite.'; $strZip = '"zippé"'; // To translate -$strLoadMethod = 'LOAD method'; //to translate -$strLoadExplanation = 'The best method is checked by default, but you can change if it fails.'; //to translate ?> diff --git a/ldi_check.php3 b/ldi_check.php3 index 41065f418..a02c8dbbd 100755 --- a/ldi_check.php3 +++ b/ldi_check.php3 @@ -123,31 +123,10 @@ if (isset($btnLDI) && empty($textfile)) { // Builds the query $sql_query = 'LOAD DATA'; - // for versions before 3.23.49, we use the LOCAL keyword, because - // there was a version (cannot find which one, and it does not work - // with 3.23.38) where the user can LOAD, even if the user does not - // have FILE priv, and even if the file is on the server - // (which is the present case) - // - // we could also code our own loader, but LOAD DATA INFILE is optimized - // for speed - - if (PMA_MYSQL_INT_VERSION < 32349) { + if ($local_option == "1") { $sql_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) { - $tmp = PMA_mysql_fetch_row($result); - if ($tmp[1] == 'ON') { - $sql_query .= ' LOCAL'; - } - } - mysql_free_result($result); - } - $sql_query .= ' INFILE \'' . $textfile . '\''; if (!empty($replace)) { $sql_query .= ' ' . $replace; diff --git a/ldi_table.php3 b/ldi_table.php3 index 469da09c4..535a4c5a7 100755 --- a/ldi_table.php3 +++ b/ldi_table.php3 @@ -131,7 +131,38 @@ if (function_exists('PMA_set_enc_form')) { . ' ' . "\n" . ' ' . "\n"; } // end if + + +// Check if we should check the LOCAL radio button by default +$local_option_selected = FALSE; + +if (PMA_MYSQL_INT_VERSION < 32349) { + $local_option_selected = TRUE; +} + +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) { + $tmp = PMA_mysql_fetch_row($result); + if ($tmp[1] == 'ON') { + $local_option_selected = TRUE; + } + } + mysql_free_result($result); +} + ?> + + + + + />...DATA
+ />...DATA LOCAL + + + +