bug #1903724 [interface] Displaying of very large queries in error message

This commit is contained in:
Marc Delisle
2008-02-28 17:38:43 +00:00
parent 5d0c2032ce
commit ebcbf621d2
2 changed files with 10 additions and 2 deletions

View File

@@ -45,6 +45,9 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
* minimal support on db structure page * minimal support on db structure page
* export * export
2.11.6.0 (not yet released)
- bug #1903724 [interface] Displaying of very large queries in error message
2.11.5.0 (not yet released) 2.11.5.0 (not yet released)
- bug #1862661 [GUI] Warn about rename deleting database - bug #1862661 [GUI] Warn about rename deleting database
- bug #1866041 [interface] Incorrect sorting with AS - bug #1866041 [interface] Incorrect sorting with AS

View File

@@ -467,7 +467,8 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
* @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['pmaThemeImage']
* @uses $GLOBALS['strEdit'] * @uses $GLOBALS['strEdit']
* @uses $GLOBALS['strMySQLSaid'] * @uses $GLOBALS['strMySQLSaid']
* @uses $cfg['PropertiesIconic'] * @uses $GLOBALS['cfg']['PropertiesIconic']
* @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']
* @uses PMA_backquote() * @uses PMA_backquote()
* @uses PMA_DBI_getError() * @uses PMA_DBI_getError()
* @uses PMA_formatSql() * @uses PMA_formatSql()
@@ -527,9 +528,13 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$formatted_sql = htmlspecialchars($the_query); $formatted_sql = htmlspecialchars($the_query);
} elseif (empty($the_query) || trim($the_query) == '') { } elseif (empty($the_query) || trim($the_query) == '') {
$formatted_sql = ''; $formatted_sql = '';
} else {
if (strlen($the_query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$formatted_sql = substr($the_query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]';
} else { } else {
$formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query); $formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query);
} }
}
// --- // ---
echo "\n" . '<!-- PMA-SQL-ERROR -->' . "\n"; echo "\n" . '<!-- PMA-SQL-ERROR -->' . "\n";
echo ' <div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n"; echo ' <div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n";