提交 5174c527 authored 作者: Bekrenev Dmitry's avatar Bekrenev Dmitry

Fix compatibility postgresql function string_agg

上级 89f239ba
......@@ -2293,8 +2293,9 @@ public class Parser {
}
} else if (aggregateType == Aggregate.GROUP_CONCAT) {
Aggregate agg = null;
if (equalsToken("GROUP_CONCAT", aggregateName)) {
boolean distinct = readIf("DISTINCT");
if (equalsToken("GROUP_CONCAT", aggregateName)) {
agg = new Aggregate(Aggregate.GROUP_CONCAT,
readExpression(), currentSelect, distinct);
if (readIf("ORDER")) {
......@@ -2308,8 +2309,13 @@ public class Parser {
} else if (equalsToken("STRING_AGG", aggregateName)) {
// PostgreSQL compatibility: string_agg(expression, delimiter)
agg = new Aggregate(Aggregate.GROUP_CONCAT,
readExpression(), currentSelect, false);
readExpression(), currentSelect, distinct);
read(",");
if(readIf("ORDER")) {
read("BY");
agg.setGroupConcatOrder(parseSimpleOrderList());
}
agg.setGroupConcatSeparator(readExpression());
}
r = agg;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论