MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:August 24 2006 4:56pm
Subject:bk commit into 5.0 tree (sergefp:1.2269) BUG#16255
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-24 20:56:28+04:00, sergefp@stripped +3 -0
  BUG#16255: Merge to 5.0
  MERGE: 1.1616.2696.4

  mysql-test/r/subselect.result@stripped, 2006-08-24 20:56:25+04:00, sergefp@stripped +0 -0
    BUG#16255: Merge to 5.0
    MERGE: 1.67.1.115

  mysql-test/t/subselect.test@stripped, 2006-08-24 20:56:25+04:00, sergefp@stripped +0 -1
    BUG#16255: Merge to 5.0
    MERGE: 1.58.1.101

  sql/item_subselect.cc@stripped, 2006-08-24 20:56:25+04:00, sergefp@stripped +23 -29
    BUG#16255: Merge to 5.0
    MERGE: 1.60.1.83

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	sergefp
# Host:	pylon.mylan
# Root:	/home/psergey/mysql-5.0-bug16255-merge/RESYNC

--- 1.153/mysql-test/r/subselect.result	2006-08-24 20:56:32 +04:00
+++ 1.154/mysql-test/r/subselect.result	2006-08-24 20:56:32 +04:00
@@ -2915,6 +2915,28 @@
 s1
 2
 drop table t1;
+create table t1 (
+retailerID varchar(8) NOT NULL,
+statusID   int(10) unsigned NOT NULL,
+changed    datetime NOT NULL,
+UNIQUE KEY retailerID (retailerID, statusID, changed)
+);
+INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
+INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
+select * from t1 r1 
+where (r1.retailerID,(r1.changed)) in 
+(SELECT r2.retailerId,(max(changed)) from t1 r2 
+group by r2.retailerId);
+retailerID	statusID	changed
+0026	2	2006-01-06 12:25:53
+0037	2	2006-01-06 12:25:53
+0048	1	2006-01-06 12:37:50
+0059	1	2006-01-06 12:37:50
+drop table t1;
 create table t1 (df decimal(5,1));
 insert into t1 values(1.1);
 insert into t1 values(2.2);

--- 1.124/mysql-test/t/subselect.test	2006-08-24 20:56:32 +04:00
+++ 1.125/mysql-test/t/subselect.test	2006-08-24 20:56:32 +04:00
@@ -1868,7 +1868,30 @@
 select * from t1 where (s1 = ALL (select s1/s1 from t1));
 select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
 drop table t1;
-# End of 4.1 tests
+
+#
+# Bug #16255: Subquery in where
+#
+create table t1 (
+  retailerID varchar(8) NOT NULL,
+  statusID   int(10) unsigned NOT NULL,
+  changed    datetime NOT NULL,
+  UNIQUE KEY retailerID (retailerID, statusID, changed)
+);
+
+INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
+INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
+
+select * from t1 r1 
+  where (r1.retailerID,(r1.changed)) in 
+         (SELECT r2.retailerId,(max(changed)) from t1 r2 
+          group by r2.retailerId);
+drop table t1;
+
 # End of 4.1 tests
 
 #

--- 1.131/sql/item_subselect.cc	2006-08-24 20:56:32 +04:00
+++ 1.132/sql/item_subselect.cc	2006-08-24 20:56:32 +04:00
@@ -1098,24 +1098,23 @@
         DBUG_RETURN(RES_ERROR);
       Item *item_eq=
         new Item_func_eq(new
-                         Item_direct_ref(&select_lex->context,
-                                         (*optimizer->get_cache())->
-                                         addr(i),
-                                         (char *)"<no matter>",
-                                         (char *)in_left_expr_name),
+                         Item_ref(&select_lex->context,
+                                  (*optimizer->get_cache())->
+                                  addr(i),
+                                  (char *)"<no matter>",
+                                  (char *)in_left_expr_name),
                          new
-                         Item_direct_ref(&select_lex->context,
-                                         select_lex->ref_pointer_array + i,
-                                         (char *)"<no matter>",
-                                         (char *)"<list ref>")
+                         Item_ref(&select_lex->context,
+                                  select_lex->ref_pointer_array + i,
+                                  (char *)"<no matter>",
+                                  (char *)"<list ref>")
                         );
       Item *item_isnull=
         new Item_func_isnull(new
-                             Item_direct_ref(&select_lex->context,
-                                             select_lex->
-                                             ref_pointer_array+i,
-                                             (char *)"<no matter>",
-                                             (char *)"<list ref>")
+                             Item_ref(&select_lex->context,
+                                      select_lex->ref_pointer_array+i,
+                                      (char *)"<no matter>",
+                                      (char *)"<list ref>")
                             );
       having_item=
         and_items(having_item,
@@ -1125,11 +1124,11 @@
                   new
                   Item_is_not_null_test(this,
                                         new
-                                        Item_direct_ref(&select_lex->context,
-                                                        select_lex->
-                                                        ref_pointer_array + i,
-                                                        (char *)"<no matter>",
-                                                        (char *)"<list ref>")
+                                        Item_ref(&select_lex->context,
+                                                 select_lex->
+                                                 ref_pointer_array + i,
+                                                 (char *)"<no matter>",
+                                                 (char *)"<list ref>")
                                        )
                  );
       item_having_part2->top_level_item();
@@ -1185,11 +1184,11 @@
                     new
                     Item_is_not_null_test(this,
                                           new
-                                          Item_direct_ref(&select_lex->context,
-                                                          select_lex->
-                                                          ref_pointer_array + i,
-                                                          (char *)"<no matter>",
-                                                          (char *)"<list ref>")
+                                          Item_ref(&select_lex->context,
+                                                   select_lex->
+                                                   ref_pointer_array + i,
+                                                   (char *)"<no matter>",
+                                                   (char *)"<list ref>")
                                          )
                   );
         item_isnull= new
Thread
bk commit into 5.0 tree (sergefp:1.2269) BUG#16255Sergey Petrunia24 Aug