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

expression: rewrite "fieldTp2EvalTp()" to use "mysql.TypeXXX" instead of "TypeClass" #4467

Merged
merged 2 commits into from Sep 7, 2017
Jump to file or symbol
Failed to load files and symbols.
+13 −15
Diff settings

Always

Just for now

View
@@ -46,24 +46,22 @@ const (
)
func fieldTp2EvalTp(tp *types.FieldType) evalTp {
switch tp.ToClass() {
case types.ClassInt:
switch tp.Tp {
case mysql.TypeTiny, mysql.TypeShort, mysql.TypeInt24, mysql.TypeLong, mysql.TypeLonglong,
mysql.TypeBit, mysql.TypeYear:
return tpInt
case types.ClassReal:
case mysql.TypeFloat, mysql.TypeDouble:
return tpReal
case types.ClassDecimal:
case mysql.TypeNewDecimal:
return tpDecimal
case types.ClassString:
switch tp.Tp {
case mysql.TypeDate, mysql.TypeDatetime:
return tpDatetime
case mysql.TypeTimestamp:
return tpTimestamp
case mysql.TypeDuration:
return tpDuration
case mysql.TypeJSON:
return tpJSON
}
case mysql.TypeDate, mysql.TypeDatetime:
return tpDatetime
case mysql.TypeTimestamp:
return tpTimestamp
case mysql.TypeDuration:
return tpDuration
case mysql.TypeJSON:
return tpJSON
}
return tpString
}
ProTip! Use n and p to navigate between commits in a pull request.