[ 
https://issues.apache.org/jira/browse/CALCITE-7731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106986#comment-18106986
 ] 

Ruben Q L edited comment on CALCITE-7731 at 8/25/26 7:28 AM:
-------------------------------------------------------------

Done in 
[{{5eb36fb}}|https://github.com/apache/calcite/commit/5eb36fb1262582c44515bcb2a515469941cf879f],
 follw-up in 
[{{5e3326a}}|https://github.com/apache/calcite/commit/5e3326a0a8e7cec4c804f5e00c80b5510b61945d]


was (Author: rubenql):
Done in 
[{{5eb36fb}}|https://github.com/apache/calcite/commit/5eb36fb1262582c44515bcb2a515469941cf879f]

> Bound plain-notation expansion of DECIMAL literals to prevent parse-time 
> OutOfMemoryError
> -----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7731
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7731
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
> BigDecimal accepts any int exponent, so a DECIMAL literal such as {{DECIMAL 
> '1E2147483647'}} (~30 characters) parses to a BigDecimal whose plain-notation 
> form would be one character per digit: a multi-gigabyte allocation 
> (potentially an OOM error).
> Three places call BigDecimal.toPlainString() on a value derived from 
> user-supplied input and would attempt that allocation:
> - SqlParserUtil.parseDecimalLiteral
> - SqlNumericLiteral.toValue
> - RexBuilder.makeLiteral
> It would be required to add a check in there to prevent an OOM error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to