[MCOL-4423] idbExtentMax()/MODA() support for long decimal Created: 2020-11-30  Updated: 2022-08-15  Resolved: 2022-08-15

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

Type: Bug Priority: Major
Reporter: Bharath Bokka (Inactive) Assignee: Andrey Piskunov (Inactive)
Resolution: Fixed Votes: 2
Labels: beginner-friendly

Issue Links:
PartOf
is part of MCOL-5092 group by (moda) on FLOAT result in In... Closed
Sprint: 2021-17

 Description   

Artifacts: https://cspkg.s3.amazonaws.com/index.html?prefix=develop/pull_request/1191/centos7/

Repro:

CREATE TABLE t1(col1 INT) ENGINE=Columnstore;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 SELECT * FROM t1;
SELECT idbExtentMax(col1) FROM t1 LIMIT 1;
ERROR 1815 (HY000): Internal error: Error while fetching from ExeMgr: IDB-2035: An internal error occurred.  Check the error log file & contact support.

This is a regression.



 Comments   
Comment by Bharath Bokka (Inactive) [ 2020-11-30 ]

idbExtentMin() also gives similar error and is also regression-

DROP TABLE IF EXISTS t1;
CREATE TABLE t1(col1 INT) ENGINE=Columnstore;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 SELECT * FROM t1;
SELECT idbExtentMin(col1) FROM t1 LIMIT 1;
ERROR 1815 (HY000): Internal error: Error while fetching from ExeMgr: IDB-2035: An internal error occurred.  Check the error log file & contact support.

Comment by Andrey Piskunov (Inactive) [ 2022-06-14 ]

According to documentation for UDFs , when registering UDFs the RETURNS clause indicates the type of the function's return value, and can be one of STRING, INTEGER, REAL or DECIMAL. DECIMAL functions currently return string values and should be written like STRING functions.
The problem with this function is that it may or may not return DECIMAL. So changing returning type to DECIMAL breaks decimals, while leaving it as it is breaks other int types, since it tries to read them as strings.

Comment by Daniel Lee (Inactive) [ 2022-08-15 ]

Build verified: 22.08-1 (#5290)

Reproduced the issue in 6.4.2-1
Verified the fix in 22.08-1
 
MariaDB [mytest]> SELECT idbExtentMin(col1) FROM t1 LIMIT 1;
+--------------------+
| idbExtentMin(col1) |
+--------------------+
| 1                  |
+--------------------+
1 row in set (0.007 sec)

Also executed MTR test suites

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