Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 21708)
+++ wp-includes/query.php	(working copy)
@@ -2614,13 +2614,17 @@
 		}
 
 		if ( 'ids' == $q['fields'] ) {
-			$this->posts = $wpdb->get_col($this->request);
+			$this->posts = $wpdb->get_col( $this->request );
+			$this->post_count = count( $this->posts );
+			$this->set_found_posts( $q, $limits );
 
 			return $this->posts;
 		}
 
 		if ( 'id=>parent' == $q['fields'] ) {
-			$this->posts = $wpdb->get_results($this->request);
+			$this->posts = $wpdb->get_results( $this->request );
+			$this->post_count = count( $this->posts );
+			$this->set_found_posts( $q, $limits );
 
 			$r = array();
 			foreach ( $this->posts as $post )
@@ -2642,12 +2646,11 @@
 			$ids = $wpdb->get_col( $this->request );
 
 			if ( $ids ) {
+				$this->posts = $ids;
 				$this->set_found_posts( $q, $limits );
 				_prime_post_caches( $ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] );
-				$this->posts = $ids;
 			} else {
 				$this->posts = array();
-				$this->found_posts = $this->max_num_pages = 0;
 			}
 		} else {
 			$this->posts = $wpdb->get_results( $this->request );
@@ -2750,7 +2753,7 @@
 		if ( !$q['suppress_filters'] )
 			$this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) );
 
-		$this->post_count = count($this->posts);
+		$this->post_count = count( $this->posts );
 
 		// Always sanitize
 		foreach ( $this->posts as $i => $post ) {
@@ -2770,13 +2773,18 @@
 	function set_found_posts( $q, $limits ) {
 		global $wpdb;
 
-		if ( $q['no_found_rows'] || empty( $limits ) )
+		if ( $q['no_found_rows'] || ! $this->posts )
 			return;
 
-		$this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
+		if ( ! empty( $limits ) )
+			$this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
+		else
+			$this->found_posts = count( $this->posts );
+
 		$this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
 
-		$this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
+		if ( ! empty( $limits ) )
+			$this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
 	}
 
 	/**
