[MCOL-4618] FLOOR(-9999.0) returns a bad result Created: 2021-03-17  Updated: 2021-04-01  Resolved: 2021-04-01

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

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Gagan Goel (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MCOL-4361 Replace pow(10.0, (double)scale) expr... Closed
Relates
relates to MCOL-4653 CEIL(negativeNarrowDecimal) inside an... Closed

 Description   

DROP TABLE IF EXISTS cs1;
CREATE TABLE cs1 (d6 DECIMAL(18,1))ENGINE=ColumnStore;
INSERT INTO cs1 VALUES (-9999.0);
SELECT  d6, FLOOR(d6) FROM cs1;

+---------+-----------+
| d6      | FLOOR(d6) |
+---------+-----------+
| -9999.0 |    -10000 |
+---------+-----------+

Looks wrong. The expected result is:

DROP TABLE IF EXISTS cs1;
CREATE TABLE cs1 (d6 DECIMAL(18,1))ENGINE=InnoDB;
INSERT INTO cs1 VALUES (-9999.0);
SELECT  d6, FLOOR(d6) FROM cs1;

+---------+-----------+
| d6      | FLOOR(d6) |
+---------+-----------+
| -9999.0 |     -9999 |
+---------+-----------+


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