[MDEV-10500] CASE/IF Statement returns multiple values and shifts further result values to the next column Created: 2016-08-05 Updated: 2016-08-08 Resolved: 2016-08-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5.50, 10.0.19, 10.0.22 |
| Fix Version/s: | 5.5.51, 10.1.17, 10.0.27, 10.2.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Dmitri Malinovski | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | innodb, tokudb | ||
| Issue Links: |
|
||||||||
| Description |
|
Statement returns wrong result values using the control flow functions IF()/CASE combined with SUM() function, when the result of SUM() function is NULL. As a result all further values are shifted to the next column.
I have tested on MariaDB versions "5.5.5-10.0.19-MariaDB-log", "5.5.5-10.0.22-MariaDB-log" using TokuDb and InnoDB and it happens to both. |
| Comments |
| Comment by Sergei Golubchik [ 2016-08-05 ] | ||
|
Thanks for the perfect test case! In debug builds of 5.5 it fails an assert:
| ||
| Comment by Elena Stepanova [ 2016-08-05 ] | ||
|
See also | ||
| Comment by Sergei Golubchik [ 2016-08-08 ] | ||
|
ok to push |