protected function _adjustDumpToEnvironment(&$dump) {
        $dbParams       = $this->getDbConfigParams();
        $thisDbName     = $dbParams->dbname;
        $otherDbParams  = $this->_fetchOtherDatabaseParams();
        $otherDbName    = $otherDbParams->dbname;

        // Firstly, adjust the USE DATABASE statements.
        $oldUseDbSql    = sprintf(self::SQL_USE_STATEMENT, $otherDbName);
        $newUseDbSql    = sprintf(self::SQL_USE_STATEMENT, $thisDbName);
        $dump           = str_replace($oldUseDbSql, $newUseDbSql, $dump);

        // Then adjust the CREATE DATABASE queries.
        $oldCreateDbSql = sprintf(self::SQL_CREATE_DB_STATEMENT, $otherDbName);
        $newCreateDbSql = sprintf(self::SQL_CREATE_DB_STATEMENT, $thisDbName);
        $dump           = str_replace($oldCreateDbSql, $newCreateDbSql, $dump);

        // Fixes an incompatibility issue between MySQL 5.1 and 5.6, where keys can have comments.
        // Note that this only fixes keys that get a null comment from mysqldump, not keys with
        // actual comments. But who would ever do that?
        // @see http://9seeds.com/tech/import-export-issues-between-mysql-5-1-and-5-6/
        $dump = str_replace(" COMMENT '(null)'", '', $dump);

        //  preg_replace seems to be way too demanding for large (180 MB) mysqldump files. Using str_replace now.
    }