Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-02-11 00:56:57 +01:00
commit 6536e9adce
3 changed files with 8 additions and 50 deletions

View File

@ -45,6 +45,7 @@ phpMyAdmin - ChangeLog
- issue #11412 Remove PmaAbsoluteUri configuration directive
- issue #11914 Fix autoloading of phpseclib
- issue #11880 Fixed rendering of missing extension error
- issue #11923 Errors on Structure tab when user only has select access on certain columns
4.5.5.0 (not yet released)
- issue Undefined index: is_ajax_request

View File

@ -349,32 +349,11 @@ class TableStructureController extends TableController
$this->db, $this->table, null, true
);
// Get more complete field information
// For now, this is done just for MySQL 4.1.2+ new TIMESTAMP options
// but later, if the analyser returns more information, it
// could be executed for any MySQL version and replace
// the info given by SHOW FULL COLUMNS FROM.
//
// We also need this to correctly learn if a TIMESTAMP is NOT NULL, since
// SHOW FULL COLUMNS or INFORMATION_SCHEMA incorrectly says NULL
// and SHOW CREATE TABLE says NOT NULL (tested
// in MySQL 4.0.25 and 5.0.21, http://bugs.mysql.com/20910).
$show_create_table = $this->table_obj->showCreate();
$parser = new SqlParser\Parser($show_create_table);
/**
* @var CreateStatement $stmt
*/
$stmt = $parser->statements[0];
$create_table_fields = SqlTable::getFields($stmt);
//display table structure
$this->response->addHTML(
$this->displayStructure(
$cfgRelation, $columns_with_unique_index, $url_params, $primary,
$fields, $columns_with_index, $create_table_fields
$cfgRelation, $columns_with_unique_index, $url_params,
$primary, $fields, $columns_with_index
)
);
@ -1167,13 +1146,12 @@ class TableStructureController extends TableController
* no one exists
* @param array $fields Fields
* @param array $columns_with_index Columns with index
* @param array $create_table_fields Fields of the table.
*
* @return string
*/
protected function displayStructure(
$cfgRelation, $columns_with_unique_index, $url_params, $primary_index,
$fields, $columns_with_index, $create_table_fields
$cfgRelation, $columns_with_unique_index, $url_params,
$primary_index, $fields, $columns_with_index
) {
/* TABLE INFORMATION */
$HideStructureActions = '';
@ -1296,7 +1274,6 @@ class TableStructureController extends TableController
'fields' => $fields,
'columns_with_index' => $columns_with_index,
'central_list' => $central_list,
'create_table_fields' => $create_table_fields,
'comments_map' => $comments_map
)
);

View File

@ -28,34 +28,14 @@ $rownum = 0; $odd_row = true; ?>
<?php
$rownum++;
$columns_list[] = $row['Field'];
$extracted_columnspec = Util::extractColumnSpec($row['Type']);
$attribute = $extracted_columnspec['attribute'];
$field_charset = $row['Collation'];
// prepare a common variable to reuse below; however,
// in case of a VIEW, $create_table_fields is empty
if (isset($create_table_fields[$row['Field']])) {
$tempField = $create_table_fields[$row['Field']];
} else {
$tempField = array();
}
// MySQL 4.1.2+ TIMESTAMP options
// (if on_update_current_timestamp is set, then it's TRUE)
if (isset($tempField['on_update_current_timestamp'])) {
$extracted_columnspec = Util::extractColumnSpec($row['Type']);
$attribute = $extracted_columnspec['attribute'];
if (strpos($row['Extra'], 'on update CURRENT_TIMESTAMP') !== false) {
$attribute = 'on update CURRENT_TIMESTAMP';
}
// here, we have a TIMESTAMP that SHOW FULL COLUMNS reports as having the
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
// the latter.
if (! empty($tempField['type'])
&& $tempField['type'] == 'TIMESTAMP'
&& $tempField['timestamp_not_null']
) {
$row['Null'] = '';
}
if (! isset($row['Default'])) {
if ($row['Null'] == 'YES') {
$row['Default'] = '<i>NULL</i>';