From ebcbf621d2e234e9edf1e5079c8e23d6fc846912 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 28 Feb 2008 17:38:43 +0000 Subject: [PATCH] bug #1903724 [interface] Displaying of very large queries in error message --- ChangeLog | 3 +++ libraries/common.lib.php | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f79ae360..b130152ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,9 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA * minimal support on db structure page * 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) - bug #1862661 [GUI] Warn about rename deleting database - bug #1866041 [interface] Incorrect sorting with AS diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 293809584..ec8653f17 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -467,7 +467,8 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice') * @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['strEdit'] * @uses $GLOBALS['strMySQLSaid'] - * @uses $cfg['PropertiesIconic'] + * @uses $GLOBALS['cfg']['PropertiesIconic'] + * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] * @uses PMA_backquote() * @uses PMA_DBI_getError() * @uses PMA_formatSql() @@ -528,7 +529,11 @@ function PMA_mysqlDie($error_message = '', $the_query = '', } elseif (empty($the_query) || trim($the_query) == '') { $formatted_sql = ''; } else { - $formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query); + if (strlen($the_query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { + $formatted_sql = substr($the_query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]'; + } else { + $formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query); + } } // --- echo "\n" . '' . "\n";