Index: src/wp-includes/comment.php
===================================================================
--- src/wp-includes/comment.php	(revision 27256)
+++ src/wp-includes/comment.php	(working copy)
@@ -373,8 +373,13 @@
 		}
 		if ( '' !== $parent )
 			$where .= $wpdb->prepare( ' AND comment_parent = %d', $parent );
-		if ( '' !== $user_id )
+
+		if ( is_array( $user_id ) ) {
+			$where .= ' AND user_id IN (' . implode( ',', array_map( 'absint', $user_id ) ) . ')';
+		} elseif ( '' !== $user_id ) {
 			$where .= $wpdb->prepare( ' AND user_id = %d', $user_id );
+		}
+
 		if ( '' !== $search )
 			$where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) );
 
Index: src/wp-includes/wp-db.php
===================================================================
--- src/wp-includes/wp-db.php	(revision 27257)
+++ src/wp-includes/wp-db.php	(working copy)
@@ -569,12 +569,15 @@
 			$this->show_errors();
 
 		/* Use ext/mysqli if it exists and:
+		 *  - USE_EXT_MYSQL is defined as false, or
 		 *  - We are a development version of WordPress, or
 		 *  - We are running PHP 5.5 or greater, or
 		 *  - ext/mysql is not loaded.
 		 */
 		if ( function_exists( 'mysqli_connect' ) ) {
-			if ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
+			if ( defined( 'USE_EXT_MYSQL' ) ) {
+				$this->use_mysqli = ! USE_EXT_MYSQL;
+			} elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
 				$this->use_mysqli = true;
 			} elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
 				$this->use_mysqli = true;
Index: tests/phpunit/tests/comment/query.php
===================================================================
--- tests/phpunit/tests/comment/query.php	(revision 27256)
+++ tests/phpunit/tests/comment/query.php	(working copy)
@@ -156,4 +156,28 @@
 		$this->assertEquals( 10, count( get_comments( array( 'status' => 'trash' ) ) ) );
 		$this->assertEquals( 10, count( get_comments( array( 'status' => 'spam' ) ) ) );
 	}
+
+	/**
+	 * @ticket 27064
+	 */
+	function test_get_comments_by_user() {
+		$users = $this->factory->user->create_many( 2 );
+		$this->factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
+		$this->factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
+		$this->factory->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
+
+		$comments = get_comments( array( 'user_id' => $users[0] ) );
+
+		$this->assertCount( 2, $comments );
+		$this->assertEquals( $users[0], $comments[0]->user_id );
+		$this->assertEquals( $users[0], $comments[1]->user_id );
+
+		$comments = get_comments( array( 'user_id' => $users ) );
+
+		$this->assertCount( 3, $comments );
+		$this->assertEquals( $users[0], $comments[0]->user_id );
+		$this->assertEquals( $users[0], $comments[1]->user_id );
+		$this->assertEquals( $users[1], $comments[2]->user_id );
+
+	}
 }
