Index: /Users/denis/Sites/sem-pro/wp-includes/general-template.php
===================================================================
--- /Users/denis/Sites/sem-pro/wp-includes/general-template.php	(revision 557)
+++ /Users/denis/Sites/sem-pro/wp-includes/general-template.php	(working copy)
@@ -910,14 +910,17 @@
 		}
 	}
 
-	ob_start();
 	// Quick check. If we have no posts at all, abort!
 	if ( !$posts ) {
-		$gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1");
-		if ( !$gotsome )
+		$gotsome = $wpdb->get_var("SELECT 1 FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
+		if ( !$gotsome ) {
+			$cache[ $key ] = '';
+			wp_cache_set( 'get_calendar', $cache, 'calendar' );
 			return;
+		}
 	}
 
+	ob_start();
 	if ( isset($_GET['w']) )
 		$w = ''.intval($_GET['w']);
 
