Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix newlines for ORDER BY and GROUP BY in ETL DbModel #151

Merged
merged 2 commits into from
Jun 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions classes/ETL/DbModel/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ public function getSql($includeSchema = true)

$sql = "SELECT" .( null !== $this->query_hint ? " " . $this->query_hint : "" ) . "\n" .
implode(",\n", $columnList) . "\n" .
implode("\n", $joinList) . "\n" .
( count($whereConditions) > 0 ? "WHERE " . implode("\nAND ", $whereConditions) . "\n" : "" ) .
( count($this->groupby) > 0 ? "GROUP BY " . implode(", ", $this->groupby) : "" ) .
( count($this->orderby) > 0 ? "ORDER BY " . implode(", ", $this->orderby) : "" );
implode("\n", $joinList) .
( count($whereConditions) > 0 ? "\nWHERE " . implode("\nAND ", $whereConditions) : "" ) .
( count($this->groupby) > 0 ? "\nGROUP BY " . implode(", ", $this->groupby) : "" ) .
( count($this->orderby) > 0 ? "\nORDER BY " . implode(", ", $this->orderby) : "" );

// If any macros have been defined, process those macros now. Since macros can contain variables
// themselves, we will process the variables later.
Expand Down