Permalink
Browse files

bug #3593534 [tracking] Structure Snapshot on tracked view renders in…

…valid SQL
  • Loading branch information...
1 parent 7d26b20 commit 584c52820378b589198756cad240dda1bbe3710b @lem9 lem9 committed Dec 12, 2012
Showing with 12 additions and 3 deletions.
  1. +2 −0 ChangeLog
  2. +10 −3 tbl_tracking.php
View
@@ -9,6 +9,8 @@ phpMyAdmin - ChangeLog
- bug #3588354 [l10n] Portuguese Language not displaying correctly
- bug #3591412 [status] Live charts don't work for non-default server
- bug [core] Proxy ajax calls to pma.net to avoid browser notices
+- bug #3593534 [tracking] Structure Snapshot on tracked view renders invalid
+SQL
3.5.4.0 (2012-11-16)
- bug #3570212 [edit] uuid_short() is a no-arguments function
View
@@ -169,7 +169,13 @@ function PMA_filter_tracking($data, $filter_ts_from, $filter_ts_to, $filter_user
}
$tracking_set = rtrim($tracking_set, ',');
- if (PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set )) {
+ if (PMA_Tracker::createVersion(
+ $GLOBALS['db'],
+ $GLOBALS['table'],
+ $_REQUEST['version'],
+ $tracking_set,
+ PMA_Table::isView($GLOBALS['db'], $GLOBALS['table']))
+ ) {
$msg = PMA_Message::success(sprintf(__('Version %s is created, tracking for %s.%s is activated.'), htmlspecialchars($_REQUEST['version']), htmlspecialchars($GLOBALS['db']), htmlspecialchars($GLOBALS['table'])));
$msg->display();
}
@@ -236,10 +242,11 @@ function PMA_filter_tracking($data, $filter_ts_from, $filter_ts_to, $filter_user
<?php
$data = PMA_Tracker::getTrackedData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']);
- // Get first DROP TABLE and CREATE TABLE statements
+ // Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
$drop_create_statements = $data['ddlog'][0]['statement'];
- if (strstr($data['ddlog'][0]['statement'], 'DROP TABLE')) {
+ if (strstr($data['ddlog'][0]['statement'], 'DROP TABLE')
+ || strstr($data['ddlog'][0]['statement'], 'DROP VIEW')) {
$drop_create_statements .= $data['ddlog'][1]['statement'];
}
// Print SQL code

0 comments on commit 584c528

Please sign in to comment.