From 301253027783a01c73153ff7cc0fb14fd5334ad2 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 28 May 2015 08:52:21 +0530 Subject: [PATCH] bug #4929 Edit view structure doesn't load the algorithm Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/structure.lib.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index b5a6908847..af28623407 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog - bug In /setup, PMA_messages is not defined - bug #4924 Recaptcha failure - bug #4930 Database copy doesn't work for tables with more than one FULLTEXT index +- bug #4929 Edit view structure doesn't load the algorithm 4.4.7.0 (2015-05-16) - bug #4876 Settings issues (Favorite tables shown twice in Settings) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 60dabad94b..0988b82369 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1577,6 +1577,12 @@ function PMA_getHtmlForEditView($url_params) . " AND TABLE_NAME='" . PMA_Util::sqlAddSlashes($GLOBALS['table']) . "';"; $item = $GLOBALS['dbi']->fetchSingleRow($query); + $query = "SHOW CREATE TABLE " . PMA_Util::backquote($GLOBALS['db']) + . "." . PMA_Util::backquote($GLOBALS['table']); + $createView = $GLOBALS['dbi']->fetchValue($query, 0, 'Create View'); + // get algorithm from $createView of the form CREATE ALGORITHM= DE... + $item['ALGORITHM'] = explode(" ", substr($createView, 17))[0]; + $view = array( 'operation' => 'alter', 'definer' => $item['DEFINER'], @@ -1584,6 +1590,7 @@ function PMA_getHtmlForEditView($url_params) 'name' => $GLOBALS['table'], 'as' => $item['VIEW_DEFINITION'], 'with' => $item['CHECK_OPTION'], + 'algorithm' => $item['ALGORITHM'], ); $url = 'view_create.php' . PMA_URL_getCommon($url_params) . '&'; $url .= implode(