MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:August 24 2006 2:33pm
Subject:bk commit into 4.1 tree (sergefp:1.2543) BUG#16255
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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 18:33:23+04:00, sergefp@stripped +2 -0
  BUG#16255: Post-review fixes: adjust the testcase.

  mysql-test/r/subselect.result@stripped, 2006-08-24 18:33:21+04:00, sergefp@stripped +22 -11
    BUG#16255: A proper testcase

  mysql-test/t/subselect.test@stripped, 2006-08-24 18:33:21+04:00, sergefp@stripped +17 -5
    BUG#16255: A proper testcase

# 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:	pslp.mylan
# Root:	/home/psergey/mysql-4.1-bug16255-review

--- 1.181/mysql-test/r/subselect.result	2006-08-24 18:33:27 +04:00
+++ 1.182/mysql-test/r/subselect.result	2006-08-24 18:33:27 +04:00
@@ -2895,14 +2895,25 @@
 s1
 2
 drop table t1;
-CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
-INSERT INTO t1 VALUES(26, 1), (48, 2);
-SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a,MAX(b) FROM t1 GROUP BY a);
-a	b
-26	1
-48	2
-SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a + 0,MAX(b) FROM t1 GROUP BY a);
-a	b
-26	1
-48	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;

--- 1.158/mysql-test/t/subselect.test	2006-08-24 18:33:27 +04:00
+++ 1.159/mysql-test/t/subselect.test	2006-08-24 18:33:27 +04:00
@@ -1865,12 +1865,24 @@
 #
 # Bug #16255: Subquery in where
 #
-CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
+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(26, 1), (48, 2);
+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 r WHERE (r.a,r.b) IN (SELECT a,MAX(b) FROM t1 GROUP BY a);
-SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a + 0,MAX(b) FROM t1 GROUP BY a);
+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;
 
-DROP TABLE t1;
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (sergefp:1.2543) BUG#16255Sergey Petrunia24 Aug