[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: |
|
||||||||
| 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. 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 Welcome to the MariaDB monitor. Commands end with ; or \g. 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;
------------
------------ MariaDB [mytest]> select SUM('a') from datatypetestm t1, datatypetestm t2 where t1.cidx = t2.cidx and t1.cidx > 0;
----------
---------- |