[Commits] 6128507: MDEV-15571 Wrong results with big_tables=1 and CTE

IgorBabaev igor at mariadb.com
Mon Apr 16 18:55:15 EEST 2018


revision-id: 612850782d6d8bbe44d2b153a045b9a8afc624ef (mariadb-10.2.14-50-g6128507)
parent(s): 224f7af911487f25cc2f768b66a1cce1b3833fd0
author: Igor Babaev
committer: Igor Babaev
timestamp: 2018-04-16 08:55:15 -0700
message:

MDEV-15571 Wrong results with big_tables=1 and CTE

The cause of this bug was the same as for the bug mdev-15575.
Fixed by the patch for the latter.

---
 mysql-test/r/cte_recursive.result | 13 +++++++++++++
 mysql-test/t/cte_recursive.test   | 17 +++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result
index 55cd30f..01443bb 100644
--- a/mysql-test/r/cte_recursive.result
+++ b/mysql-test/r/cte_recursive.result
@@ -3080,3 +3080,16 @@ a
 129
 130
 set big_tables=default;
+#
+# MDEV-1571: Setting user variable in recursive CTE
+#
+set big_tables=1;
+with recursive qn as
+(
+select 1 as a from dual
+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;
diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test
index 373d6ca..008c8ea 100644
--- a/mysql-test/t/cte_recursive.test
+++ b/mysql-test/t/cte_recursive.test
@@ -2109,3 +2109,20 @@ with recursive qn as
 select * from qn;
 
 set big_tables=default;
+
+--echo #
+--echo # MDEV-1571: Setting user variable in recursive CTE
+--echo #
+
+set big_tables=1;
+
+--error ER_DATA_OUT_OF_RANGE
+with recursive qn as
+(
+  select 1 as a from dual
+  union all
+  select a*2000 from qn where a<10000000000000000000
+)
+select * from qn;
+
+set big_tables=default;


More information about the commits mailing list