[MCOL-3448] Wrong results for (col1, col2) in (val1, val2) queries Created: 2019-08-22 Updated: 2021-04-19 Resolved: 2019-11-18 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr, MDB Plugin |
| Affects Version/s: | 1.2.5, 1.4.1 |
| Fix Version/s: | 1.2.6, 1.4.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Valerii Kravchuk | Assignee: | Bharath Bokka (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2019-06 | ||||||||
| Description |
|
Consider the following simple table:
The query returns expected results. Now, consider this semantically equivalent (supposedly) query that compares tuples:
As you can see removing ORDER BY or changing infinidb_vtable_mode does not help. For InnoDB table with the same data we get correct, expected result:
|
| Comments |
| Comment by David Hall (Inactive) [ 2019-11-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
The error appears to be associated with the OR in combination with a row-based IN. A row based IN by itself works:
---------
--------- OR with either of the columns from the ROW based IN works as well:
---------
--------- MariaDB [dhall]> SELECT * FROM dim_date WHERE (SEMAINE) IN ('2019-S08','2019-S08') OR SEMAINE IN ('2019-S07');
---------
--------- But combine OR with ROW based IN and we get a wrong answer:
---------
--------- | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Hall (Inactive) [ 2019-11-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
The problem turns out that the wrong datatype was being grabbed for one of the resulting PredicateOperators. The reason it doesn't break when there is no OR is that, in that case, the particular predicate in question is optimized into a join, which follows a different path. Corrected the datatype. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Hall (Inactive) [ 2019-11-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
regression test #159 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2019-11-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Plz see the comments on github. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bharath Bokka (Inactive) [ 2019-11-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build tested- The query which failed in the description works fine on the above build. MariaDB [test]> SELECT * FROM dim_date WHERE SEMAINE IN ('2019-S07') OR (SEMAINE,DATE_JOUR) IN ( ('2019-S08','2019-02-18'), ('2019-S08','2019-02-19') );
---------
--------- Also tested on, This issue isn't fixed on the latest 1.4.1. I think we should reopen, please suggest. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2019-11-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
That's true. The fix was pushed into 1.2 and will be upmerged into 1.4 before we give 1.4.2 to QA. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2019-11-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verfied: 1.4.1-1 github source Server Engine |