[MCOL-301] aggregation over boolean expression fails with error 1178 Created: 2016-09-16 Updated: 2017-03-31 Resolved: 2017-01-16 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.0.2 |
| Fix Version/s: | 1.0.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Thompson (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 2016-24, 2016-25, 2017-01 |
| Description |
|
Pierre-Adrien Coustillas reported on google group: MariaDB [mcs]> SELECT sum((valeur=1) * (1=1) ) FROM histo__agregats LIMIT 2; A workaround is:
--------------------------------
-------------------------------- Can reproduce the behavior. |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2016-12-16 ] | ||||||
|
This Jira is actually two bugs, the first is handing of SUM() with a constant inside the second is the handling of an arithmetic on functions inside an aggregate. There is a commit for each in my pull request. Suggested test:
Before the fix the first query will return '6' and the second query will error. | ||||||
| Comment by Daniel Lee (Inactive) [ 2017-01-16 ] | ||||||
|
Build verified: Github source [root@localhost mariadb-columnstore-server]# git show Merge pull request #26 from mariadb-corporation/ Update README.md MariaDB [mytest]> create table t1 (a int) engine=columnstore; MariaDB [mytest]> insert into t1 values (1),(1),(2),(2),(3),(3); MariaDB [mytest]> select sum(1) from t1;
--------
-------- MariaDB [mytest]> select sum((a=1)*(1=1)) from t1;
------------------
------------------ MariaDB [mytest]> select sum((a=1)*(1=1)) from t1 limit 2;
------------------
------------------ MariaDB [mytest]> |