Skip to content

Commit

Permalink
feat: add a constant to store the group concat default separator
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Jun 24, 2024
1 parent b0a75ea commit e603162
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ __debug_bin
/php/composer.phar
/php/vendor

report*.xml

# vitess.io preview site
/preview-vitess.io/

Expand Down
3 changes: 3 additions & 0 deletions go/vt/sqlparser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ const (
// KillType strings
ConnectionStr = "connection"
QueryStr = "query"

// GroupConcatDefaultSeparator is the default separator for GroupConcatExpr.
GroupConcatDefaultSeparator = ","
)

// Constants for Enum Type - Insert.Action
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/planbuilder/operator_transformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func transformAggregator(ctx *plancontext.PlanningContext, op *operators.Aggrega
aggrParam := engine.NewAggregateParam(aggr.OpCode, aggr.ColOffset, aggr.Alias, ctx.VSchema.Environment().CollationEnv())
aggrParam.Func = aggr.Func
if gcFunc, isGc := aggrParam.Func.(*sqlparser.GroupConcatExpr); isGc && gcFunc.Separator == "" {
gcFunc.Separator = ","
gcFunc.Separator = sqlparser.GroupConcatDefaultSeparator
}
aggrParam.Original = aggr.Original
aggrParam.OrigOpcode = aggr.OriginalOpCode
Expand Down

0 comments on commit e603162

Please sign in to comment.