From 390a36eeea9ee88ca8736bbec932c2000fdda17b Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 6 Mar 2015 15:52:44 +0530 Subject: [PATCH] Compatibility with central columns of version 4.4 Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + db_central_columns.php | 8 ++++++++ libraries/central_columns.lib.php | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index f021f6b576..fed642696e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog - bug Undefined index savedsearcheswork - bug #4788 Inline edit of DATE fields with NULL, NULL checkbox is under datepicker - bug #4790 DROP TABLE/VIEW IF EXISTS are not tracked +- bug Compatibility with central columns of version 4.4 4.3.11.1 (2015-03-04) - bug [security] Risk of BREACH attack, see PMASA-2015-1 diff --git a/db_central_columns.php b/db_central_columns.php index 2d3a2c301b..18eca6bc15 100644 --- a/db_central_columns.php +++ b/db_central_columns.php @@ -113,6 +113,14 @@ $result = PMA_getColumnsList($db, $pos, $max_rows); $odd_row = false; $row_num=0; foreach ($result as $row) { + $vals = explode(',', $row['col_extra']); + if (in_array('auto_increment', $vals)) { + $row['col_extra'] = 'auto_increment'; + } elseif (in_array('on update CURRENT_TIMESTAMP', $vals)) { + $row['col_extra'] = 'on update CURRENT_TIMESTAMP'; + } else { + $row['col_extra'] = ''; + } $tableHtmlRow = PMA_getHTMLforCentralColumnsTableRow( $row, $odd_row, $row_num, $db ); diff --git a/libraries/central_columns.lib.php b/libraries/central_columns.lib.php index 606f274ef8..07c33d72b8 100644 --- a/libraries/central_columns.lib.php +++ b/libraries/central_columns.lib.php @@ -408,6 +408,14 @@ function PMA_makeConsistentWithList($db, $selected_tables) if ($column['col_length']) { $query .= '(' . $column['col_length'] . ')'; } + $vals = explode(',', $column['col_extra']); + if (in_array('auto_increment', $vals)) { + $column['col_extra'] = 'auto_increment'; + } elseif (in_array('on update CURRENT_TIMESTAMP', $vals)) { + $column['col_extra'] = 'on update CURRENT_TIMESTAMP'; + } else { + $column['col_extra'] = ''; + } if ($column['col_isNull']) { $query .= ' NULL'; } else {