[inner-1830] fix:result of the a group_concat() is incorrect

This commit is contained in:
wd2365151147
2022-08-23 16:46:02 +08:00
parent bc1f401202
commit e287d745cb

View File

@@ -102,8 +102,9 @@ public class ItemFuncGroupConcat extends ItemSum {
String s = item.valStr();
if (item.isNull())
return false;
rowStr.append(s).append(seperator);
rowStr.append(s);
}
rowStr.append(seperator);
if (orders != null) {
if (sourceFields != null && rowComparator == null) {
rowComparator = new RowDataComparator(sourceFields, orders);
@@ -163,7 +164,7 @@ public class ItemFuncGroupConcat extends ItemSum {
append(orderResult.result);
}
}
return resultSb.substring(0, resultSb.length() - 1);
return resultSb.substring(0, resultSb.length() - seperator.length());
}
// append a row string