diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index 5bf10e9310f..6f110d1d603 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -7535,7 +7535,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test index 9d992ec9021..5fafaad8754 100644 --- a/mysql-test/main/subselect.test +++ b/mysql-test/main/subselect.test @@ -6386,7 +6386,7 @@ let $q= WITH RECURSIVE x (x) AS ( (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; ---error ER_TRUNCATED_WRONG_VALUE +--error ER_NOT_STANDARD_COMPLIANT_RECURSIVE eval $q; DROP TABLE t1, x; diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index 6d95e6bfbe6..860cc252073 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -7535,7 +7535,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index 7e3238dfc9e..c4b306c6f06 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -7528,7 +7528,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 629115d5142..d286d7ed015 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -7526,7 +7526,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 182eb5d74e7..3975ccc5193 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -7541,7 +7541,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 89b3fbb981b..fab8ad0e2cc 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -7526,7 +7526,7 @@ FROM x WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) > (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC)) ORDER BY x ASC, x DESC, x; -ERROR 22007: Truncated incorrect DECIMAL value: 'x' +ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x' DROP TABLE t1, x; # # End of 10.4 tests diff --git a/sql/item_func.cc b/sql/item_func.cc index c9b249a4554..5202d395580 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1824,7 +1824,7 @@ void Item_func_neg::fix_length_and_dec_int() Use val() to get value as arg_type doesn't mean that item is Item_int or Item_float due to existence of Item_param. */ - if (args[0]->const_item()) + if (args[0]->const_item() && !args[0]->is_expensive()) { longlong val= args[0]->val_int(); if ((ulonglong) val >= (ulonglong) LONGLONG_MIN && diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 6250d71e4fc..3310ba55229 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -643,6 +643,8 @@ void With_element::check_dependencies_in_unit(st_select_lex_unit *unit, { check_dependencies_in_select(sl, &unit_ctxt_elem, in_subq, dep_map); } + if ((sl= unit->fake_select_lex)) + check_dependencies_in_select(sl, &unit_ctxt_elem, in_subq, dep_map); }