[#7518] [#7902] Add parser support for negative numeric scales

This commit is contained in:
Lukas Eder 2018-09-26 13:22:36 +02:00
parent 8d85a7259a
commit 4832f1f084
2 changed files with 4 additions and 4 deletions

View File

@ -867,7 +867,7 @@ dataType =
| 'CHARACTER' [ '(' unsignedInteger ')' [ 'BYTE' | 'CHAR' ] ] [ 'COLLATE' collationName ]
| 'CLOB' [ '(' unsignedInteger ')' ] [ 'COLLATE' collationName ]
| 'DATE'
| 'DECIMAL' [ '(' ( '*' | unsignedInteger ) [ ',' unsignedInteger ] ')' ]
| 'DECIMAL' [ '(' ( '*' | unsignedInteger ) [ ',' signedInteger ] ')' ]
| 'DOUBLE' [ 'PRECISION' ] [ '(' unsignedInteger [ ',' unsignedInteger ] ')' ]
| 'ENUM' '(' stringLiteral [ ',' stringLiteral ] ')' [ 'COLLATE' collationName ]
| 'FLOAT' [ '(' unsignedInteger [ ',' unsignedInteger ] ')' ]
@ -883,8 +883,8 @@ dataType =
| 'MEDIUMTEXT' [ 'COLLATE' collationName ]
| 'NCHAR' [ '(' unsignedInteger ')' ] [ 'COLLATE' collationName ]
| 'NCLOB' [ 'COLLATE' collationName ]
| 'NUMBER' [ '(' ( '*' | unsignedInteger ) [ ',' unsignedInteger ] ')' ]
| 'NUMERIC' [ '(' ( '*' | unsignedInteger ) [ ',' unsignedInteger ] ')' ]
| 'NUMBER' [ '(' ( '*' | unsignedInteger ) [ ',' signedInteger ] ')' ]
| 'NUMERIC' [ '(' ( '*' | unsignedInteger ) [ ',' signedInteger ] ')' ]
| 'NVARCHAR' [ '(' unsignedInteger ')' ] [ 'COLLATE' collationName ]
| 'OTHER'
| 'REAL' [ '(' unsignedInteger [ ',' unsignedInteger ] ')' ]

View File

@ -7677,7 +7677,7 @@ final class ParserImpl implements Parser {
int precision = parseIf(ctx, '*') ? 38 : (int) (long) parseUnsignedInteger(ctx);
if (parseIf(ctx, ','))
result = result.precision(precision, (int) (long) parseUnsignedInteger(ctx));
result = result.precision(precision, (int) (long) parseSignedInteger(ctx));
else
result = result.precision(precision);