Skip to content

Commit

Permalink
Refactor table join logic in DBCommandClass.php
Browse files Browse the repository at this point in the history
  • Loading branch information
navjottomer committed Apr 23, 2024
1 parent 99e39e2 commit dcb37b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oc-includes/osclass/classes/database/DBCommandClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,13 @@ public function _getSelect()
if (!is_array($this->aFrom)) {
$this->a_from = array($this->aFrom);
}
$sql .= implode(', ', $this->aFrom);
// instead of comma separated tables, we use cross join
// , is same as CROSS JOIN in this case
if (count($this->aFrom) > 1) {
$sql .= implode(' CROSS JOIN ', $this->aFrom);
} else {
$sql .= implode(', ', $this->aFrom);
}
}

// "JOIN" portion of the query
Expand Down

0 comments on commit dcb37b7

Please sign in to comment.