[Commits] aff4dbc: Changed the test case for MDEV-15571
revision-id: aff4dbce5d1e68376798b28e74b48133bb948ea3 (mariadb-10.2.14-61-gaff4dbc) parent(s): 619dc2b24f26aea29345dc3f3289bed406738025 author: Igor Babaev committer: Igor Babaev timestamp: 2018-04-24 12:33:56 -0700 message: Changed the test case for MDEV-15571 It has been done to demonstrate that the fix of this bug is good for 10.3 as well. The previous test case is not good for this purpose because 10.2 and 10.3 use different rules for determining the types of recursive CTEs. --- mysql-test/r/cte_recursive.result | 5 ++++- mysql-test/t/cte_recursive.test | 7 ++++++- sql/sql_select.cc | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 6b2db35..70752c7 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -3083,16 +3083,19 @@ set big_tables=default; # # MDEV-15571: using recursive cte with big_tables enabled # +create table t1 (a bigint); +insert into t1 values(1); set big_tables=1; with recursive qn as ( -select 1 as a from dual +select a from t1 union all select a*2000 from qn where a<10000000000000000000 ) select * from qn; ERROR 22003: BIGINT value is out of range in '`qn`.`a` * 2000' set big_tables=default; +drop table t1; # # MDEV-15556: using recursive cte with big_tables enabled # when recursive tables are accessed by key diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index 50cb39a..332a64b 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -2114,12 +2114,15 @@ set big_tables=default; --echo # MDEV-15571: using recursive cte with big_tables enabled --echo # +create table t1 (a bigint); +insert into t1 values(1); + set big_tables=1; --error ER_DATA_OUT_OF_RANGE with recursive qn as ( - select 1 as a from dual + select a from t1 union all select a*2000 from qn where a<10000000000000000000 ) @@ -2127,6 +2130,8 @@ select * from qn; set big_tables=default; +drop table t1; + --echo # --echo # MDEV-15556: using recursive cte with big_tables enabled --echo # when recursive tables are accessed by key diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6450eb0..db97596 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1304,6 +1304,8 @@ JOIN::optimize_inner() /* Convert all outer joins to inner joins if possible */ conds= simplify_joins(this, join_list, conds, TRUE, FALSE); + if (thd->is_error()) + DBUG_RETURN(1); if (select_lex->save_leaf_tables(thd)) DBUG_RETURN(1); build_bitmap_for_nested_joins(join_list, 0);
participants (1)
-
IgorBabaev