Commit 5c7d8293 authored by Igor Babaev's avatar Igor Babaev

Another attempt to fix bug mdev-10736.

parent effb65bc
...@@ -1623,3 +1623,12 @@ n ...@@ -1623,3 +1623,12 @@ n
3 3
4 4
5 5
#
# MDEV-10736: recursive definition with anchor over a table with blob
#
CREATE TABLE t1 (f VARCHAR(1024));
WITH RECURSIVE cte(f) AS
(SELECT t1.f FROM t1 UNION ALL SELECT cte.f FROM cte)
SELECT * FROM cte as t;
f
DROP TABLE t1;
...@@ -1185,13 +1185,12 @@ WITH RECURSIVE cte(n) AS ...@@ -1185,13 +1185,12 @@ WITH RECURSIVE cte(n) AS
( SELECT n+1 FROM cte WHERE n < 5 UNION SELECT 1 UNION SELECT 1 ) ( SELECT n+1 FROM cte WHERE n < 5 UNION SELECT 1 UNION SELECT 1 )
SELECT * FROM cte; SELECT * FROM cte;
# --echo # --echo #
# --echo # MDEV-10736: recursive definition with anchor over a table with blob --echo # MDEV-10736: recursive definition with anchor over a table with blob
# --echo # --echo #
#
# CREATE TABLE t1 (f VARCHAR(1024)); CREATE TABLE t1 (f VARCHAR(1024));
# set statement max_recursive_iterations=1 for WITH RECURSIVE cte(f) AS
# WITH RECURSIVE cte(f) AS (SELECT t1.f FROM t1 UNION ALL SELECT cte.f FROM cte)
# (SELECT t1.f FROM t1 UNION ALL SELECT cte.f FROM cte) SELECT * FROM cte as t;
# SELECT * FROM cte; DROP TABLE t1;
# DROP TABLE t1;
...@@ -480,10 +480,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -480,10 +480,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
derived->set_materialized_derived(); derived->set_materialized_derived();
if (!derived->table || !derived->table->is_created()) if (!derived->table || !derived->table->is_created())
res= mysql_derived_create(thd, lex, derived); res= mysql_derived_create(thd, lex, derived);
#if 0
if (!res)
res= mysql_derived_fill(thd, lex, derived);
#endif
goto exit_merge; goto exit_merge;
} }
...@@ -920,7 +916,7 @@ bool mysql_derived_create(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -920,7 +916,7 @@ bool mysql_derived_create(THD *thd, LEX *lex, TABLE_LIST *derived)
if (table->is_created()) if (table->is_created())
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
select_union *result= (select_union*)unit->result; select_union *result= derived->derived_result;
if (table->s->db_type() == TMP_ENGINE_HTON) if (table->s->db_type() == TMP_ENGINE_HTON)
{ {
result->tmp_table_param.keyinfo= table->s->key_info; result->tmp_table_param.keyinfo= table->s->key_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment