Fix s3select TRIM function's nil pointer dereference bug (#7817)

This commit is contained in:
Yao Zongyou
2019-06-25 07:59:33 +08:00
committed by kannappanr
parent 48cb271a46
commit 23b9df0694
2 changed files with 22 additions and 8 deletions

View File

@@ -274,6 +274,15 @@ func (e *FuncExpr) analyze(s *Select) (result qProp) {
}
return result
case sqlFnTrim:
if e.Trim.TrimChars != nil {
result.combine(e.Trim.TrimChars.analyze(s))
}
if e.Trim.TrimFrom != nil {
result.combine(e.Trim.TrimFrom.analyze(s))
}
return result
case sqlFnSubstring:
errVal := fmt.Errorf("Invalid argument(s) to %s", string(funcName))
result.combine(e.Substring.Expr.analyze(s))