summaryrefslogtreecommitdiff
path: root/mysql-test/main/win.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/win.test')
-rw-r--r--mysql-test/main/win.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 56e7b4baf8c..d5fdd1e79f0 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2740,6 +2740,39 @@ SELECT 1 UNION SELECT a FROM t1 ORDER BY (row_number() over ());
DROP TABLE t1;
--echo #
+--echo # MDEV-19398: Assertion `item1->type() == Item::FIELD_ITEM &&
+--echo # item2->type() == Item::FIELD_ITEM' failed in compare_order_elements
+--echo #
+CREATE TABLE t1 ( id varchar(10));
+INSERT INTO t1 values (1),(2),(3);
+
+SELECT
+ dense_rank() over (ORDER BY avg(1)+3),
+ rank() over (ORDER BY avg(1))
+FROM t1
+GROUP BY nullif(id, 15532);
+
+SELECT
+ dense_rank() over (ORDER BY avg(1)),
+ rank() over (ORDER BY avg(1))
+FROM t1
+GROUP BY nullif(id, 15532);
+drop table t1;
+
+CREATE TABLE t1 ( a char(25), b text);
+INSERT INTO t1 VALUES ('foo','bar');
+
+SELECT
+ SUM(b) OVER (PARTITION BY a),
+ ROW_NUMBER() OVER (PARTITION BY b)
+FROM t1
+GROUP BY
+ LEFT((SYSDATE()), 'foo')
+WITH ROLLUP;
+drop table t1;
+
+--echo #
+--echo #
--echo # End of 10.2 tests
--echo #