Index: branches/3.9/src/wp-includes/wp-db.php
===================================================================
--- branches/3.9/src/wp-includes/wp-db.php	(revision 32405)
+++ branches/3.9/src/wp-includes/wp-db.php	(working copy)
@@ -2209,7 +2209,10 @@
 		}
 
 		$charsets = $columns = array();
-		$results = $this->get_results( "SHOW FULL COLUMNS FROM `$table`" );
+
+		$table_parts = explode( '.', $table );
+		$table = '`' . implode( '`.`', $table_parts ) . '`';
+		$results = $this->get_results( "SHOW FULL COLUMNS FROM $table" );
 		if ( ! $results ) {
 			return new WP_Error( 'wpdb_get_table_charset_failure' );
 		}
@@ -2782,16 +2785,16 @@
 				. '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?'
 				. '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
 				. '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
-				. ')\s+`?([\w-]+)`?/is', $query, $maybe ) ) {
-			return $maybe[1];
+				. ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
+			return str_replace( '`', '', $maybe[1] );
 		}
 
 		// SHOW TABLE STATUS and SHOW TABLES
 		if ( preg_match( '/^\s*(?:'
 				. 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
 				. '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
-				. ')\W([\w-]+)\W/is', $query, $maybe ) ) {
-			return $maybe[1];
+				. ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
+			return str_replace( '`', '', $maybe[1] );
 		}
 
 		// Big pattern for the rest of the table-related queries.
@@ -2809,8 +2812,8 @@
 				. '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE'
 				. '|(?:GRANT|REVOKE).*ON\s+TABLE'
 				. '|SHOW\s+(?:.*FROM|.*TABLE)'
-				. ')\s+\(*\s*`?([\w-]+)`?\s*\)*/is', $query, $maybe ) ) {
-			return $maybe[1];
+				. ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
+			return str_replace( '`', '', $maybe[1] );
 		}
 
 		return false;
Index: branches/3.9/tests/phpunit/tests/db.php
===================================================================
--- branches/3.9/tests/phpunit/tests/db.php	(revision 32405)
+++ branches/3.9/tests/phpunit/tests/db.php	(working copy)
@@ -392,6 +392,7 @@
 	 */
 	function data_get_table_from_query() {
 		$table = 'a_test_table_name';
+		$db_table = '`a_test_db`.`another_test_table`';
 
 		$queries = array(
 			// Basic
@@ -494,8 +495,13 @@
 			"SHOW INDEX FROM $table",
 		);
 
-		foreach ( $queries as &$query ) {
-			$query = array( $query, $table );
+		$querycount = count( $queries );
+		for ( $ii = 0; $ii < $querycount; $ii++ ) {
+			$db_query = str_replace( $table, $db_table, $queries[ $ii ] );
+			$expected_db_table = str_replace( '`', '', $db_table );
+
+			$queries[ $ii ] = array( $queries[ $ii ], $table );
+			$queries[] = array( $db_query, $expected_db_table );
 		}
 		return $queries;
 	}
