Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.36.0
Description
Test highlights the problem :
@Test void testTypeOfAs() { sql("select DECIMAL '100.01' as c1 from (values (true))") .columnType("DECIMAL(5, 2) NOT NULL"); sql("select DECIMAL '-100.01' as c1 from (values (true))") .columnType("DECIMAL(5, 2) NOT NULL"); }
Throws exception for second expression:
Expected: is "DECIMAL(5, 2) NOT NULL" but: was "DECIMAL(6, 2) NOT NULL"
Seems root cause in SqlLiteral#createExactNumeric precision derivation not consider negative numbers.
Attachments
Issue Links
- links to