### Eclipse Workspace Patch 1.0
#P wordpress-trunk bare
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 17501)
+++ wp-includes/wp-db.php	(working copy)
@@ -165,6 +165,15 @@
 	var $prefix = '';
 
 	/**
+	 * {@internal Missing Description}}
+	 * 
+	 * @since 3.0.0
+	 * @access private
+	 * @var string
+	 */
+	var $base_prefix = '';
+
+	/**
 	 * Whether the database queries are ready to start executing.
 	 *
 	 * @since 2.5.0
Index: wp-includes/ms-functions.php
===================================================================
--- wp-includes/ms-functions.php	(revision 17501)
+++ wp-includes/ms-functions.php	(working copy)
@@ -1457,7 +1457,8 @@
 	// Walk through each blog and get the most recent post
 	// published by $user_id
 	foreach ( (array) $user_blogs as $blog ) {
-		$recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$wpdb->base_prefix}{$blog->userblog_id}_posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
+		$prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
+		$recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
 
 		// Make sure we found a post
 		if ( isset($recent_post['ID']) ) {
@@ -1952,9 +1953,9 @@
 	if ( $user_id == 0 )
 		$user_id = $current_user->ID;
 	if ( $blog_id == 0 )
-		$blog_id = $wpdb->blogid;
+		$blog_id = null;
 
-	$local_key = $wpdb->base_prefix . $blog_id . '_' . $key;
+	$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
 
 	if ( isset( $current_user->$local_key ) )
 		return true;
Index: wp-includes/user.php
===================================================================
--- wp-includes/user.php	(revision 17501)
+++ wp-includes/user.php	(working copy)
@@ -682,13 +682,14 @@
 			return false;
 
 		$blogs = $match = array();
-		$prefix_length = strlen($wpdb->base_prefix);
+		$base_prefix = $wpdb->get_blog_prefix( 0 );
+		$prefix_length = strlen($base_prefix);
 		foreach ( (array) $user as $key => $value ) {
-			if ( $prefix_length && substr($key, 0, $prefix_length) != $wpdb->base_prefix )
+			if ( $prefix_length && substr($key, 0, $prefix_length) != $base_prefix )
 				continue;
 			if ( substr($key, -12, 12) != 'capabilities' )
 				continue;
-			if ( preg_match( '/^' . $wpdb->base_prefix . '((\d+)_)?capabilities$/', $key, $match ) ) {
+			if ( preg_match( '/^' . $base_prefix . '((\d+)_)?capabilities$/', $key, $match ) ) {
 				if ( count( $match ) > 2 )
 					$blogs[] = (int) $match[ 2 ];
 				else
@@ -727,9 +728,9 @@
 
 	$current_user = wp_get_current_user();
 	if ( !$blog_id )
-		$blog_id = $wpdb->blogid;
+		$blog_id = null;
 
-	$cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';
+	$cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';
 
 	if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )
 		return true;
Index: wp-admin/includes/upgrade.php
===================================================================
--- wp-admin/includes/upgrade.php	(revision 17501)
+++ wp-admin/includes/upgrade.php	(working copy)
@@ -297,7 +297,7 @@
 
 		// Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
 		if ( !is_super_admin( $user_id ) && $user_id != 1 )
-			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') );
+			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->get_blog_prefix( 1 ).'capabilities') );
 	}
 }
 endif;
@@ -1139,7 +1139,7 @@
 
 	// 3.0 screen options key name changes.
 	if ( is_main_site() && !defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) {
-		$prefix = like_escape($wpdb->base_prefix);
+		$prefix = like_escape( $wpdb->get_blog_prefix( 0 ) );
 		$wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '{$prefix}%meta-box-hidden%' OR meta_key LIKE '{$prefix}%closedpostboxes%' OR meta_key LIKE '{$prefix}%manage-%-columns-hidden%' OR meta_key LIKE '{$prefix}%meta-box-order%' OR meta_key LIKE '{$prefix}%metaboxorder%' OR meta_key LIKE '{$prefix}%screen_layout%'
 					 OR meta_key = 'manageedittagscolumnshidden' OR meta_key='managecategoriescolumnshidden' OR meta_key = 'manageedit-tagscolumnshidden' OR meta_key = 'manageeditcolumnshidden' OR meta_key = 'categories_per_page' OR meta_key = 'edit_tags_per_page'" );
 	}
