diff options
author | Igor Babaev <igor@askmonty.org> | 2017-01-04 14:33:24 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-01-04 14:33:24 -0800 |
commit | 348ccb6f038a6c108ab9b6a01bdc356cefecd3d4 (patch) | |
tree | e3da558cc87c4943ccf64ee6d4b537e58c0eb4b4 /mysql-test/r/cte_recursive.result | |
parent | a758479c103f513077a0b90a9285b17229ee8289 (diff) | |
download | mariadb-git-348ccb6f038a6c108ab9b6a01bdc356cefecd3d4.tar.gz |
Fixed bug mdev-11674.
1. The rows of a recursive CTE at some point may overflow
the HEAP temporary table containing them. At this point
the table is converted to a MyISAM temporary table and the
new added rows are placed into this MyISAM table.
A bug in the of select_union_recursive::send_data prevented
the server from writing the row that caused the overflow
into the temporary table used for the result of the iteration
steps. This could lead, in particular,to a premature end
of the iterations.
2. The method TABLE::insert_all_rows_into() that was used
to copy all rows of one temporary table into another
did not take into account that the destination temporary
table must be converted to a MyISAM table at some point.
This patch fixed this problem. It also renamed the method
into TABLE::insert_all_rows_into_tmp_table() and added
an extra parameter needed for the conversion.
Diffstat (limited to 'mysql-test/r/cte_recursive.result')
-rw-r--r-- | mysql-test/r/cte_recursive.result | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 0cc88d27e23..d5476aec1c4 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -2327,3 +2327,19 @@ a b dist 7 6 3 DROP VIEW edges2; DROP TABLE edges; +# +# MDEV-11674: recursive CTE table that cannot be stored +# in a heap table +# +create table t1 (id int, test_data varchar(36)); +insert into t1(id, test_data) +select id, test_data +from ( +with recursive data_generator(id, test_data) as ( +select 1 as id, uuid() as test_data +union all +select id + 1, uuid() from data_generator where id < 150000 +) +select * from data_generator +) as a; +drop table t1; |