From 11627b5ca6de20f7716585b00372827c7c6da6c6 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 8c2949f13..09bb46e32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - ChangeLog $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ +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 e2363b333..25c006495 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -410,7 +410,8 @@ function PMA_showHint($hint_message) * @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() @@ -471,7 +472,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";