diff --git a/ChangeLog b/ChangeLog index 8eed4261f..ed081cf49 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-01-12 Robin Johnson + * read_dump.php3, sql.php3,libraries/common.lib.php3, + libraries/sqlparser.lib.php3: + - Fixed bug #641765, see mailing list post + 2003-01-11 Alexander M. Turek * server_*.php3: - The messages are now displayed by server_links.inc.php3, so diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 08ec622c6..c786b66f2 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -323,6 +323,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} $is_modify_link = TRUE, $back_url = '') { global $cfg; + global $SQP_errorString; if (empty($GLOBALS['is_header_sent'])) { include('./header.inc.php3'); @@ -335,13 +336,27 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} $the_query = $GLOBALS['sql_query']; } - $parsed_sql = PMA_SQP_parse($the_query); + // --- Added to solve bug #641765 + // Robbat2 - 12 January 2003, 9:46PM + if (isset($SQP_errorString) && !empty($SQP_errorString)) { + $parsed_sql = $the_query; + } else { + $parsed_sql = PMA_SQP_parse($the_query); + } + // --- echo '

'. $GLOBALS['strError'] . '

' . "\n"; // if the config password is wrong, or the MySQL server does not // respond, do not show the query that would reveal the // username/password if (!empty($the_query) && !strstr($the_query, 'connect')) { + // --- Added to solve bug #641765 + // Robbat2 - 12 January 2003, 9:46PM + if (isset($SQP_errorString) && !empty($SQP_errorString)) { + flush(); + echo $SQP_errorString; + } + // --- echo '

' . "\n"; echo ' ' . $GLOBALS['strSQLQuery'] . ' : ' . "\n"; if ($is_modify_link && isset($db)) { @@ -364,6 +379,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} echo '

' . "\n"
              . $error_message . "\n"
              . '
' . "\n"; + + if (!empty($back_url)) { echo '' . $GLOBALS['strBack'] . ''; } diff --git a/libraries/sqlparser.lib.php3 b/libraries/sqlparser.lib.php3 index fe8b6be83..427df4bf3 100644 --- a/libraries/sqlparser.lib.php3 +++ b/libraries/sqlparser.lib.php3 @@ -84,15 +84,19 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { $debugstr = 'ERROR: ' . $message . "\n"; $debugstr .= 'SQL: ' . $sql; - echo $GLOBALS['strSQLParserUserError'] . '
' . "\n" + global $SQP_errorString; + $SQP_errorString = '

'.$GLOBALS['strSQLParserUserError'] . '

' . "\n" . '
' . "\n"
              . $debugstr . "\n"
              . '
' . "\n"; + /* + // Removed to solve bug #641765 - Robbat2 - 12 January 2003, 9:46PM flush(); if (PMA_PHP_INT_VERSION >= 40200 && @function_exists('ob_flush')) { ob_flush(); } + */ } // end of the "PMA_SQP_throwError()" function diff --git a/read_dump.php3 b/read_dump.php3 index 19162f8f4..3e8976f9a 100644 --- a/read_dump.php3 +++ b/read_dump.php3 @@ -369,7 +369,6 @@ if (!$cfg['AllowUserDropDatabase'] } define('PMA_CHK_DROP', 1); - /** * Executes the query */ @@ -432,6 +431,7 @@ if ($sql_query != '') { } // end if + /** * MySQL error */ diff --git a/sql.php3 b/sql.php3 index 17baff9f6..eddaf5f7b 100755 --- a/sql.php3 +++ b/sql.php3 @@ -85,7 +85,8 @@ if (isset($btnDrop) || isset($navig)) { $parsed_sql = PMA_SQP_parse((get_magic_quotes_gpc() ? stripslashes($sql_query) : $sql_query)); $analyzed_sql = PMA_SQP_analyze($parsed_sql); -$sql_query = PMA_SQP_formatHtml($parsed_sql, 'query_only'); +// Bug #641765 - Robbat2 - 12 January 2003, 10:49PM +//$sql_query = PMA_SQP_formatHtml($parsed_sql, 'query_only'); // here we are sure that SELECT is uppercase $is_select = eregi('^SELECT[[:space:]]+', $sql_query);