summaryrefslogtreecommitdiff
path: root/includes/database.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/database.inc')
-rw-r--r--includes/database.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/includes/database.inc b/includes/database.inc
index 145290ab0..41116091b 100644
--- a/includes/database.inc
+++ b/includes/database.inc
@@ -122,7 +122,7 @@ function db_prefix_tables($sql) {
* @return the name of the previously active database or FALSE if non was found.
*/
function db_set_active($name = 'default') {
- global $db_url, $db_type, $active_db;
+ global $db_url, $db_type, $active_db, $db_prefix;
static $db_conns, $active_name = FALSE;
if (empty($db_url)) {
@@ -150,6 +150,12 @@ function db_set_active($name = 'default') {
}
$db_conns[$name] = db_connect($connect_url);
+ // 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'];
+ }
+
}
$previous_name = $active_name;