Skip to content
Extraits de code Groupes Projets
Valider ef096ce2 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

Merge pull request #9346 from piwik/fix_tablenotallowedtojoin

Fix error table log_visit is already joined 
parents 8344b1a4 39c6118f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -102,7 +102,6 @@ class LogQueryBuilder
$tables[$actionIndex] = "log_conversion";
$tables[$conversionIndex] = "log_link_visit_action";
}
// same as above: action before visit
$actionIndex = array_search("log_link_visit_action", $tables);
$visitIndex = array_search("log_visit", $tables);
......@@ -169,11 +168,23 @@ class LogQueryBuilder
} elseif ($linkVisitActionsTableAvailable && $table == "log_visit") {
// have actions, need visits => join on idvisit
$join = "log_visit.idvisit = log_link_visit_action.idvisit";
if ($this->hasJoinedTableAlreadyManually($table, $join, $tables)) {
$visitsAvailable = true;
continue;
}
} elseif ($visitsAvailable && $table == "log_link_visit_action") {
// have visits, need actions => we have to use a more complex join
// we don't hande this here, we just return joinWithSubSelect=true in this case
$joinWithSubSelect = true;
$join = "log_link_visit_action.idvisit = log_visit.idvisit";
if ($this->hasJoinedTableAlreadyManually($table, $join, $tables)) {
$linkVisitActionsTableAvailable = true;
continue;
}
} elseif ($conversionsAvailable && $table == "log_link_visit_action") {
// have conversions, need actions => join on idvisit
$join = "log_conversion.idvisit = log_link_visit_action.idvisit";
......
......@@ -382,7 +382,8 @@ class SegmentTest extends IntegrationTestCase
$from = array(
'log_link_visit_action',
array('table' => 'log_visit', 'joinOn' => 'log_visit.idvisit = log_link_visit_action.idvisit'),
array('table' => 'log_action', 'joinOn' => 'log_link_visit_action.idaction_url = log_action.idaction')
array('table' => 'log_action', 'joinOn' => 'log_link_visit_action.idaction_url = log_action.idaction'),
'log_visit'
);
$where = 'log_link_visit_action.server_time >= ?
AND log_link_visit_action.server_time <= ?
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter