[MCOL-964] tpcds query78 alternately fails and works with incorrect results Created: 2017-10-09 Updated: 2018-02-02 Resolved: 2018-02-02 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MariaDB Server |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | 1.1.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Thompson (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Sprint: | 2017-21, 2017-25, 2018-01, 2018-02, 2018-03 | ||||||||||||||||
| Description |
|
The following query utilizing CTE's will alternately fail and then work and so on:
with the following error: |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-10-30 ] |
|
This jira will cover a complete fix for this and should also work for the additional queries in |
| Comment by David Hall (Inactive) [ 2017-10-30 ] |
|
There's a problem with math in the order by clause. removing Tests will be done to see if math on aggregates is the problem, or if any math causes issues. |
| Comment by David Hall (Inactive) [ 2018-01-15 ] |
|
The query in question now results in the following error: Running in mode 0 results in the correct result, but execution time is unacceptable (hours). |
| Comment by David Hall (Inactive) [ 2018-01-17 ] |
|
A simpler query that demonstrates the problem: with ss as select This even simpler query asserts mysqld in debug (see MDEV-14981) with ss as select |
| Comment by David Hall (Inactive) [ 2018-01-17 ] |
|
The logic say that if an order by column isn't already in the select – round(ss_qty,2) is not already selected – then add it to the select as a hidden column and re-run the query. Something breaks when it's a cte. |
| Comment by David Hall (Inactive) [ 2018-01-30 ] |
|
The bug is caused by a field in the order by that isn't in the select list. Columnstore attempts to re-write and re-run the query. During the rewrite, the CTE is converted to a derived table, which works fine. However, it attempts to prepend the names of the select fields with the database name. This is invalid for derived tables which have no database. the fields couldn't be found by the fully qualified name and it errored. By changing the place in server (Columnstore only code) where the name is written to not prepend with the database name, it works like a normal derived table. I have a small amount of trepidation that there is some use case for the database prepend other than for views, but I can't think of one. It passes the standard regression test. |
| Comment by Daniel Lee (Inactive) [ 2018-02-02 ] |
|
Reproduced the issue in 1.1.2-1 root@stretch:~# cat mariadb-columnstore-1.1.3-1-stretch.x86_64.bin.tar.txt Merge pull request #92 from mariadb-corporation/ /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine Merge pull request #392 from mariadb-corporation/ Both the original query 78, and Mr. Hall's simpler query returned the following error. ERROR 1815 (HY000): Internal error: Query cannot be processed using operational mode 1 (vtable mode) The original error was reported in 1.1.0 and the above was put in in 1.1.2-1 Both queries returned result in 1.1.3-1 |