summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived_view.test
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-04-19 09:16:30 +0300
committerunknown <sanja@montyprogram.com>2012-04-19 09:16:30 +0300
commit9997b78ae48a518e65b7c96c947e868419c679ca (patch)
tree565ba57250224847b3b806391150a48f3a67f654 /mysql-test/t/derived_view.test
parentb9bbe4a18ba8569cd1cedd391725e4ee214d9be7 (diff)
downloadmariadb-git-9997b78ae48a518e65b7c96c947e868419c679ca.tar.gz
LP BUG#978847 fixed.
Fixed incorrect type casting which made all fields (except very first) changes to materialized table incorrect. Saved list of view/derived table used items after expanding '*'.
Diffstat (limited to 'mysql-test/t/derived_view.test')
-rw-r--r--mysql-test/t/derived_view.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test
index 03d308b6c45..3320ca25136 100644
--- a/mysql-test/t/derived_view.test
+++ b/mysql-test/t/derived_view.test
@@ -1414,6 +1414,30 @@ drop table t1,t2;
set optimizer_switch=@save968720_optimizer_switch;
--echo #
+--echo # LP BUG#978847 Server crashes in Item_ref::real_item on
+--echo # INSERT .. SELECT with FROM subquery and derived_merge=ON
+SET @save978847_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on';
+
+CREATE TABLE t1 ( a INT, b INT );
+INSERT INTO t1 VALUES (2,1),(3,2);
+
+select * from t1;
+INSERT INTO t1 SELECT * FROM
+ ( SELECT * FROM t1 ) AS alias;
+select * from t1;
+prepare stmt1 from 'INSERT INTO t1 SELECT SQL_BIG_RESULT * FROM
+ ( SELECT * FROM t1 ) AS alias';
+execute stmt1;
+select * from t1;
+execute stmt1;
+select * from t1;
+
+drop table t1;
+
+set optimizer_switch=@save978847_optimizer_switch;
+
+--echo #
--echo # end of 5.3 tests
--echo #