RFE #1743983: replace $max_characters by a configurable param MaxCharactersInDisplayedSQL
This commit is contained in:
@@ -71,6 +71,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
+ [gui] Navigator for the table list in the content panel
|
||||
- bug #1727138 HTML not encoded (more than 1000 characters)
|
||||
+ [display] Support for MySQL 5.0.37 profiling
|
||||
+ RFE #1743983 [gui] Replace $max_characters by a configurable param:
|
||||
$cfg['MaxCharactersInDisplayedSQL']
|
||||
|
||||
2.10.3.0 (not yet released)
|
||||
|
||||
|
@@ -1096,6 +1096,12 @@ ALTER TABLE `pma_column_comments`
|
||||
<dd>The maximum number of table names to be displayed in the
|
||||
right panel's list.</dd>
|
||||
|
||||
<dt id="cfg_MaxCharactersInDisplayedSQL">$cfg['MaxCharactersInDisplayedSQL'] integer</dt>
|
||||
<dd>The maximum number of characters when a SQL query is displayed. The
|
||||
default limit of 1000 should be correct to avoid the display of tons
|
||||
of hexadecimal codes that represent BLOBs, but some users have real
|
||||
SQL queries that are longer than 1000 characters.</dd>
|
||||
|
||||
<dt id="cfg_OBGzip">$cfg['OBGzip'] string/boolean</dt>
|
||||
<dd>Defines whether to use GZip output buffering for increased
|
||||
speed in <abbr title="HyperText Transfer Protocol">HTTP</abbr> transfers.<br />
|
||||
|
@@ -103,9 +103,6 @@ class PMA_Config
|
||||
$this->checkUpload();
|
||||
$this->checkUploadSize();
|
||||
$this->checkOutputCompression();
|
||||
|
||||
// other constants (no real need to put into config file)
|
||||
$this->set('PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY', 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -899,8 +896,7 @@ class PMA_Config
|
||||
'PMA_IS_GD2',
|
||||
'PMA_USR_OS',
|
||||
'PMA_USR_BROWSER_VER',
|
||||
'PMA_USR_BROWSER_AGENT',
|
||||
'PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY'
|
||||
'PMA_USR_BROWSER_AGENT'
|
||||
);
|
||||
|
||||
foreach ($defines as $define) {
|
||||
|
@@ -1046,7 +1046,7 @@ function PMA_showMessage($message, $sql_query = null)
|
||||
$query_base = $sql_query;
|
||||
}
|
||||
|
||||
if (strlen($query_base) > PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY) {
|
||||
if (strlen($query_base) > $cfg['MaxCharactersInDisplayedSQL']) {
|
||||
$query_too_big = true;
|
||||
$query_base = nl2br(htmlspecialchars($sql_query));
|
||||
unset($GLOBALS['parsed_sql']);
|
||||
@@ -1240,7 +1240,7 @@ function PMA_showMessage($message, $sql_query = null)
|
||||
// I get a white page, strlen($query_base) is 2 x 700 Kio
|
||||
// so put a hard limit here (let's say 1000)
|
||||
if ($query_too_big) {
|
||||
echo ' ' . substr($query_base,0,PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY) . '[...]';
|
||||
echo ' ' . substr($query_base, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]';
|
||||
} else {
|
||||
echo ' ' . $query_base;
|
||||
}
|
||||
|
@@ -349,6 +349,13 @@ $cfg['MaxDbList'] = 100;
|
||||
*/
|
||||
$cfg['MaxTableList'] = 100;
|
||||
|
||||
/**
|
||||
* maximum number of characters when a SQL query is displayed
|
||||
*
|
||||
* @global integer $cfg['MaxCharactersInDisplayedSQL']
|
||||
*/
|
||||
$cfg['MaxCharactersInDisplayedSQL'] = 1000;
|
||||
|
||||
/**
|
||||
* use GZIP output buffering if possible (true|false|'auto')
|
||||
*
|
||||
|
@@ -32,7 +32,7 @@
|
||||
* @uses $cfg['DBG']['enable']
|
||||
* @uses $cfg['DBG']['profile']['enable']
|
||||
* @uses $GLOBALS['strOpenNewWindow']
|
||||
* @uses PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY
|
||||
* @uses $cfg['MaxCharactersInDisplayedSQL']
|
||||
* @uses PMA_isValid()
|
||||
* @uses PMA_setHistory()
|
||||
* @uses PMA_ifSetOr()
|
||||
@@ -88,7 +88,7 @@ if (window.parent.reload_querywindow) {
|
||||
window.parent.reload_querywindow(
|
||||
'<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) ?>',
|
||||
'<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')) ?>',
|
||||
'<?php echo strlen($GLOBALS['sql_query']) > PMA_MAX_CHARACTERS_FOR_DISPLAYED_QUERY ? PMA_escapeJsString($GLOBALS['sql_query']) : ''; ?>');
|
||||
'<?php echo strlen($GLOBALS['sql_query']) > $cfg['MaxCharactersInDisplayedSQL'] ? PMA_escapeJsString($GLOBALS['sql_query']) : ''; ?>');
|
||||
}
|
||||
<?php
|
||||
}
|
||||
|
Reference in New Issue
Block a user