[MCOL-3434] Certain window function queries crash mysqld Created: 2019-08-15 Updated: 2020-04-10 Resolved: 2019-12-10 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MariaDB Server |
| Affects Version/s: | 1.2.5 |
| Fix Version/s: | 1.2.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2019-06 | ||||||||
| Description |
|
In sql_select.cc optimize_stage2() line 2433, Columnstore has added:
Removing this allows the query to run against InnoDB correcty. Investigating other things. |
| Comments |
| Comment by David Hall (Inactive) [ 2019-08-15 ] | ||
|
MariaDB [test]> CREATE TABLE `t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cid` int(11) DEFAULT NULL, `d` datetime DEFAULT NULL, `c` decimal(12,4) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; Query OK, 0 rows affected (0,243 sec) MariaDB [test]> insert into t(cid, d, c) values (1, '2018-01-01', 20000.05); Query OK, 1 row affected (0,056 sec) MariaDB [test]> insert into t(cid, d, c) select round(rand()*100), date_sub(now(), interval rand()*100 week), round(rand()*100000,2) from t; Query OK, 1 row affected (0,051 sec) Records: 1 Duplicates: 0 Warnings: 0 MariaDB [test]> insert into t(cid, d, c) select round(rand()*100), date_sub(now(), interval rand()*100 week), round(rand()*100000,2) from t; Query OK, 2 rows affected (0,040 sec) Records: 2 Duplicates: 0 Warnings: 0 ... \MariaDB [test]> insert into t(cid, d, c) select round(rand()*100), date_sub(now(), interval rand()*100 week), round(rand()*100000,2) from t; Query OK, 32768 rows affected (0,794 sec) Records: 32768 Duplicates: 0 Warnings: 0 MariaDB [test]> insert into t(cid, d, c) select round(rand()*100), date_sub(now(), interval rand()*100 week), round(rand()*100000,2) from t; Query OK, 65536 rows affected (1,400 sec) Records: 65536 Duplicates: 0 Warnings: 0 MariaDB [test]> select count ----------
----------
---------- 1 row in set (0,070 sec) MariaDB [test]> select distinct cid, week(d) as week, max(c) over (partition by cid, week(d)) as c_mx, sum(c) over (partition by cid, week(d)) as c_sum, count(c) over (partition by cid, week(d)) as c_cnt, max(week(d)) over (partition by year(d)) as w_max from t where year(d) = '2018'; ERROR 2013 (HY000): Lost connection to MySQL server during query | ||
| Comment by David Hall (Inactive) [ 2019-08-15 ] | ||
|
From the support case, use the following to create a file to load data infile: | ||
| Comment by David Hall (Inactive) [ 2019-08-16 ] | ||
|
Removing the noted lines breaks other queries. Houston, we have a problem. Specifically, working_tpch1_compareLogOnly/misc/ I found where we can ignore sorting Window function parameters for Columnstore runs. We handle it ourselves. | ||
| Comment by David Hall (Inactive) [ 2019-08-26 ] | ||
|
Note: Putting the 131072 rows in as described in the original MCOL can take 10 minutes to run on InnoDB. Using fewer rows will still trigger the fault pre-patch. | ||
| Comment by David Hall (Inactive) [ 2019-08-26 ] | ||
|
Be sure to merge Server PR #164 and regression test PR #130 | ||
| Comment by David Hill (Inactive) [ 2019-09-24 ] | ||
|
Question from a customer.. Any chance that the fix for this issue will also fix | ||
| Comment by Daniel Lee (Inactive) [ 2019-12-10 ] | ||
|
Build verified: 1.2.6-1 engine commit: Reproduced the issue in 1.2.5-1 MariaDB [mytest]> select distinct cid, week(d) as week, max(c) over (partition by cid, week(d)) as c_mx, sum(c) over (partition by cid, week(d)) as c_sum, count(c) over (partition by cid, week(d)) as c_cnt, max(week(d)) over (partition by year(d)) as w_max from t where year(d) = '2018'; Dec 10 15:12:56 localhost ProcessMonitor[13354]: 56.044173 |0|0|0| D 18 CAL0000: statusControl: Set Process pm1/mysqld State = ACTIVE PID = 13922 Verified that the test case is working correctly in 1.2.6-1 |