Skip to content

Commit

Permalink
MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery
Browse files Browse the repository at this point in the history
Add a testcase
  • Loading branch information
spetrunia committed Jul 21, 2017
1 parent 17fc288 commit e2afdb1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mysql-test/r/win.result
Original file line number Diff line number Diff line change
Expand Up @@ -3149,3 +3149,14 @@ ROW_NUMBER() OVER() i
SELECT ROW_NUMBER() OVER(), i FROM t1 WHERE 0;
ROW_NUMBER() OVER() i
DROP TABLE t1;
#
# MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery
# with window function and constant table
# (Testcase only)
#
CREATE TABLE t1 (c CHAR(8)) ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES ('foo');
SELECT ('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1);
('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1)
0
DROP TABLE t1;
9 changes: 9 additions & 0 deletions mysql-test/t/win.test
Original file line number Diff line number Diff line change
Expand Up @@ -1933,4 +1933,13 @@ SELECT DISTINCT ROW_NUMBER() OVER(), i FROM t1 WHERE 0;
SELECT ROW_NUMBER() OVER(), i FROM t1 WHERE 0;
DROP TABLE t1;

--echo #
--echo # MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery
--echo # with window function and constant table
--echo # (Testcase only)
--echo #
CREATE TABLE t1 (c CHAR(8)) ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES ('foo');
SELECT ('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1);
DROP TABLE t1;

0 comments on commit e2afdb1

Please sign in to comment.