Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.11
-
None
Description
Execution of the prepared statement for the query
with cte as
|
(select a from t1 where a between 4 and 7 group by a)
|
(select a from cte where exists( select a from t1 where cte.a=t1.a ))
|
union
|
(select a from t1 where a < 2);
|
works fine while the execution this query that is equivalent to the first one
with cte as
|
(select a from t1 where a between 4 and 7 group by a)
|
(select a from t1 where a < 2)
|
union
|
(select a from cte where exists( select a from t1 where cte.a=t1.a ));
|
causes an assertion failure for debug builds and most probably crashes for release builds
MariaDB [test]> create table t1 (a int);
|
MariaDB [test]> insert into t1 values
|
-> (7), (2), (8), (1), (3), (2), (7), (5), (4), (7), (9), (8);
|
MariaDB [test]> prepare stmt from "
|
with cte as
|
(select a from t1 where a between 4 and 7 group by a)
|
(select a from cte where exists( select a from t1 where cte.a=t1.a ))
|
union
|
(select a from t1 where a < 2);
|
";
|
Statement prepared
|
MariaDB [test]> execute stmt;
|
+------+
|
| a |
|
+------+
|
| 7 |
|
| 5 |
|
| 4 |
|
| 1 |
|
+------+
|
MariaDB [test]> execute stmt;
|
+------+
|
| a |
|
+------+
|
| 7 |
|
| 5 |
|
| 4 |
|
| 1 |
|
+------+
|
MariaDB [test]> prepare stmt from "
|
"> with cte as
|
"> (select a from t1 where a between 4 and 7 group by a)
|
"> (select a from t1 where a < 2)
|
"> union
|
"> (select a from cte where exists( select a from t1 where cte.a=t1.a ))
|
"> ";
|
Statement prepared
|
MariaDB [test]> execute stmt;
|
 |
mysqld: /home/igor/maria-git/10.2/sql/sql_prepare.cc:2949: void reinit_stmt_before_use(THD*, LEX*): Assertion `sl->join == 0' failed.
|
Attachments
Issue Links
- relates to
-
MDEV-14777 Crash in MariaDB 10.2.12 on query using VIEW and WITH RECURSIVE
- Closed