[Commits] Rev 4426: MDEV-7445:Server crash with Signal 6 in file:///home/bell/maria/bzr/work-maria-MDEV-7445/

sanja at askmonty.org sanja at askmonty.org
Sun Mar 22 16:44:11 EET 2015


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

------------------------------------------------------------
revno: 4426
revision-id: sanja at askmonty.org-20150322144316-hcqa7sfvn871p06l
parent: sanja at askmonty.org-20150213125837-0dcd06la410e59io
committer: sanja at askmonty.org
branch nick: work-maria-MDEV-7445
timestamp: Sun 2015-03-22 15:43:16 +0100
message:
  MDEV-7445:Server crash with Signal 6
  MDEV-7565: Server crash with Signal 6 (part 2)
  
  followup test suite and its fix.
-------------- next part --------------
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2015-02-13 12:58:37 +0000
+++ b/mysql-test/r/subselect.result	2015-03-22 14:43:16 +0000
@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and
 drop table t1, t2;
 CREATE TABLE t1 (a INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
 CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
 ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
 SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7047,3 +7047,9 @@ call procedure2();
 ControlRev
 NULL
 drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq

=== modified file 'mysql-test/r/subselect_no_mat.result'
--- a/mysql-test/r/subselect_no_mat.result	2015-02-13 12:58:37 +0000
+++ b/mysql-test/r/subselect_no_mat.result	2015-03-22 14:43:16 +0000
@@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and
 drop table t1, t2;
 CREATE TABLE t1 (a INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
 CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
 ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
 SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7044,6 +7044,12 @@ call procedure2();
 ControlRev
 NULL
 drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
 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	2015-02-13 12:58:37 +0000
+++ b/mysql-test/r/subselect_no_opts.result	2015-03-22 14:43:16 +0000
@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and
 drop table t1, t2;
 CREATE TABLE t1 (a INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
 CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
 ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
 SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7042,4 +7042,10 @@ call procedure2();
 ControlRev
 NULL
 drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
 set @optimizer_switch_for_subselect_test=null;

=== modified file 'mysql-test/r/subselect_no_scache.result'
--- a/mysql-test/r/subselect_no_scache.result	2015-02-13 12:58:37 +0000
+++ b/mysql-test/r/subselect_no_scache.result	2015-03-22 14:43:16 +0000
@@ -3596,7 +3596,7 @@ delete from t1 where c <= 1140006215 and
 drop table t1, t2;
 CREATE TABLE t1 (a INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
 CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
 ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
 SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7053,6 +7053,12 @@ call procedure2();
 ControlRev
 NULL
 drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
 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	2015-02-13 12:58:37 +0000
+++ b/mysql-test/r/subselect_no_semijoin.result	2015-03-22 14:43:16 +0000
@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and
 drop table t1, t2;
 CREATE TABLE t1 (a INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
 CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
 ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
 SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7042,5 +7042,11 @@ call procedure2();
 ControlRev
 NULL
 drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
 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	2015-02-13 12:58:37 +0000
+++ b/mysql-test/t/subselect.test	2015-03-22 14:43:16 +0000
@@ -5923,3 +5923,10 @@ call procedure2();
 call procedure2();
 
 drop procedure procedure2;
+
+
+SELECT
+  (SELECT user FROM mysql.user
+    WHERE h.host in (SELECT host FROM mysql.user)
+  ) AS sq
+FROM mysql.host h GROUP BY h.host;

=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2014-07-23 15:53:29 +0000
+++ b/sql/item_subselect.cc	2015-03-22 14:43:16 +0000
@@ -2651,10 +2651,12 @@ bool Item_in_subselect::fix_fields(THD *
 {
   uint outer_cols_num;
   List<Item> *inner_cols;
+  char const *save_where= thd->where;
 
   if (test_strategy(SUBS_SEMI_JOIN))
     return !( (*ref)= new Item_int(1));
 
+  thd->where= "IN/ALL/ANY subquery";
   /*
     Check if the outer and inner IN operands match in those cases when we
     will not perform IN=>EXISTS transformation. Currently this is when we
@@ -2685,7 +2687,7 @@ bool Item_in_subselect::fix_fields(THD *
     if (outer_cols_num != inner_cols->elements)
     {
       my_error(ER_OPERAND_COLUMNS, MYF(0), outer_cols_num);
-      return TRUE;
+      goto err;
     }
     if (outer_cols_num > 1)
     {
@@ -2695,20 +2697,25 @@ bool Item_in_subselect::fix_fields(THD *
       {
         inner_col= inner_col_it++;
         if (inner_col->check_cols(left_expr->element_index(i)->cols()))
-          return TRUE;
+          goto err;
       }
     }
   }
 
-  if (thd_arg->lex->is_view_context_analysis() &&
-      left_expr && !left_expr->fixed &&
+ // if (thd_arg->lex->is_view_context_analysis() &&
+  if (left_expr && !left_expr->fixed &&
       left_expr->fix_fields(thd_arg, &left_expr))
-    return TRUE;
+    goto err;
   else
   if (Item_subselect::fix_fields(thd_arg, ref))
-    return TRUE;
+    goto err;
   fixed= TRUE;
+  thd->where= save_where;
   return FALSE;
+
+err:
+  thd->where= save_where;
+  return TRUE;
 }
 
 



More information about the commits mailing list