Index: upgrade.php
===================================================================
--- upgrade.php	(revision 10446)
+++ upgrade.php	(working copy)
@@ -926,19 +926,13 @@
  */
 function maybe_create_table($table_name, $create_ddl) {
 	global $wpdb;
-	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
-		if ($table == $table_name) {
-			return true;
-		}
-	}
+	if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
+		return true;
 	//didn't find it try to create it.
 	$q = $wpdb->query($create_ddl);
 	// we cannot directly tell that whether this succeeded!
-	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
-		if ($table == $table_name) {
-			return true;
-		}
-	}
+	if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
+		return true;
 	return false;
 }
 
