From 2c5541a94b12fea64ffbe67a504dddb1725cbaf0 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Mon, 1 Aug 2016 11:41:44 +0530 Subject: [PATCH 1/2] Fix #12399: Adding index to table shows wrong top navigation If the SQL query analyzing sets the $table value to '', don't update the original value Signed-off-by: Deven Bansod --- import.php | 12 ++++++++++-- libraries/sql.lib.php | 6 +++++- sql.php | 6 +++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/import.php b/import.php index ae0eaef802..e885c91f3e 100644 --- a/import.php +++ b/import.php @@ -742,10 +742,14 @@ if ($sqlLength <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { list( $analyzed_sql_results, $db, - $table + $table_from_sql ) = PMA_parseAnalyze($sql_query, $db); // @todo: possibly refactor extract($analyzed_sql_results); + + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } } // There was an error? @@ -774,11 +778,15 @@ if ($go_sql) { list( $analyzed_sql_results, $db, - $table + $table_from_sql ) = PMA_parseAnalyze($sql_query, $db); // @todo: possibly refactor extract($analyzed_sql_results); + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } + $html_output .= PMA_executeQueryAndGetQueryResponse( $analyzed_sql_results, // analyzed_sql_results false, // is_gotofile diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 4eb1da726b..fafeb40aaf 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -2035,10 +2035,14 @@ function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, list( $analyzed_sql_results, $db, - $table + $table_from_sql ) = PMA_parseAnalyze($sql_query, $db); // @todo: possibly refactor extract($analyzed_sql_results); + + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } } $html_output = PMA_executeQueryAndGetQueryResponse( diff --git a/sql.php b/sql.php index e7e143cf14..5e77676e65 100644 --- a/sql.php +++ b/sql.php @@ -141,11 +141,15 @@ require_once 'libraries/parse_analyze.lib.php'; list( $analyzed_sql_results, $db, - $table + $table_from_sql ) = PMA_parseAnalyze($sql_query, $db); // @todo: possibly refactor extract($analyzed_sql_results); +if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; +} + /** * Check rights in case of DROP DATABASE From 2ee0e4ed0e86572f15764fea6ef37bdaf546e6ee Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Mon, 1 Aug 2016 11:45:00 +0530 Subject: [PATCH 2/2] ChangeLog entries for #12425 and #12399 Signed-off-by: Deven Bansod --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 41c6e80e71..b14be97807 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ phpMyAdmin - ChangeLog - issue #12413 Fixed deleting users in non English locales - issue #12416 Fixed replication status output in Databases listing - issue #12303 Avoid typecasting to float when not needed +- issue #12425 Duplicate message variable names in messages.inc.php +- issue #12399 Adding index to table shows wrong top navigation 4.6.3 (2016-06-23) - issue #12249 Fixed cookie path on Windows