[MCOL-1196] Error when using OR in case THEN portion Created: 2018-02-02 Updated: 2018-03-29 Resolved: 2018-03-29 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MDB Plugin |
| Affects Version/s: | 1.1.2 |
| Fix Version/s: | 1.1.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2018-06, 2018-07 | ||||||||
| Description |
|
create database ct; innodb:
------
------ columnstore: |
| Comments |
| Comment by David Hall (Inactive) [ 2018-03-27 ] | ||||
|
The default in buildReturnedColumn() in the big switch for Item type is to throw this error. By putting in an empty case for COND_ITEM, we can remove the error. To make it actually work, we need to reverse the order of parameter processing for WHERE clause case_searched so that the gwi.ptWorkStack.pop() statements are popping the same objects we're working on in the same order. Some Item types may use the stack and the front to back ordering caused the stack to get all out of whack. We were processing the case arguments first to last, but popping the stack, which had the result of working last to first. They quickly became out of sync. On the execution side, LogicOperator::getBoolVal() wants the left and right side objects passed in. These were not passed in, so the base class's getBoolVal() was called. The objects are available in Func_searched_case, so they are now passed in if they exist. | ||||
| Comment by David Hall (Inactive) [ 2018-03-27 ] | ||||
|
The syncing of argument processing and the ptWorkStack has the happy side affect of fixing | ||||
| Comment by David Hall (Inactive) [ 2018-03-27 ] | ||||
|
Check | ||||
| Comment by Andrew Hutchings (Inactive) [ 2018-03-28 ] | ||||
|
Unfortunately the more complex version of | ||||
| Comment by Daniel Lee (Inactive) [ 2018-03-29 ] | ||||
|
Build verified: 1.1.4-1 source Reproduced the issue in 1.1.3-1 and verified fixed. Merge pull request #104 from mariadb-corporation/davidhilldallas-patch-3 update version [root@localhost mariadb-columnstore-engine]# git show Merge pull request #432 from mariadb-corporation/ Mcol 1196 [root@localhost ~]# mcsmysql mytest 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]> create table test_inno (astr VARCHAR(50))ENGINE = INNODB ; MariaDB [mytest]> create table test_mcs (astr VARCHAR(50))ENGINE = COLUMNSTORE ; MariaDB [mytest]> INSERT INTO test_inno (astr) value('test'); MariaDB [mytest]> INSERT INTO test_mcs (astr) value('test'); MariaDB [mytest]> SELECT astr FROM test_inno WHERE CASE WHEN 1 = 1 THEN (astr = 'test' OR astr = 'unknown') END;
------
------ MariaDB [mytest]> SELECT astr FROM test_mcs WHERE CASE WHEN 1 = 1 THEN (astr = 'test' OR astr = 'unknown') END;
------
------ MariaDB [mytest]> |