Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 15636)
+++ wp-includes/functions.php	(working copy)
@@ -3101,24 +3101,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/load.php
===================================================================
--- wp-includes/load.php	(revision 15636)
+++ wp-includes/load.php	(working copy)
@@ -308,6 +308,33 @@
 }
 
 /**
+ * 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 globalize $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;
+
+	require_once( ABSPATH . WPINC . '/wp-db.php' );
+	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 );
+	}
+}
+
+/**
  * Sets the database table prefix and the format specifiers for database table columns.
  *
  * Columns not listed here default to %s.
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 15636)
+++ wp-includes/wp-db.php	(working copy)
@@ -1554,12 +1554,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 15636)
+++ wp-settings.php	(working copy)
@@ -67,7 +67,7 @@
 require( ABSPATH . WPINC . '/functions.php' );
 require( ABSPATH . WPINC . '/classes.php' );
 
-// Include the wpdb class, or a db.php database drop-in if present.
+// Include the wpdb class and, if present, a db.php database drop-in.
 require_wp_db();
 
 // Set the database table prefix and the format specifiers for database table columns.
