Skip to content

Commit

Permalink
Broken orderby statement JetBrains#1431
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Jan 22, 2022
1 parent 3070d05 commit aec4ee5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ sealed class SetOperation(

if (orderByExpressions.isNotEmpty()) {
append(" ORDER BY ")
orderByExpressions.appendTo {
append((it.first as? ExpressionAlias<*>)?.alias ?: it.first, " ", it.second.name)
orderByExpressions.appendTo { (expression, sortOrder) ->
currentDialect.dataTypeProvider.precessOrderByClause(this, expression, sortOrder)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ abstract class FunctionProvider {
}
append(expr.expr)
if (expr.orderBy.isNotEmpty()) {
expr.orderBy.appendTo(prefix = " ORDER BY ") {
append(it.first, " ", it.second.name)
append(" ORDER BY ")
expr.orderBy.appendTo { (expression, sortOrder) ->
currentDialect.dataTypeProvider.precessOrderByClause(this, expression, sortOrder)
}
}
expr.separator?.let {
Expand Down

0 comments on commit aec4ee5

Please sign in to comment.