Index: src/wp-includes/wp-db.php
===================================================================
--- src/wp-includes/wp-db.php	(revision 28024)
+++ src/wp-includes/wp-db.php	(working copy)
@@ -579,14 +579,14 @@
 			$this->show_errors();
 
 		/* Use ext/mysqli if it exists and:
-		 *  - WP_USE_EXT_MYSQL is defined as false, or
+		 *  - 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 ( defined( 'WP_USE_EXT_MYSQL' ) ) {
-				$this->use_mysqli = ! WP_USE_EXT_MYSQL;
+			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'], '-' ) ) {
@@ -1299,13 +1299,12 @@
 	/**
 	 * Connect to and select database.
 	 *
-	 * If $allow_bail is false, the lack of database connection will need
-	 * to be handled manually.
-	 *
 	 * @since 3.0.0
-	 * @since 3.9.0 $allow_bail parameter added.
 	 *
-	 * @param bool $allow_bail Optional. Allows the function to bail. Default true.
+	 * @param bool $allow_bail Optional. Allows the function to bail, default true. If this is set
+	 *                         to false, you will need to handle the lack of database connection
+	 *                         manually. Available since 3.9.0.
+	 *
 	 * @return bool True with a successful connection, false on failure.
 	 */
 	function db_connect( $allow_bail = true ) {
@@ -1349,14 +1348,14 @@
 
 				/* It's possible ext/mysqli is misconfigured. Fall back to ext/mysql if:
 		 		 *  - We haven't previously connected, and
-		 		 *  - WP_USE_EXT_MYSQL isn't set to false, and
+		 		 *  - USE_EXT_MYSQL isn't set to false, and
 		 		 *  - ext/mysql is loaded.
 		 		 */
 				$attempt_fallback = true;
 
 				if ( $this->has_connected ) {
 					$attempt_fallback = false;
-				} else if ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) {
+				} else if ( defined( 'USE_EXT_MYSQL' ) && ! USE_EXT_MYSQL ) {
 					$attempt_fallback = false;
 				} else if ( ! function_exists( 'mysql_connect' ) ) {
 					$attempt_fallback = false;
@@ -1415,12 +1414,12 @@
 	 * If this function is unable to reconnect, it will forcibly die, or if after the
 	 * the template_redirect hook has been fired, return false instead.
 	 *
-	 * If $allow_bail is false, the lack of database connection will need
-	 * to be handled manually.
-	 *
 	 * @since 3.9.0
 	 *
-	 * @param bool $allow_bail Optional. Allows the function to bail. Default true.
+	 * @param bool $allow_bail Optional. Allows the function to bail, default true. If this is set
+	 *                         to false, you will need to handle the lack of database connection
+	 *                         manually.
+	 *
 	 * @return bool True if the connection is up.
 	 */
 	function check_connection( $allow_bail = true ) {
@@ -1599,14 +1598,14 @@
 	}
 
 	/**
-	 * Internal function to perform the mysql_query() call.
+	 * Internal function to perform the mysql_query call
 	 *
 	 * @since 3.9.0
 	 *
 	 * @access private
 	 * @see wpdb::query()
 	 *
-	 * @param string $query The query to run.
+	 * @param string $query The query to run
 	 */
 	private function _do_query( $query ) {
 		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
@@ -1963,7 +1962,7 @@
 
 		if ( $this->use_mysqli ) {
 			for ( $i = 0; $i < @mysqli_num_fields( $this->result ); $i++ ) {
-				$this->col_info[ $i ] = @mysqli_fetch_field( $this->result );
+				$this->col_info[ $i ] = @mysqli_fetch_field( $this->result, $i );
 			}
 		} else {
 			for ( $i = 0; $i < @mysql_num_fields( $this->result ); $i++ ) {
@@ -2137,14 +2136,21 @@
 	 *
 	 * @since 2.7.0
 	 *
+	 * @param bool $full Optional. Flag to provide the full version string, default false. Available since 3.9.0.
+	 *
 	 * @return false|string false on failure, version number on success
 	 */
-	function db_version() {
+	function db_version( $full = false ) {
 		if ( $this->use_mysqli ) {
 			$server_info = mysqli_get_server_info( $this->dbh );
 		} else {
 			$server_info = mysql_get_server_info( $this->dbh );
 		}
-		return preg_replace( '/[^0-9.].*/', '', $server_info );
+
+		if ( $full ) {
+			return $server_info;
+		} else {
+			return preg_replace( '/[^0-9.].*/', '', $server_info );
+		}
 	}
 }
