[MCOL-2057] truncate(x, d) function does not handle negative values for d for unsigned int types Created: 2019-01-02  Updated: 2023-03-06

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

Type: Bug Priority: Minor
Reporter: Gagan Goel (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When d < 0, truncate(x, d) function has no effect on unsigned int family data types (tinyint, smallint, int, bigint).

Here is an example:

MariaDB [mcs]> create table t1(a bigint unsigned)engine=columnstore;
Query OK, 0 rows affected (0.293 sec)
 
MariaDB [mcs]> insert into t1 value (18446744073709551613);
Query OK, 1 row affected (0.252 sec)
 
MariaDB [mcs]> select truncate(a, -19) from t1;
+----------------------+
| truncate(a, -19)     |
+----------------------+
| 18446744073709551613 |
+----------------------+
1 row in set (0.107 sec)



 Comments   
Comment by Gagan Goel (Inactive) [ 2019-01-02 ]

Fixed in PR-670.

Comment by Roman [ 2019-01-08 ]

Many thanks for your contribution. It is highly appreciated.

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