[MCOL-1669] Regression in working_tpch1/misc/bug3475.sql Created: 2018-08-22  Updated: 2018-10-11  Resolved: 2018-10-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: David Hall (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MCOL-521 add distributed regression aggregate ... Closed
Sprint: 2018-16, 2018-17, 2018-18

 Description   

select SUM('8.9') from datatypetestm t1, datatypetestm t2 where t1.cidx = t2.cidx and t1.cidx > 0;

It seems the quotes around '8.9' confuse something now. It should still treat it like a number and sum it, but we get NULL.

select SUM('a') from datatypetestm t1, datatypetestm t2 where t1.cidx = t2.cidx and t1.cidx > 0;

Summing a non-numerical. Used to return 0, now returns NULL.



 Comments   
Comment by David Hall (Inactive) [ 2018-08-23 ]

When a built-in aggregate is performed on a constant, the return type is deduced from the original item's mysql return type. In the case of SUM, that would be REAL, which we then interpret as double.

However, for multi-parm UDAF, we determine the return type from the init() of the function's code. During processing of the parms, there may be constants and variable parms inter-mixed, so we need to put them all in the parm array.

For built-in aggregates, constants don't go in the array. MCOL-521 needs to put all the parms in regardless of const-ness. This causes the special const code to be bypassed and the return type is set to the parm type, which when a string, causes a NULL to be output.

The fix is to put a const flag to determine this situation and call the special code.

Comment by Daniel Lee (Inactive) [ 2018-10-11 ]

Build verified: 1.2 source
/root/columnstore/mariadb-columnstore-server
commit 6b44f0d9c453ede53024f525b7ddf32b5323171b
Merge: 7db44a7 853a0f7
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Sep 27 20:37:03 2018 +0100
Merge pull request #134 from mariadb-corporation/versionCmakeFix
port changes for mysql_version cmake to fix columnstore RPM packaging
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 39c283281af045e5b5fb3fe3f399b21a6b1236ca
Merge: 46775f8 19c8a2b
Author: Roman Nozdrin <drrtuy@gmail.com>
Date: Wed Oct 10 20:11:12 2018 +0300
Merge pull request #588 from mariadb-corporation/MCOL-266
MCOL-266 Support true/false DDL default values

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 17576
Server version: 10.3.9-MariaDB-log Columnstore 1.2.0-1

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mytest]> select SUM('8.9') from datatypetestm t1, datatypetestm t2 where t1.cidx = t2.cidx and t1.cidx > 0;
------------

SUM('8.9')

------------

97.9

------------
1 row in set (0.069 sec)

MariaDB [mytest]> select SUM('a') from datatypetestm t1, datatypetestm t2 where t1.cidx = t2.cidx and t1.cidx > 0;
----------

SUM('a')

----------

0

----------
1 row in set (0.031 sec)

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