diff --git a/ChangeLog b/ChangeLog index b507a58d4..08f1d7756 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,7 +44,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1764182 [cookies] Suhosin cookie encryption breaks phpMyAdmin - bug #1798786 [import] Wrong error when a string contains semicolon - bug #1813508 [login] Missing parameter: field after re-login -- bug #1710144 [parser] space after COUNT breaks Export but not Query +- bug #1710144 [parser] Space after COUNT breaks Export but not Query +- bug #1783620 [parser] Subquery results without "as" are ignored 2.11.3.0 (2007-12-08) - patch #1818389 to remove a notice (failed to flush buffer), thanks to diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index c17a49e14..b2401b48b 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -827,6 +827,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { $number_of_brackets = 0; $in_subquery = false; + $seen_subquery = false; // for SELECT EXTRACT(YEAR_MONTH FROM CURDATE()) // we must not use CURDATE as a table_ref @@ -1098,6 +1099,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { if ($upper_data == 'SELECT') { if ($number_of_brackets > 0) { $in_subquery = true; + $seen_subquery = true; // this is a subquery so do not analyze inside it continue; } @@ -1146,7 +1148,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { break; } // end switch - if ($subresult['querytype'] == 'SELECT' && !$in_group_concat) { + if ($subresult['querytype'] == 'SELECT' + && ! $in_group_concat + && ! ($seen_subquery && $arr[$i - 1]['type'] == 'punct_bracket_close_round')) { if (!$seen_from) { if ($previous_was_identifier && isset($chain)) { // found alias for this select_expr, save it