Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 19205)
+++ wp-includes/query.php	(working copy)
@@ -2388,8 +2388,9 @@
 		if ( 'any' == $post_type ) {
 			$exclude_post_types = '';
 			$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
-			if ( ! empty( $in_search_post_types ) )
-				$where .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')");
+			$post_types = empty($in_search_post_types) ? 'null' :
+				"'" . join("', '", $in_search_post_types ) . "'";
+			$where .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ($post_types)");
 		} elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
 			$where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";
 		} elseif ( ! empty( $post_type ) ) {
