=== modified file 'includes/database.inc' --- includes/database.inc (revision 611) +++ includes/database.inc (working copy) @@ -637,6 +637,8 @@ * @param $target */ final protected static function openConnection($key, $target) { + global $db_prefix; + if (empty(self::$connectionInfo)) { self::parseConnectionInfo(); } @@ -660,6 +662,12 @@ $driver_file ='./includes/database.'. $driver .'.inc'; require_once($driver_file); self::$connections[$key][$target] = new $driver_class(self::$databaseInfo[$key][$target]); + + // We need to pass around the simpletest database prefix in the request + // and we put that in the user_agent header. + if (preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) { + $db_prefix = $_SERVER['HTTP_USER_AGENT']; + } } catch (Exception $e) { _db_need_install();