MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:February 25 2010 4:24pm
Subject:bzr commit into mysql-pe branch (Alexey.Kopytov:3922) Bug#45195
Bug#50335
View as plain text  
#At file:///data/src/bzr/bugteam/bug50335/my60-bug50335/ based on revid:magne.mahre@stripped

 3922 Alexey Kopytov	2010-02-25 [merge]
      Manual merge of the patch for bug #50335.
      Also picked the test case for bug #45195 that was previously
      null-merged to mysql-pe.

    modified:
      mysql-test/r/join.result
      mysql-test/t/join.test
      sql/sql_select.cc
=== modified file 'mysql-test/r/join.result'
--- a/mysql-test/r/join.result	2010-02-10 14:59:15 +0000
+++ b/mysql-test/r/join.result	2010-02-25 16:23:29 +0000
@@ -1128,3 +1128,31 @@ EXECUTE stmt;
 DEALLOCATE PREPARE stmt;
 DROP VIEW v1;
 DROP TABLE t1, t2;
+CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('1',null),(null,null);
+INSERT INTO t2 VALUES ('1',null),(null,null);
+CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
+ENGINE=MERGE  UNION=(t1,t2);
+SELECT t1.a FROM mm1,t1;
+a
+NULL
+1
+NULL
+1
+NULL
+1
+NULL
+1
+DROP TABLE t1, t2, mm1;
+#
+# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+# 
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+a	b	a	b
+0	0	0	0
+1	1	1	1
+DROP TABLE t1;
+End of 5.1 tests

=== modified file 'mysql-test/t/join.test'
--- a/mysql-test/t/join.test	2010-02-10 14:59:15 +0000
+++ b/mysql-test/t/join.test	2010-02-25 16:23:29 +0000
@@ -804,3 +804,28 @@ DEALLOCATE PREPARE stmt;
 
 DROP VIEW v1;
 DROP TABLE t1, t2;
+
+#
+# Bug#45195 valgrind warnings about uninitialized values in store_record_in_cache()
+#
+CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('1',null),(null,null);
+INSERT INTO t2 VALUES ('1',null),(null,null);
+CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
+ENGINE=MERGE  UNION=(t1,t2);
+SELECT t1.a FROM mm1,t1;
+DROP TABLE t1, t2, mm1;
+
+--echo #
+--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+--echo # 
+
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-02-22 13:42:40 +0000
+++ b/sql/sql_select.cc	2010-02-25 16:23:29 +0000
@@ -10903,9 +10903,11 @@ eq_ref_table(JOIN *join, ORDER *start_or
       }
       if (order)
       {
-	found++;
-	DBUG_ASSERT(!(order->used & map));
-	order->used|=map;
+        if (!(order->used & map))
+        {
+          found++;
+          order->used|= map;
+        }
 	continue;				// Used in ORDER BY
       }
       if (!only_eq_ref_tables(join,start_order, (*ref_item)->used_tables()))


Attachment: [text/bzr-bundle] bzr/alexey.kopytov@sun.com-20100225162329-d77ihj5q5d6fmytq.bundle
Thread
bzr commit into mysql-pe branch (Alexey.Kopytov:3922) Bug#45195Bug#50335Alexey Kopytov25 Feb