Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 3513)
+++ wp-includes/wp-db.php	(working copy)
@@ -305,6 +305,7 @@
 	function bail($message) { // Just wraps errors in a nice header and footer
 	if ( !$this->show_errors )
 		return false;
+	status_header( 500 );
 	header( 'Content-Type: text/html; charset=utf-8');		
 	echo <<<HEAD
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -360,4 +361,4 @@
 }
 
 $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
-?>
\ No newline at end of file
+?>
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 3513)
+++ wp-includes/functions.php	(working copy)
@@ -2183,20 +2183,23 @@
 	$wp->main($query_vars);
 }
 
-function status_header( $header ) {
-	if ( 200 == $header )
-		$text = 'OK';
-	elseif ( 301 == $header )
-		$text = 'Moved Permanently';
-	elseif ( 302 == $header )
-		$text = 'Moved Temporarily';
-	elseif ( 304 == $header )
-		$text = 'Not Modified';
-	elseif ( 404 == $header )
-		$text = 'Not Found';
-	elseif ( 410 == $header )
-		$text = 'Gone';
-
+function status_header( $header, $text='' ) {
+	if ( '' == $text) {
+		if ( 200 == $header )
+			$text = 'OK';
+		elseif ( 301 == $header )
+			$text = 'Moved Permanently';
+		elseif ( 302 == $header )
+			$text = 'Moved Temporarily';
+		elseif ( 304 == $header )
+			$text = 'Not Modified';
+		elseif ( 404 == $header )
+			$text = 'Not Found';
+		elseif ( 410 == $header )
+			$text = 'Gone';
+		elseif ( 500 == $header )
+			$text = 'Database Not Available';
+	}
 	@header("HTTP/1.1 $header $text");
 	@header("Status: $header $text");
 }
