|
|
@ -337,20 +337,25 @@ func handleSQLSubstring(r Record, e *SubstringFunc) (val *Value, err error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func handleSQLTrim(r Record, e *TrimFunc) (res *Value, err error) { |
|
|
|
func handleSQLTrim(r Record, e *TrimFunc) (res *Value, err error) { |
|
|
|
charsV, cerr := e.TrimChars.evalNode(r) |
|
|
|
chars := "" |
|
|
|
if cerr != nil { |
|
|
|
ok := false |
|
|
|
return nil, cerr |
|
|
|
if e.TrimChars != nil { |
|
|
|
} |
|
|
|
charsV, cerr := e.TrimChars.evalNode(r) |
|
|
|
inferTypeAsString(charsV) |
|
|
|
if cerr != nil { |
|
|
|
chars, ok := charsV.ToString() |
|
|
|
return nil, cerr |
|
|
|
if !ok { |
|
|
|
} |
|
|
|
return nil, errNonStringTrimArg |
|
|
|
inferTypeAsString(charsV) |
|
|
|
|
|
|
|
chars, ok = charsV.ToString() |
|
|
|
|
|
|
|
if !ok { |
|
|
|
|
|
|
|
return nil, errNonStringTrimArg |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fromV, ferr := e.TrimFrom.evalNode(r) |
|
|
|
fromV, ferr := e.TrimFrom.evalNode(r) |
|
|
|
if ferr != nil { |
|
|
|
if ferr != nil { |
|
|
|
return nil, ferr |
|
|
|
return nil, ferr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
inferTypeAsString(fromV) |
|
|
|
from, ok := fromV.ToString() |
|
|
|
from, ok := fromV.ToString() |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
return nil, errNonStringTrimArg |
|
|
|
return nil, errNonStringTrimArg |
|
|
|