[Commits] Rev 4424: MDEV-7565: Server crash with Signal 6 (part 2) in file:///home/bell/maria/bzr/work-maria-MDEV-7445/

sanja at askmonty.org sanja at askmonty.org
Mon Feb 9 17:56:10 EET 2015


At file:///home/bell/maria/bzr/work-maria-MDEV-7445/

------------------------------------------------------------
revno: 4424
revision-id: sanja at askmonty.org-20150209155545-pipqd4cw5tn0mkjp
parent: elenst at montyprogram.com-20150208124700-871uamawu1oi9iu4
committer: sanja at askmonty.org
branch nick: work-maria-MDEV-7445
timestamp: Mon 2015-02-09 16:55:45 +0100
message:
  MDEV-7565: Server crash with Signal 6 (part 2)
  
  Preparation of subselect muved earlier (before checks which needs it prepared).
-------------- next part --------------
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2014-04-15 10:20:26 +0000
+++ b/mysql-test/r/subselect.result	2015-02-09 15:55:45 +0000
@@ -7015,3 +7015,15 @@ select exists(select 1 from t1 group by
 exists(select 1 from t1 group by `c` in (select `c` from t1))
 0
 drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select 
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL

=== modified file 'mysql-test/r/subselect_no_mat.result'
--- a/mysql-test/r/subselect_no_mat.result	2014-04-15 10:20:26 +0000
+++ b/mysql-test/r/subselect_no_mat.result	2015-02-09 15:55:45 +0000
@@ -7012,6 +7012,18 @@ select exists(select 1 from t1 group by
 exists(select 1 from t1 group by `c` in (select `c` from t1))
 0
 drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select 
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
 set optimizer_switch=default;
 select @@optimizer_switch like '%materialization=on%';
 @@optimizer_switch like '%materialization=on%'

=== modified file 'mysql-test/r/subselect_no_opts.result'
--- a/mysql-test/r/subselect_no_opts.result	2014-04-15 10:20:26 +0000
+++ b/mysql-test/r/subselect_no_opts.result	2015-02-09 15:55:45 +0000
@@ -7010,4 +7010,16 @@ select exists(select 1 from t1 group by
 exists(select 1 from t1 group by `c` in (select `c` from t1))
 0
 drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select 
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
 set @optimizer_switch_for_subselect_test=null;

=== modified file 'mysql-test/r/subselect_no_scache.result'
--- a/mysql-test/r/subselect_no_scache.result	2014-04-15 10:20:26 +0000
+++ b/mysql-test/r/subselect_no_scache.result	2015-02-09 15:55:45 +0000
@@ -7021,6 +7021,18 @@ select exists(select 1 from t1 group by
 exists(select 1 from t1 group by `c` in (select `c` from t1))
 0
 drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select 
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
 set optimizer_switch=default;
 select @@optimizer_switch like '%subquery_cache=on%';
 @@optimizer_switch like '%subquery_cache=on%'

=== modified file 'mysql-test/r/subselect_no_semijoin.result'
--- a/mysql-test/r/subselect_no_semijoin.result	2014-04-15 10:20:26 +0000
+++ b/mysql-test/r/subselect_no_semijoin.result	2015-02-09 15:55:45 +0000
@@ -7010,5 +7010,17 @@ select exists(select 1 from t1 group by
 exists(select 1 from t1 group by `c` in (select `c` from t1))
 0
 drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select 
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
 set @optimizer_switch_for_subselect_test=null;
 set @join_cache_level_for_subselect_test=NULL;

=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test	2014-04-15 10:20:26 +0000
+++ b/mysql-test/t/subselect.test	2015-02-09 15:55:45 +0000
@@ -5890,3 +5890,15 @@ DROP TABLE t1,t2;
 create table t1 (c int);
 select exists(select 1 from t1 group by `c` in (select `c` from t1));
 drop table t1;
+
+--echo #
+--echo # MDEV-7565: Server crash with Signal 6 (part 2)
+--echo #
+Select 
+  (Select Sum(`TestCase`.Revenue) From mysql.slow_log E           
+    Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+  ) As `ControlRev`
+From 
+(Select  3 as Revenue, 4 as TemplateID) As `TestCase` 
+Group By  TestCase.Revenue, TestCase.TemplateID;
+

=== modified file 'sql/opt_subselect.cc'
--- a/sql/opt_subselect.cc	2014-02-22 21:51:20 +0000
+++ b/sql/opt_subselect.cc	2015-02-09 15:55:45 +0000
@@ -703,6 +703,12 @@ int check_and_do_in_subquery_rewrites(JO
       if (!optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS) &&
           !optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION))
         my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0));
+      /*
+        Transform each subquery predicate according to its overloaded
+        transformer.
+      */
+      if (subselect->select_transformer(join))
+        DBUG_RETURN(-1);
 
       /*
         If the subquery predicate is IN/=ANY, analyse and set all possible
@@ -754,12 +760,6 @@ int check_and_do_in_subquery_rewrites(JO
         allany_subs->add_strategy(strategy);
       }
 
-      /*
-        Transform each subquery predicate according to its overloaded
-        transformer.
-      */
-      if (subselect->select_transformer(join))
-        DBUG_RETURN(-1);
     }
   }
   DBUG_RETURN(0);



More information about the commits mailing list