Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.3.14
-
None
-
CentOS 7
Description
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
Window_funcs_computation::setup()
|
|
if (tab->filesort && tab->filesort->select)
|
{
|
sel= tab->filesort->select;
|
DBUG_ASSERT(!sel->quick);
|
}
|
To reproduce:
CREATE TABLE s3 ( |
k1 bigint NOT NULL, |
c1 int DEFAULT NULL, |
PRIMARY KEY (k1) |
);
|
|
SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 WHERE k1 < 100 ORDER BY k1; |
If you leave off the final ORDER BY k1 or the WHERE clause, no assert. If k1 is not a key, no assert.
Attachments
Issue Links
- is part of
-
MCOL-3307 Non-Columnstore Window function causes debug assert
-
- Closed
-
- relates to
-
MDEV-19364 Server crashes on certain window function usage
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code:c++| Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: {code:sql} CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; {code} If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
}When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code:c++| Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
Description |
}When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code:c++| Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
}When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
Description |
}When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
Description |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 where k1 < 100 order by k1; If you leave off the final ORDER BY, OR the WHERE, no assert. If k1 is not a key, no assert. |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 WHERE k1 < 100 ORDER BY k1; If you leave off the final ORDER BY k1 or the WHERE clause, no assert. If k1 is not a key, no assert. |
Assignee | Alice Sherepa [ alice ] |
Description |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 WHERE k1 < 100 ORDER BY k1; If you leave off the final ORDER BY k1 or the WHERE clause, no assert. If k1 is not a key, no assert. |
When using AVG as a Window function I get a debug assert at sql_window.cc:3054
{code} Window_funcs_computation::setup() if (tab->filesort && tab->filesort->select) { sel= tab->filesort->select; DBUG_ASSERT(!sel->quick); } {code} To reproduce: {code:sql} CREATE TABLE s3 ( k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1) ); SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 WHERE k1 < 100 ORDER BY k1; {code} If you leave off the final ORDER BY k1 or the WHERE clause, no assert. If k1 is not a key, no assert. |
Labels | need_feedback |
Labels | need_feedback |
Link |
This issue relates to |
Assignee | Alice Sherepa [ alice ] | Varun Gupta [ varun ] |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Not a Bug [ 6 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 95449 ] | MariaDB v4 [ 156082 ] |
I can not reproduce it, could you please add more information about how to repeat it (your .cnf file(s)).
MariaDB [test]> select version ();
+-----------------+
| version () |
+-----------------+
| 10.3.14-MariaDB |
+-----------------+
1 row in set (0.000 sec)
MariaDB [test]> CREATE TABLE s3 (k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1));
Query OK, 0 rows affected (0.032 sec)
MariaDB [test]> insert ignore into s3(k1) select floor(rand()*150)+90 from seq_1_to_100;
Query OK, 75 rows affected, 25 warnings (0.012 sec)
Records: 100 Duplicates: 25 Warnings: 25
MariaDB [test]> insert ignore into s3 select floor(rand()*150)+90,seq from seq_1_to_1000;
Query OK, 75 rows affected, 925 warnings (0.018 sec)
Records: 1000 Duplicates: 925 Warnings: 925
MariaDB [test]> SELECT k1,
-> c1,
-> avg(c1) OVER (ORDER BY c1)
-> FROM s3
-> WHERE k1 < 100
-> ORDER BY k1;
+----+------+----------------------------+
| k1 | c1 | avg(c1) OVER (ORDER BY c1) |
+----+------+----------------------------+
| 90 | 154 | 107.0000 |
| 91 | NULL | NULL |
| 92 | 27 | 27.0000 |
| 93 | 140 | 83.5000 |
| 94 | NULL | NULL |
| 95 | NULL | NULL |
| 96 | NULL | NULL |
| 97 | NULL | NULL |
| 98 | NULL | NULL |
| 99 | NULL | NULL |
+----+------+----------------------------+
10 rows in set (0.001 sec)
MariaDB [test]> CREATE or replace TABLE s3 (k1 bigint NOT NULL, c1 int DEFAULT NULL, PRIMARY KEY (k1));
Query OK, 0 rows affected (0.065 sec)
MariaDB [test]> SELECT k1,
-> c1,
-> avg(c1) OVER (ORDER BY c1)
-> FROM s3
-> WHERE k1 < 100
-> ORDER BY k1;
Empty set (0.001 sec)