bug 740607

This commit is contained in:
Marc Delisle
2003-05-29 16:50:10 +00:00
parent 75fb922c16
commit 22868ea202
5 changed files with 41 additions and 26 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-05-29 Marc Delisle <lem9@users.sourceforge.net>
* 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 <me@supergarv.de>
* index.php3: Add frameborder to allow resizing. Introduces a 1px
bar, but cannot be solved. Note that this is only neccessary

View File

@@ -284,6 +284,8 @@ $strLines = 'Lignes';
$strLinesTerminatedBy = 'Lignes termin<69>es par';
$strLinkNotFound = 'Lien absent';
$strLinksTo = 'Reli<6C> <20>';
$strLoadExplanation = 'La meilleure m<>thode a <20>t<EFBFBD> choisie par d<>faut, mais vous pouvez la changer si elle <20>choue.';
$strLoadMethod = 'M<>thode pour le LOAD';
$strLocalhost = 'Local';
$strLocationTextfile = 'Emplacement du fichier texte';
$strLogPassword = 'Mot de passe&nbsp;:';
@@ -638,6 +640,4 @@ $strZeroRemovesTheLimit = 'Note: Une valeur de 0 (zero) enl
$strZip = '"zipp<70>"';
// To translate
$strLoadMethod = 'LOAD method'; //to translate
$strLoadExplanation = 'The best method is checked by default, but you can change if it fails.'; //to translate
?>

View File

@@ -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&nbsp;:';
@@ -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
?>

View File

@@ -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;

View File

@@ -131,7 +131,38 @@ if (function_exists('PMA_set_enc_form')) {
. ' </td>' . "\n"
. ' </tr>' . "\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);
}
?>
<tr>
<td><?php echo $strLoadMethod; ?>
</td>
<td>
<input type="radio" name="local_option" value="0" <?php echo (!$local_option_selected?' checked="checked" ': '');?>/>...DATA <br />
<input type="radio" name="local_option" value="1" <?php echo ($local_option_selected?' checked="checked" ': '');?>/>...DATA LOCAL
</td>
<td><?php echo $strLoadExplanation; ?>
</td>
</tr>
<tr>
<td colspan="3" align="center"><?php print PMA_showMySQLDocu('Reference', 'LOAD_DATA'); ?></td>
</tr>