Index: trunk/src/wp-includes/functions.php
===================================================================
--- trunk/src/wp-includes/functions.php	(revision 64282)
+++ trunk/src/wp-includes/functions.php	(revision 64305)
@@ -5664,4 +5664,5 @@
  *
  * @since 2.3.2
+ * @since 7.2.0 Added status and no-cache headers before loading a custom `db-error.php` drop-in.
  *
  * @global wpdb $wpdb WordPress database abstraction object.
@@ -5676,4 +5677,6 @@
 	// Load custom DB error template, if present.
 	if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
+		status_header( 500 );
+		nocache_headers();
 		require_once WP_CONTENT_DIR . '/db-error.php';
 		die();
