List:Commits« Previous MessageNext Message »
From:Neeraj Bisht Date:December 11 2012 12:32pm
Subject:bzr push into mysql-5.6 branch (neeraj.x.bisht:4749 to 4750) Bug#13992148
View as plain text  
 4750 Neeraj Bisht	2012-12-11
      Bug#13992148 - IMPROPER EXECUTION OF QUERY WITH "IN (...UNION...)" 
      
      
      Problem:
      A query with IN clause and have UNION operator on left, 	
      executes improperly.
      
      
      Analysis:-
      
      In case of IN clause, we check whether the number of column on the left and 
      right expression of IN are same or not.
      
      After that we are fixing the field(prepare the subselect engine)of left 
      expression of IN clause.
      
      In case of UNION operator we got the number of column after we prepare 
      subselect_union_engine.Hence we dont have the correct value of number of 
      column, so DEBUG_ASSERT got failed.
      
      
      Possible Solution:-
      First we check fix the field of left side expression and then check the number 
      of column.
     @ mysql-test/include/subquery_sj.inc
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_all_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_all_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_all_bkaunique.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_dupsweed.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_dupsweed_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_dupsweed_bkaunique.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_firstmatch.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_firstmatch_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_firstmatch_bkaunique.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_loosescan.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_loosescan_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_loosescan_bkaunique.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_mat.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_mat_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_mat_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_mat_bkaunique.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_mat_nosj.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_none.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_none_bka.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_none_bka_nixbnl.result
        change test case for bug 13992148.
     @ mysql-test/r/subquery_sj_none_bkaunique.result
        change test case for bug 13992148.
     @ sql/sql_resolver.cc
        First we check fix the field of left side expression and then 
        check the number of column.

    modified:
      mysql-test/include/subquery_sj.inc
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_bka.result
      mysql-test/r/subquery_sj_all_bka_nixbnl.result
      mysql-test/r/subquery_sj_all_bkaunique.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_bka.result
      mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
      mysql-test/r/subquery_sj_dupsweed_bkaunique.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_bka.result
      mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
      mysql-test/r/subquery_sj_firstmatch_bkaunique.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_bka.result
      mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
      mysql-test/r/subquery_sj_loosescan_bkaunique.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_bka.result
      mysql-test/r/subquery_sj_mat_bka_nixbnl.result
      mysql-test/r/subquery_sj_mat_bkaunique.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_bka.result
      mysql-test/r/subquery_sj_none_bka_nixbnl.result
      mysql-test/r/subquery_sj_none_bkaunique.result
      sql/sql_resolver.cc
 4749 Vasil Dimov	2012-12-11
      Fix Bug#15946256 INCONSISTENT HANDLING OF INDEX NAME IN INNODB
      INFORMATION_SCHEMA TABLES
      
      Currently index name is printed in different ways in different
      INFORMATION SCHEMA InnoDB tables:
      1. innodb_locks quotes it with innobase_convert_name()
      2. innodb_buffer_page and innodb_sys_indexes removes the temp
         index prefix char
      3. innodb_cmp_per_index does not remove the temp index prefix char
      
      Change all the tables to consistently do the following: if it is not
      temp index, then display it verbatim (it is already in UTF8), if it is
      temp index, then replace the temp index prefix with '?', because the
      TEMP_INDEX_PREFIX is not a valid UTF8 sequence.
      
      A list of tables that contain index name:
      
      innodb_buffer_page.index_name
      innodb_buffer_page_lru.index_name
      innodb_cmp_per_index.index_name
      innodb_cmp_per_index_reset.index_name
      innodb_locks.lock_index
      innodb_sys_indexes.name
      
      Reviewed by:	Marko (rb:1655)

    modified:
      mysql-test/suite/innodb/r/innodb-index-online.result
      mysql-test/suite/innodb/r/innodb_i_s_innodb_locks.result
      mysql-test/suite/innodb/t/innodb-index-online.test
      storage/innobase/handler/i_s.cc
=== modified file 'mysql-test/include/subquery_sj.inc'
--- a/mysql-test/include/subquery_sj.inc	2012-09-14 13:19:41 +0000
+++ b/mysql-test/include/subquery_sj.inc	2012-12-11 12:14:04 +0000
@@ -2545,7 +2545,7 @@ CREATE TABLE BB (
   varchar_nokey varchar(1) NOT NULL
 );
 INSERT INTO BB VALUES ('i'),('t');
--- error ER_OPERAND_COLUMNS
+-- error ER_BAD_FIELD_ERROR
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
                                 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_all.result'
--- a/mysql-test/r/subquery_sj_all.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_all.result	2012-12-11 12:14:04 +0000
@@ -5911,7 +5911,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_all_bka.result'
--- a/mysql-test/r/subquery_sj_all_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_all_bka.result	2012-12-11 12:14:04 +0000
@@ -5914,7 +5914,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_all_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_all_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_all_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5924,7 +5924,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_all_bkaunique.result'
--- a/mysql-test/r/subquery_sj_all_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_all_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -5915,7 +5915,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_dupsweed.result'
--- a/mysql-test/r/subquery_sj_dupsweed.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed.result	2012-12-11 12:14:04 +0000
@@ -5870,7 +5870,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bka.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bka.result	2012-12-11 12:14:04 +0000
@@ -5871,7 +5871,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5881,7 +5881,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_dupsweed_bkaunique.result'
--- a/mysql-test/r/subquery_sj_dupsweed_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_dupsweed_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -5872,7 +5872,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_firstmatch.result'
--- a/mysql-test/r/subquery_sj_firstmatch.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch.result	2012-12-11 12:14:04 +0000
@@ -5869,7 +5869,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bka.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bka.result	2012-12-11 12:14:04 +0000
@@ -5870,7 +5870,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5882,7 +5882,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_firstmatch_bkaunique.result'
--- a/mysql-test/r/subquery_sj_firstmatch_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_firstmatch_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -5871,7 +5871,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_loosescan.result'
--- a/mysql-test/r/subquery_sj_loosescan.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_loosescan.result	2012-12-11 12:14:04 +0000
@@ -5871,7 +5871,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_loosescan_bka.result'
--- a/mysql-test/r/subquery_sj_loosescan_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bka.result	2012-12-11 12:14:04 +0000
@@ -5872,7 +5872,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5882,7 +5882,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_loosescan_bkaunique.result'
--- a/mysql-test/r/subquery_sj_loosescan_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_loosescan_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -5873,7 +5873,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_mat.result'
--- a/mysql-test/r/subquery_sj_mat.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_mat.result	2012-12-11 12:14:04 +0000
@@ -5998,7 +5998,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_mat_bka.result'
--- a/mysql-test/r/subquery_sj_mat_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_mat_bka.result	2012-12-11 12:14:04 +0000
@@ -5999,7 +5999,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_mat_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_mat_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_mat_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5987,7 +5987,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_mat_bkaunique.result'
--- a/mysql-test/r/subquery_sj_mat_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_mat_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -6000,7 +6000,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_mat_nosj.result'
--- a/mysql-test/r/subquery_sj_mat_nosj.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_mat_nosj.result	2012-12-11 12:14:04 +0000
@@ -5830,7 +5830,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_none.result'
--- a/mysql-test/r/subquery_sj_none.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_none.result	2012-12-11 12:14:04 +0000
@@ -5870,7 +5870,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_none_bka.result'
--- a/mysql-test/r/subquery_sj_none_bka.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_none_bka.result	2012-12-11 12:14:04 +0000
@@ -5871,7 +5871,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_none_bka_nixbnl.result'
--- a/mysql-test/r/subquery_sj_none_bka_nixbnl.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_none_bka_nixbnl.result	2012-12-11 12:14:04 +0000
@@ -5870,7 +5870,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'mysql-test/r/subquery_sj_none_bkaunique.result'
--- a/mysql-test/r/subquery_sj_none_bkaunique.result	2012-10-16 12:40:33 +0000
+++ b/mysql-test/r/subquery_sj_none_bkaunique.result	2012-12-11 12:14:04 +0000
@@ -5872,7 +5872,7 @@ INSERT INTO BB VALUES ('i'),('t');
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey
 FROM BB);
-ERROR 21000: Operand should contain 2 column(s)
+ERROR 42S22: Unknown column 'OUTR' in 'IN/ALL/ANY subquery'
 SELECT varchar_nokey FROM C
 WHERE (varchar_nokey, OUTR) IN (SELECT varchar_nokey, varchar_nokey
 FROM BB);

=== modified file 'sql/sql_resolver.cc'
--- a/sql/sql_resolver.cc	2012-11-24 14:45:56 +0000
+++ b/sql/sql_resolver.cc	2012-12-11 12:14:04 +0000
@@ -551,6 +551,19 @@ static bool resolve_subquery(THD *thd, J
 
   if (in_predicate)
   {
+    DBUG_ASSERT(select_lex == thd->lex->current_select);
+    thd->lex->current_select= outer;
+    char const *save_where= thd->where;
+    thd->where= "IN/ALL/ANY subquery";
+
+    bool result= !in_predicate->left_expr->fixed &&
+                  in_predicate->left_expr->fix_fields(thd,
+                                                     &in_predicate->left_expr);
+    thd->lex->current_select= select_lex;
+    thd->where= save_where;
+    if (result)
+      DBUG_RETURN(TRUE); /* purecov: deadcode */
+
     /*
       Check if the left and right expressions have the same # of
       columns, i.e. we don't have a case like 
@@ -565,18 +578,6 @@ static bool resolve_subquery(THD *thd, J
       DBUG_RETURN(TRUE);
     }
 
-    DBUG_ASSERT(select_lex == thd->lex->current_select);
-    thd->lex->current_select= outer;
-    char const *save_where= thd->where;
-    thd->where= "IN/ALL/ANY subquery";
-        
-    bool result= !in_predicate->left_expr->fixed &&
-                  in_predicate->left_expr->fix_fields(thd,
-                                                     &in_predicate->left_expr);
-    thd->lex->current_select= select_lex;
-    thd->where= save_where;
-    if (result)
-      DBUG_RETURN(TRUE); /* purecov: deadcode */
   }
 
   DBUG_PRINT("info", ("Checking if subq can be converted to semi-join"));

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (neeraj.x.bisht:4749 to 4750) Bug#13992148Neeraj Bisht11 Dec