From 4e3cb71a4c786e33b00499e072349d2190c11fbc Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 4 Feb 2015 12:38:43 +0530 Subject: [PATCH] bug #4745 Tracking does not handle views properly Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/tracking.lib.php | 83 ++++++++++++++++++++++++++------------ tbl_tracking.php | 3 +- 3 files changed, 61 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index bab2f9adab..639f811579 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog - bug #4741 in ./libraries/Advisor.class.php#184 vsprintf(): Too few arguments - bug #4743 Unable to move cursor with keyboard in filter rows box - bug Incorrect link in doc +- bug #4745 Tracking does not handle views properly 4.3.8.0 (2015-01-24) - bug Undefined constant PMA_DRIZZLE diff --git a/libraries/tracking.lib.php b/libraries/tracking.lib.php index ff45d16697..2d4717e1ab 100644 --- a/libraries/tracking.lib.php +++ b/libraries/tracking.lib.php @@ -45,11 +45,12 @@ function PMA_filterTracking( * * @param string $url_query url query * @param int $last_version last version + * @param string $type type of the table; table, view or both * * @return string */ function PMA_getHtmlForDataDefinitionAndManipulationStatements($url_query, - $last_version + $last_version, $type = 'both' ) { $html = '
'; $html .= '
'; @@ -66,31 +67,54 @@ function PMA_getHtmlForDataDefinitionAndManipulationStatements($url_query, . '" />'; $html .= '

' . __('Track these data definition statements:') . '

'; - $html .= ' ALTER TABLE
'; - $html .= ' RENAME TABLE
'; - $html .= ' CREATE TABLE
'; - $html .= ' DROP TABLE
'; + + if ($type == 'both' || $type == 'table') { + $html .= ' ALTER TABLE
'; + $html .= ' RENAME TABLE
'; + $html .= ' CREATE TABLE
'; + $html .= ' DROP TABLE
'; + } elseif ($type == 'both' || $type == 'view') { + $html .= ' ALTER VIEW
'; + $html .= ' DROP VIEW
'; + $html .= ' CREATE VIEW
'; + } $html .= '
'; + $html .= ' 0) { ); } +$type = PMA_Table::isView($GLOBALS['db'], $GLOBALS['table']) ? 'view' : 'table'; $html .= PMA_getHtmlForDataDefinitionAndManipulationStatements( - $url_query, $last_version + $url_query, $last_version, $type ); $html .= '
';