[MCOL-799] INSERT...SELECT with window functions fail Created: 2017-07-03  Updated: 2020-08-25  Resolved: 2017-09-13

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.0.9
Fix Version/s: 1.1.0

Type: Bug Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: David Thompson (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2017-15, 2017-16, 2017-17

 Description   

If you do an INSERT...SELECT in 1.0 with a window function in the select it will fail with:

ERROR 1815 (HY000): Internal error: IDB-9029: Window function are only supported for Columnstore tables.

It appears that item_window_function.cc checks for THD::INFINIDB_CREATE_VTABLE and fails if we aren't in that state. We aren't in that state for INSERT...SELECT.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-07-03 ]

It is unlikely 1.1 is affected.

Comment by David Thompson (Inactive) [ 2017-07-31 ]

Will validate 1.1 behavior.

Comment by David Thompson (Inactive) [ 2017-09-07 ]

Verified this use case works:

CREATE TABLE `i1` (
  `i` int(11) DEFAULT NULL,
  `c` varchar(30) DEFAULT NULL
) ENGINE=InnoDB;
 
 CREATE TABLE `t1` (
  `i` int(11) DEFAULT NULL,
  `c` varchar(30) DEFAULT NULL,
  `max_c` varchar(30) DEFAULT NULL
) ENGINE=Columnstore ;
 
insert into i1 values (1, 'abc'), (2, 'def'), (3, 'aaa');
 
insert into t1 select i, c, min(c) over (order by i rows between unbounded preceding and current row) from i1;

Generated at Thu Feb 08 02:23:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.