Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 17446)
+++ wp-includes/query.php	(working copy)
@@ -1240,6 +1240,15 @@
 	var $parsed_tax_query = false;
 
 	/**
+	 * Whether the query has been parsed once.
+	 *
+	 * @since 3.1.0
+	 * @access private
+	 * @var bool
+	 */
+	var $parsed_query = false;
+
+	/**
 	 * Resets query flags to false.
 	 *
 	 * The query flags are what page info WordPress was able to figure out.
@@ -1312,7 +1321,7 @@
 	 * @access public
 	 */
 	function parse_query_vars() {
-		$this->parse_query('');
+		$this->parse_query();
 	}
 
 	/**
@@ -1383,12 +1392,14 @@
 	 * @since 1.5.0
 	 * @access public
 	 *
-	 * @param string|array $query
+	 * @param string|array $query Optional query.
 	 */
-	function parse_query($query) {
-		if ( !empty($query) || !isset($this->query) ) {
+	function parse_query( $query =  '' ) {
+		if ( ! empty( $query ) ) {
 			$this->init();
-			$this->query = $this->query_vars = wp_parse_args($query);
+			$this->query = $this->query_vars = wp_parse_args( $query );
+		} elseif ( ! isset( $this->query ) ) {
+			$this->query = $this->query_vars;
 		}
 
 		$this->query_vars = $this->fill_query_vars($this->query_vars);
@@ -1625,6 +1636,9 @@
 		if ( '404' == $qv['error'] )
 			$this->set_404();
 
+		// Mark the query as parsed
+		$this->parsed_query = true;
+
 		if ( !empty($query) )
 			do_action_ref_array('parse_query', array(&$this));
 	}
@@ -1871,6 +1885,12 @@
 	function &get_posts() {
 		global $wpdb, $user_ID, $_wp_using_ext_object_cache;
 
+		// If we haven't parsed the query already, we should do that now
+		if ( ! $this->parsed_query )
+			$this->parse_query();
+
+		$this->parsed_query = false; // Reset it
+
 		do_action_ref_array('pre_get_posts', array(&$this));
 
 		// Shorthand.
@@ -2851,8 +2871,9 @@
 	 * @param string $query URL query string.
 	 * @return array List of posts.
 	 */
-	function &query($query) {
-		$this->parse_query($query);
+	function &query( $query ) {
+		$this->init();
+		$this->query = $this->query_vars = wp_parse_args( $query );
 		return $this->get_posts();
 	}
 
