summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-08-15 15:37:10 -0700
committerIgor Babaev <igor@askmonty.org>2017-08-15 16:20:48 -0700
commita28152aafcab34800652a8be014e7c6d6ddf7da4 (patch)
tree0dc1991b9d894261716bfb7aaa1920d356664fa1 /mysql-test/r/sp.result
parentc354cb66b0fdb2050ab2139ed86f221a1570060f (diff)
downloadmariadb-git-a28152aafcab34800652a8be014e7c6d6ddf7da4.tar.gz
Fixed the bug mdev-13346.
The bug was caused by a defect of the patch for the bug 11081. The patch was actually a port of the fix this bug from the mysql code line. Later a correction of this fix was added to the mysql code. Here's the comment this correction was provided with: Bug#16499751: Opening cursor on SELECT in stored procedure causes segfault This is a regression from the fix of bug#14740889. The fix started using another set of expressions as the source for the temporary table used for the materialized cursor. However, JOIN::make_tmp_tables_info() calls setup_copy_fields() which creates an Item_copy wrapper object on top of the function being selected. The Item_copy objects were not properly handled by create_tmp_table - they were simply ignored. This patch creates temporary table fields based on the underlying item of the Item_copy objects. The test case for the bug 13346 was taken from mdev-13380.
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 47adafa93ba..08d69e102b4 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -8127,3 +8127,20 @@ v_name v_total
c 1
DROP PROCEDURE p1;
DROP TABLE t1;
+#
+# MDEV-13346: CURSOR a query with GROUP BY using derived table
+#
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE c CURSOR FOR
+SELECT
+IFNULL(NULL,1) AS col
+FROM
+( select 1 as id ) AS t
+GROUP BY t.id
+;
+OPEN c;
+END
+|
+CALL p1();
+DROP PROCEDURE p1;