Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mysql-test/main/gis.result
Original file line number Diff line number Diff line change
Expand Up @@ -5622,3 +5622,13 @@ t
#
# End of 11.6 tests
#
#
# Start of 12.2 tests
#
#
# MDEV-38099: Assertion failed in st_select_lex::optimize_unflattened_subqueries
#
SELECT (WITH cte AS (SELECT st_astext(ST_GeomFromText('POLYGON((1 1,2 2,1 1))'))) SELECT * FROM cte);
(WITH cte AS (SELECT st_astext(ST_GeomFromText('POLYGON((1 1,2 2,1 1))'))) SELECT * FROM cte)
POLYGON((1 1,2 2,1 1))
# End of 12.2 tests
11 changes: 11 additions & 0 deletions mysql-test/main/gis.test
Original file line number Diff line number Diff line change
Expand Up @@ -3623,3 +3623,14 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (15 15
--echo #
--echo # End of 11.6 tests
--echo #

--echo #
--echo # Start of 12.2 tests
--echo #

--echo #
--echo # MDEV-38099: Assertion failed in st_select_lex::optimize_unflattened_subqueries
--echo #
SELECT (WITH cte AS (SELECT st_astext(ST_GeomFromText('POLYGON((1 1,2 2,1 1))'))) SELECT * FROM cte);

--echo # End of 12.2 tests
2 changes: 2 additions & 0 deletions sql/sql_lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11130,6 +11130,8 @@ void st_select_lex::register_unit(SELECT_LEX_UNIT *unit,
slave= unit;
unit->master= this;
uncacheable|= unit->uncacheable;
if (master && (unit->uncacheable & UNCACHEABLE_RAND))
master->uncacheable|= UNCACHEABLE_RAND;

for(SELECT_LEX *sel= unit->first_select();sel; sel= sel->next_select())
{
Expand Down