diff --git a/src/Processor/Expression/FunctionEvaluator.php b/src/Processor/Expression/FunctionEvaluator.php index 90e79d05..e8effd46 100644 --- a/src/Processor/Expression/FunctionEvaluator.php +++ b/src/Processor/Expression/FunctionEvaluator.php @@ -66,6 +66,8 @@ public static function evaluate( return self::sqlConcatWS($conn, $scope, $expr, $row, $result); case 'CONCAT': return self::sqlConcat($conn, $scope, $expr, $row, $result); + case 'GROUP_CONCAT': + return self::sqlGroupConcat($conn, $scope, $expr, $row, $result); case 'FIELD': return self::sqlColumn($conn, $scope, $expr, $row, $result); case 'BINARY': @@ -932,6 +934,27 @@ private static function sqlConcat( return $final_concat; } + /** + * @param array $row + */ + private static function sqlGroupConcat( + FakePdoInterface $conn, + Scope $scope, + FunctionExpression $expr, + array $row, + QueryResult $result + ): string { + $args = $expr->args; + + $final_concat = ""; + foreach ($args as $arg) { + $val = (string) Evaluator::evaluate($conn, $scope, $arg, $row, $result); + $final_concat .= $val; + } + + return $final_concat; + } + /** * @param array $row *