[MCOL-4553] Regression: CEIL incorrect for certain decimal numbers Created: 2021-02-22  Updated: 2021-06-28  Resolved: 2021-06-28

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 6.1.1
Fix Version/s: 6.1.1

Type: Bug Priority: Blocker
Reporter: David Hall (Inactive) Assignee: David Hall (Inactive)
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Problem/Incident
is caused by MCOL-641 Full DECIMAL support in ColumnStore Closed
Sprint: 2021-8, 2021-9

 Description   

The CEIL() function can return an incorrect result for certain inputs.
See working_tpch1/qa_fe_cnxFunctions/bug3334_ceil.sql

There are a number of queries in the test that report incorrect results, but one can exemplify the issue.
select 'ceil(d121/3)', id as id, d121/3, ceil(d121/3) as val from dtypes;

where d121 is defined as decimal(15,1).
Because of the expression inside the ceil function, the internal scale is shifted.
Inside getRoundedIntegralPart(), the scale handling appears to cause a 0 rather than a 1 to be emitted for d121 = .2



 Comments   
Comment by David Hall (Inactive) [ 2021-04-14 ]

There are times when floor() also is incorrect
c2 is decimal(18,2), c2 = -12345678901.00
select floor(c2) ...
-12345678902

Comment by Gagan Goel (Inactive) [ 2021-06-18 ]

David.Hall I am unable to reproduce these issues with CEIL and FLOOR functions on latest develop. Can you please check again if the issue still exists?

Comment by David Hall (Inactive) [ 2021-06-28 ]

MCOL-4618 and MCOL-4653 seem to have fixed this.

Generated at Thu Feb 08 02:51:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.