Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 15489)
+++ wp-includes/functions.php	(working copy)
@@ -3071,24 +3071,6 @@
 }
 
 /**
- * Load the correct database class file.
- *
- * This function is used to load the database class file either at runtime or by
- * wp-admin/setup-config.php We must globalise $wpdb to ensure that it is
- * defined globally by the inline code in wp-db.php.
- *
- * @since 2.5.0
- * @global $wpdb WordPress Database Object
- */
-function require_wp_db() {
-	global $wpdb;
-	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
-		require_once( WP_CONTENT_DIR . '/db.php' );
-	else
-		require_once( ABSPATH . WPINC . '/wp-db.php' );
-}
-
-/**
  * Load custom DB error or display WordPress DB error.
  *
  * If a file exists in the wp-content directory named db-error.php, then it will
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 15489)
+++ wp-includes/wp-db.php	(working copy)
@@ -1582,12 +1582,4 @@
 	}
 }
 
-if ( ! isset( $wpdb ) ) {
-	/**
-	 * WordPress Database Object, if it isn't set already in wp-content/db.php
-	 * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database
-	 * @since 0.71
-	 */
-	$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
-}
 ?>
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 15489)
+++ wp-settings.php	(working copy)
@@ -67,9 +67,21 @@
 require( ABSPATH . WPINC . '/functions.php' );
 require( ABSPATH . WPINC . '/classes.php' );
 
-// Include the wpdb class, or a db.php database drop-in if present.
-require_wp_db();
+require_once( ABSPATH . WPINC . '/wp-db.php' );
 
+// Load custom db.php, if it exists
+if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
+	require_once( WP_CONTENT_DIR . '/db.php' );
+
+if ( ! isset( $wpdb ) ) {
+	/**
+	 * WordPress Database Object, if it isn't set already in wp-content/db.php
+	 * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database
+	 * @since 0.71
+	 */
+	$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
+}
+
 // Set the database table prefix and the format specifiers for database table columns.
 wp_set_wpdb_vars();
 
