Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e95aea7945
@ -324,7 +324,7 @@ function PMA_exportOutputHandler($line)
|
||||
) {
|
||||
$dump_buffer = bzcompress($dump_buffer);
|
||||
} elseif ($GLOBALS['compression'] == 'gzip'
|
||||
&& PMA_gzencodeNeeded()
|
||||
&& PMA_gzencodeNeeded()
|
||||
) {
|
||||
// as a gzipped file
|
||||
// without the optional parameter level because it bugs
|
||||
|
||||
@ -619,7 +619,8 @@ class PMA_DatabaseInterface
|
||||
$each_tables[$table_name]['Type']
|
||||
=& $each_tables[$table_name]['Engine'];
|
||||
} elseif (! isset($each_tables[$table_name]['Engine'])
|
||||
&& isset($each_tables[$table_name]['Type'])) {
|
||||
&& isset($each_tables[$table_name]['Type'])
|
||||
) {
|
||||
// old MySQL reports Type, newer MySQL reports Engine
|
||||
$each_tables[$table_name]['Engine']
|
||||
=& $each_tables[$table_name]['Type'];
|
||||
|
||||
@ -4212,9 +4212,9 @@ class PMA_DisplayResults
|
||||
{
|
||||
|
||||
$sql_md5 = md5($this->__get('sql_query'));
|
||||
$query = $_SESSION['tmp_user_values']['query'][$sql_md5];
|
||||
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['sql']
|
||||
= $this->__get('sql_query');
|
||||
$query['sql'] = $this->__get('sql_query');
|
||||
|
||||
$valid_disp_dir = PMA_isValid(
|
||||
$_REQUEST['disp_direction'],
|
||||
@ -4224,45 +4224,33 @@ class PMA_DisplayResults
|
||||
);
|
||||
|
||||
if ($valid_disp_dir) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction']
|
||||
= $_REQUEST['disp_direction'];
|
||||
$query['disp_direction'] = $_REQUEST['disp_direction'];
|
||||
unset($_REQUEST['disp_direction']);
|
||||
} elseif (
|
||||
empty($_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction'])
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction']
|
||||
= $GLOBALS['cfg']['DefaultDisplay'];
|
||||
} elseif (empty($query['disp_direction'])) {
|
||||
$query['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
|
||||
}
|
||||
|
||||
if (
|
||||
empty($_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells'])
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells']
|
||||
= $GLOBALS['cfg']['RepeatCells'];
|
||||
if (empty($query['repeat_cells'])) {
|
||||
$query['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
|
||||
}
|
||||
|
||||
// as this is a form value, the type is always string so we cannot
|
||||
// use PMA_isValid($_REQUEST['session_max_rows'], 'integer')
|
||||
if ((PMA_isValid($_REQUEST['session_max_rows'], 'numeric')
|
||||
&& ((int) $_REQUEST['session_max_rows'] == $_REQUEST['session_max_rows']))
|
||||
|| ($_REQUEST['session_max_rows'] == self::ALL_ROWS)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows']
|
||||
= $_REQUEST['session_max_rows'];
|
||||
if (PMA_isValid($_REQUEST['session_max_rows'], 'numeric')) {
|
||||
$query['max_rows'] = (int)$_REQUEST['session_max_rows'];
|
||||
unset($_REQUEST['session_max_rows']);
|
||||
} elseif (
|
||||
empty($_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows'])
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows']
|
||||
= $GLOBALS['cfg']['MaxRows'];
|
||||
} elseif ($_REQUEST['session_max_rows'] == self::ALL_ROWS) {
|
||||
$query['max_rows'] = self::ALL_ROWS;
|
||||
unset($_REQUEST['session_max_rows']);
|
||||
} elseif (empty($query['max_rows'])) {
|
||||
$query['max_rows'] = $GLOBALS['cfg']['MaxRows'];
|
||||
}
|
||||
|
||||
if (PMA_isValid($_REQUEST['pos'], 'numeric')) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['pos']
|
||||
= $_REQUEST['pos'];
|
||||
$query['pos'] = $_REQUEST['pos'];
|
||||
unset($_REQUEST['pos']);
|
||||
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_md5]['pos'])) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['pos'] = 0;
|
||||
} elseif (empty($query['pos'])) {
|
||||
$query['pos'] = 0;
|
||||
}
|
||||
|
||||
if (PMA_isValid(
|
||||
@ -4272,14 +4260,10 @@ class PMA_DisplayResults
|
||||
)
|
||||
)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_text']
|
||||
= $_REQUEST['display_text'];
|
||||
$query['display_text'] = $_REQUEST['display_text'];
|
||||
unset($_REQUEST['display_text']);
|
||||
} elseif (
|
||||
empty($_SESSION['tmp_user_values']['query'][$sql_md5]['display_text'])
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_text']
|
||||
= self::DISPLAY_PARTIAL_TEXT;
|
||||
} elseif (empty($query['display_text'])) {
|
||||
$query['display_text'] = self::DISPLAY_PARTIAL_TEXT;
|
||||
}
|
||||
|
||||
if (PMA_isValid(
|
||||
@ -4289,16 +4273,10 @@ class PMA_DisplayResults
|
||||
)
|
||||
)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['relational_display']
|
||||
= $_REQUEST['relational_display'];
|
||||
$query['relational_display'] = $_REQUEST['relational_display'];
|
||||
unset($_REQUEST['relational_display']);
|
||||
} elseif (
|
||||
empty(
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['relational_display']
|
||||
)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['relational_display']
|
||||
= self::RELATIONAL_KEY;
|
||||
} elseif (empty($query['relational_display'])) {
|
||||
$query['relational_display'] = self::RELATIONAL_KEY;
|
||||
}
|
||||
|
||||
if (PMA_isValid(
|
||||
@ -4309,42 +4287,33 @@ class PMA_DisplayResults
|
||||
)
|
||||
)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['geometry_display']
|
||||
= $_REQUEST['geometry_display'];
|
||||
$query['geometry_display'] = $_REQUEST['geometry_display'];
|
||||
unset($_REQUEST['geometry_display']);
|
||||
} elseif (
|
||||
empty(
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['geometry_display']
|
||||
)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['geometry_display']
|
||||
= self::GEOMETRY_DISP_GEOM;
|
||||
} elseif (empty($query['geometry_display'])) {
|
||||
$query['geometry_display'] = self::GEOMETRY_DISP_GEOM;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['display_binary'])) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary'] = true;
|
||||
$query['display_binary'] = true;
|
||||
unset($_REQUEST['display_binary']);
|
||||
} elseif (isset($_REQUEST['display_options_form'])) {
|
||||
// we know that the checkbox was unchecked
|
||||
unset($_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary']);
|
||||
unset($query['display_binary']);
|
||||
} elseif (isset($_REQUEST['full_text_button'])) {
|
||||
// do nothing to keep the value that is there in the session
|
||||
} else {
|
||||
// selected by default because some operations like OPTIMIZE TABLE
|
||||
// and all queries involving functions return "binary" contents,
|
||||
// according to low-level field flags
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary'] = true;
|
||||
$query['display_binary'] = true;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['display_binary_as_hex'])) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex']
|
||||
= true;
|
||||
$query['display_binary_as_hex'] = true;
|
||||
unset($_REQUEST['display_binary_as_hex']);
|
||||
} elseif (isset($_REQUEST['display_options_form'])) {
|
||||
// we know that the checkbox was unchecked
|
||||
unset($_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['display_binary_as_hex']
|
||||
);
|
||||
unset($query['display_binary_as_hex']);
|
||||
} elseif (isset($_REQUEST['full_text_button'])) {
|
||||
// do nothing to keep the value that is there in the session
|
||||
} else {
|
||||
@ -4352,36 +4321,31 @@ class PMA_DisplayResults
|
||||
if (isset($GLOBALS['cfg']['DisplayBinaryAsHex'])
|
||||
&& ($GLOBALS['cfg']['DisplayBinaryAsHex'] === true)
|
||||
) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['display_binary_as_hex'] = true;
|
||||
$query['display_binary_as_hex'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['display_blob'])) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_blob'] = true;
|
||||
$query['display_blob'] = true;
|
||||
unset($_REQUEST['display_blob']);
|
||||
} elseif (isset($_REQUEST['display_options_form'])) {
|
||||
// we know that the checkbox was unchecked
|
||||
unset($_SESSION['tmp_user_values']['query'][$sql_md5]['display_blob']);
|
||||
unset($query['display_blob']);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['hide_transformation'])) {
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5]['hide_transformation']
|
||||
= true;
|
||||
$query['hide_transformation'] = true;
|
||||
unset($_REQUEST['hide_transformation']);
|
||||
} elseif (isset($_REQUEST['display_options_form'])) {
|
||||
// we know that the checkbox was unchecked
|
||||
unset($_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['hide_transformation']
|
||||
);
|
||||
unset($query['hide_transformation']);
|
||||
}
|
||||
|
||||
// move current query to the last position, to be removed last
|
||||
// so only least executed query will be removed if maximum remembered queries
|
||||
// limit is reached
|
||||
$tmp = $_SESSION['tmp_user_values']['query'][$sql_md5];
|
||||
// so only least executed query will be removed if maximum remembered
|
||||
// queries limit is reached
|
||||
unset($_SESSION['tmp_user_values']['query'][$sql_md5]);
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5] = $tmp;
|
||||
$_SESSION['tmp_user_values']['query'][$sql_md5] = $query;
|
||||
|
||||
// do not exceed a maximum number of queries to remember
|
||||
if (count($_SESSION['tmp_user_values']['query']) > 10) {
|
||||
@ -4391,41 +4355,31 @@ class PMA_DisplayResults
|
||||
|
||||
// populate query configuration
|
||||
$_SESSION['tmp_user_values']['display_text']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['display_text'];
|
||||
= $query['display_text'];
|
||||
$_SESSION['tmp_user_values']['relational_display']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['relational_display'];
|
||||
= $query['relational_display'];
|
||||
$_SESSION['tmp_user_values']['geometry_display']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['geometry_display'];
|
||||
$_SESSION['tmp_user_values']['display_binary']
|
||||
= isset($_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['display_binary']
|
||||
)
|
||||
? true
|
||||
: false;
|
||||
$_SESSION['tmp_user_values']['display_binary_as_hex']
|
||||
= isset($_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['display_binary_as_hex']
|
||||
)
|
||||
? true
|
||||
: false;
|
||||
$_SESSION['tmp_user_values']['display_blob']
|
||||
= isset($_SESSION['tmp_user_values']['query'][$sql_md5]['display_blob'])
|
||||
? true
|
||||
: false;
|
||||
$_SESSION['tmp_user_values']['hide_transformation']
|
||||
= isset($_SESSION['tmp_user_values']['query'][$sql_md5]
|
||||
['hide_transformation']
|
||||
)
|
||||
? true
|
||||
: false;
|
||||
= $query['geometry_display'];
|
||||
$_SESSION['tmp_user_values']['display_binary'] = isset(
|
||||
$query['display_binary']
|
||||
);
|
||||
$_SESSION['tmp_user_values']['display_binary_as_hex'] = isset(
|
||||
$query['display_binary_as_hex']
|
||||
);
|
||||
$_SESSION['tmp_user_values']['display_blob'] = isset(
|
||||
$query['display_blob']
|
||||
);
|
||||
$_SESSION['tmp_user_values']['hide_transformation'] = isset(
|
||||
$query['hide_transformation']
|
||||
);
|
||||
$_SESSION['tmp_user_values']['pos']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['pos'];
|
||||
= $query['pos'];
|
||||
$_SESSION['tmp_user_values']['max_rows']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows'];
|
||||
= $query['max_rows'];
|
||||
$_SESSION['tmp_user_values']['repeat_cells']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells'];
|
||||
= $query['repeat_cells'];
|
||||
$_SESSION['tmp_user_values']['disp_direction']
|
||||
= $_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction'];
|
||||
= $query['disp_direction'];
|
||||
|
||||
}
|
||||
|
||||
@ -4447,7 +4401,8 @@ class PMA_DisplayResults
|
||||
* @see sql.php file
|
||||
*/
|
||||
public function getTable(
|
||||
&$dt_result, &$the_disp_mode, $analyzed_sql, $is_limited_display = false
|
||||
&$dt_result, &$the_disp_mode, $analyzed_sql,
|
||||
$is_limited_display = false
|
||||
) {
|
||||
|
||||
$table_html = '';
|
||||
|
||||
@ -791,7 +791,8 @@ class PMA_File
|
||||
$result = substr($result, 3);
|
||||
// UTF-16 BE, LE
|
||||
} elseif (strncmp($result, "\xFE\xFF", 2) == 0
|
||||
|| strncmp($result, "\xFF\xFE", 2) == 0) {
|
||||
|| strncmp($result, "\xFF\xFE", 2) == 0
|
||||
) {
|
||||
$result = substr($result, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ class PMA_ServerStatusData
|
||||
$server_status = $GLOBALS['dbi']->fetchResult('SHOW GLOBAL STATUS', 0, 1);
|
||||
if (PMA_DRIZZLE) {
|
||||
// Drizzle doesn't put query statistics into variables, add it
|
||||
$sql = "SELECT concat('Com_', variable_name), variable_value "
|
||||
$sql = "SELECT concat('Com_', variable_name), variable_value "
|
||||
. "FROM data_dictionary.GLOBAL_STATEMENTS";
|
||||
$statements = $GLOBALS['dbi']->fetchResult($sql, 0, 1);
|
||||
$server_status = array_merge($server_status, $statements);
|
||||
@ -93,7 +93,8 @@ class PMA_ServerStatusData
|
||||
/ $server_variables['key_buffer_size']
|
||||
* 100;
|
||||
} elseif (isset($server_status['Key_blocks_used'])
|
||||
&& isset($server_variables['key_buffer_size'])) {
|
||||
&& isset($server_variables['key_buffer_size'])
|
||||
) {
|
||||
$server_status['Key_buffer_fraction_%']
|
||||
= $server_status['Key_blocks_used']
|
||||
* 1024
|
||||
|
||||
@ -1116,7 +1116,8 @@ class PMA_Util
|
||||
)
|
||||
);
|
||||
} elseif (! empty($GLOBALS['parsed_sql'])
|
||||
&& $query_base == $GLOBALS['parsed_sql']['raw']) {
|
||||
&& $query_base == $GLOBALS['parsed_sql']['raw']
|
||||
) {
|
||||
// (here, use "! empty" because when deleting a bookmark,
|
||||
// $GLOBALS['parsed_sql'] is set but empty
|
||||
$parsed_sql = $GLOBALS['parsed_sql'];
|
||||
@ -1743,7 +1744,8 @@ class PMA_Util
|
||||
) {
|
||||
$tab['class'] = 'active';
|
||||
} elseif (is_null($tab['active']) && empty($GLOBALS['active_page'])
|
||||
&& (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link'])) {
|
||||
&& (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link'])
|
||||
) {
|
||||
$tab['class'] = 'active';
|
||||
}
|
||||
}
|
||||
@ -2229,8 +2231,8 @@ class PMA_Util
|
||||
$con_val = '= ' . $row[$i];
|
||||
} elseif ((($meta->type == 'blob') || ($meta->type == 'string'))
|
||||
// hexify only if this is a true not empty BLOB or a BINARY
|
||||
&& stristr($field_flags, 'BINARY')
|
||||
&& ! empty($row[$i])
|
||||
&& stristr($field_flags, 'BINARY')
|
||||
&& ! empty($row[$i])
|
||||
) {
|
||||
// do not waste memory building a too big condition
|
||||
if (strlen($row[$i]) < 1000) {
|
||||
|
||||
@ -515,7 +515,8 @@ function PMA_getenv($var_name)
|
||||
} elseif (getenv($var_name)) {
|
||||
return getenv($var_name);
|
||||
} elseif (function_exists('apache_getenv')
|
||||
&& apache_getenv($var_name, true)) {
|
||||
&& apache_getenv($var_name, true)
|
||||
) {
|
||||
return apache_getenv($var_name, true);
|
||||
}
|
||||
|
||||
|
||||
@ -217,8 +217,8 @@ class ImportMediawiki extends ImportPlugin
|
||||
// End processing because the current line does not
|
||||
// contain any column information
|
||||
} elseif (substr($cur_buffer_line, 0, 2) === '|-'
|
||||
|| substr($cur_buffer_line, 0, 2) === '|+'
|
||||
|| substr($cur_buffer_line, 0, 2) === '|}'
|
||||
|| substr($cur_buffer_line, 0, 2) === '|+'
|
||||
|| substr($cur_buffer_line, 0, 2) === '|}'
|
||||
) {
|
||||
// Check begin row or end table
|
||||
|
||||
@ -570,4 +570,4 @@ class ImportMediawiki extends ImportPlugin
|
||||
{
|
||||
$this->_analyze = $analyze;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,8 +115,9 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false)
|
||||
$privs[] = $current_grant[1];
|
||||
}
|
||||
} elseif (! empty($GLOBALS[$current_grant[0]])
|
||||
&& is_array($GLOBALS[$current_grant[0]])
|
||||
&& empty($GLOBALS[$current_grant[0] . '_none'])) {
|
||||
&& is_array($GLOBALS[$current_grant[0]])
|
||||
&& empty($GLOBALS[$current_grant[0] . '_none'])
|
||||
) {
|
||||
if ($enableHTML) {
|
||||
$priv_string = '<dfn title="' . $current_grant[2] . '">'
|
||||
. $current_grant[1] . '</dfn>';
|
||||
@ -137,9 +138,8 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false)
|
||||
$privs[] = 'USAGE';
|
||||
}
|
||||
} elseif ($allPrivileges
|
||||
&& (! isset($_POST['grant_count'])
|
||||
|| count($privs) == $_POST['grant_count'])
|
||||
) {
|
||||
&& (! isset($_POST['grant_count']) || count($privs) == $_POST['grant_count'])
|
||||
) {
|
||||
if ($enableHTML) {
|
||||
$privs = array('<dfn title="'
|
||||
. __('Includes all privileges except GRANT.')
|
||||
|
||||
@ -302,8 +302,10 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation,
|
||||
WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($db) . '\'
|
||||
AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table) . '\'
|
||||
AND `column_name` = \'' . PMA_Util::sqlAddSlashes($key) . '\'';
|
||||
} elseif (strlen($mimetype) || strlen($transformation)
|
||||
|| strlen($transformation_options)) {
|
||||
} elseif (strlen($mimetype)
|
||||
|| strlen($transformation)
|
||||
|| strlen($transformation_options)
|
||||
) {
|
||||
|
||||
$upd_query = 'INSERT INTO ' . PMA_Util::backquote($cfgRelation['db']) . '.' . PMA_Util::backquote($cfgRelation['column_info'])
|
||||
. ' (db_name, table_name, column_name, mimetype, transformation, transformation_options) '
|
||||
|
||||
@ -53,8 +53,9 @@ $response->addHTML(PMA_getHtmlForErrorMessage());
|
||||
|
||||
if ($server_master_status) {
|
||||
$response->addHTML(PMA_getHtmlForMasterReplication());
|
||||
} elseif (! isset($_REQUEST['mr_configure']) &&
|
||||
! isset($_REQUEST['repl_clear_scr'])) {
|
||||
} elseif (! isset($_REQUEST['mr_configure'])
|
||||
&& ! isset($_REQUEST['repl_clear_scr'])
|
||||
) {
|
||||
$response->addHTML(PMA_getHtmlForNotServerReplication());
|
||||
}
|
||||
|
||||
@ -70,7 +71,7 @@ if (! isset($_REQUEST['repl_clear_scr'])) {
|
||||
// Render the 'Slave configuration' section
|
||||
$response->addHTML(
|
||||
PMA_getHtmlForSlaveConfiguration(
|
||||
$server_slave_status,
|
||||
$server_slave_status,
|
||||
$server_slave_replication
|
||||
)
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user