[#6485] Support SQL Server LEN() function

This commit is contained in:
lukaseder 2018-01-27 15:47:23 +01:00
parent 37f116a86e
commit 051cb2571d
2 changed files with 3 additions and 2 deletions

View File

@ -380,7 +380,7 @@ orderBy =
offsetFetch =
'OFFSET' unsignedInteger
[
[ 'ROW' | 'ROWS' ] 'FETCH' ( 'FIRST' | 'NEXT' ) unsignedInteger ( 'ROW' | 'ROWS' ) ( 'ONLY' | 'WITH TIES' )
[ 'ROW' | 'ROWS' ] 'FETCH' ( 'FIRST' | 'NEXT' ) [ unsignedInteger ] ( 'ROW' | 'ROWS' ) ( 'ONLY' | 'WITH TIES' )
| [ 'LIMIT' unsignedInteger [ 'WITH TIES' ] ]
]
| 'LIMIT' unsignedInteger
@ -568,6 +568,7 @@ term =
| 'LPAD' '(' field ',' field [ ',' field ] ')'
| 'LTRIM' '(' field ')'
| 'LEFT' '(' field ',' field ')'
| 'LEN' '(' field ')'
| 'LENGTH' '(' field ')'
| 'LN' '(' sum ')'
| 'LOG' '(' sum ',' unsignedInteger ')'

View File

@ -4585,7 +4585,7 @@ final class ParserImpl implements Parser {
}
private static final Field<?> parseFieldLengthIf(ParserContext ctx) {
if (parseFunctionNameIf(ctx, "LENGTH")) {
if (parseFunctionNameIf(ctx, "LENGTH") || parseFunctionNameIf(ctx, "LEN")) {
parse(ctx, '(');
Field<String> f1 = (Field) parseField(ctx, S);
parse(ctx, ')');