Skip to content

Commit

Permalink
LINQ Postgres driver fix.
Browse files Browse the repository at this point in the history
If Order is used with union first query should be put in parentheses too.
  • Loading branch information
zapov committed Nov 3, 2014
1 parent f070621 commit cdf0459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ private void ProcessSetOperators(StringBuilder sb, List<ResultOperatorBase> oper
{
//TODO missing Concat operator
sb.AppendLine("UNION ALL");
//TODO if order is used, Oracle will fail anyway
var sqe = uro.Source2 as SubQueryExpression;
ResultOperators.ForEach(ro =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@ private void ProcessSetOperators(StringBuilder sb, List<ResultOperatorBase> oper
else
{
//TODO missing Concat operator
if (OrderBy.Count > 0)
{
sb.Insert(0, '(');
sb.AppendLine(")");
}
sb.AppendLine("UNION ALL");
var sqe = uro.Source2 as SubQueryExpression;
ResultOperators.ForEach(ro =>
Expand Down

0 comments on commit cdf0459

Please sign in to comment.