-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement icu_version
function
#2621
Conversation
sql/expression/function/registry.go
Outdated
@@ -102,6 +102,7 @@ var BuiltIns = []sql.Function{ | |||
sql.Function2{Name: "gtid_subtract", Fn: NewGtidSubtract}, | |||
sql.Function1{Name: "hex", Fn: NewHex}, | |||
sql.Function1{Name: "hour", Fn: NewHour}, | |||
sql.Function0{Name: "icu_version", Fn: NewICUVersion}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need the intermediaries? can we just pre-fold the constant and return a literal here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
sql/planbuilder/scalar.go
Outdated
@@ -133,6 +134,8 @@ func (b *Builder) buildScalar(inScope *scope, e ast.Expr) (ex sql.Expression) { | |||
name := v.Name.Lowered() | |||
if name == "name_const" { | |||
return b.buildNameConst(inScope, v) | |||
} else if name == "icu_version" { | |||
return expression.NewLiteral("73.1", types.MustCreateString(query.Type_VARCHAR, 4, sql.Collation_Default)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we const this out somewhere? maybe with a docs reference
MySQL Docs: https://dev.mysql.com/doc/refman/8.4/en/information-functions.html#function_icu-version