← Back to team overview

maria-developers team mailing list archive

Please test: Rev 3458: MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join

 

Hi Elena,

Could you please re-run the tests with this fix:

----- Forwarded message from Sergey Petrunya <psergey@xxxxxxxxxxxx> -----

From: Sergey Petrunya <psergey@xxxxxxxxxxxx>
To: commits@xxxxxxxxxxx
X-Mailer: mail (GNU Mailutils 1.2)
Date: Wed,  4 Jul 2012 13:34:48 +0300 (EEST)
Subject: [Commits] Rev 3458: MDEV-376: Wrong result (missing rows) with
	index_merge+index_merge_intersection,
	join in file:///home/psergey/dev2/5.5-look6/

At file:///home/psergey/dev2/5.5-look6/

------------------------------------------------------------
revno: 3458
revision-id: psergey@xxxxxxxxxxxx-20120704103445-ro4sk3cwbbzn3t4p
parent: psergey@xxxxxxxxxxxx-20120623161254-ido3pf16l31psyyv
committer: Sergey Petrunya <psergey@xxxxxxxxxxxx>
branch nick: 5.5-look6
timestamp: Wed 2012-07-04 14:34:45 +0400
message:
  MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
  - Let QUICK_RANGE_SELECT::init_ror_merged_scan() call  quick->reset() only 
    after we've set the column read bitmaps. 
=== modified file 'mysql-test/r/index_merge_innodb.result'
--- a/mysql-test/r/index_merge_innodb.result	2012-06-06 19:26:40 +0000
+++ b/mysql-test/r/index_merge_innodb.result	2012-07-04 10:34:45 +0000
@@ -777,4 +777,19 @@ commit;
 select * from t1 where t1.zone_id=830 AND modified=9;
 pk	zone_id	modified
 drop table t0, t1;
+#
+# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
+#
+CREATE TABLE t1 (
+a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
+SELECT ta.* FROM t1 AS ta, t1 AS tb
+WHERE ( tb.b != ta.b OR tb.a = ta.a )
+AND ( tb.b = ta.c OR tb.b = ta.b );
+a	b	c
+8	v	v
+8	m	m
+9	d	d
+DROP TABLE t1;
 set optimizer_switch= @optimizer_switch_save;

=== modified file 'mysql-test/t/index_merge_innodb.test'
--- a/mysql-test/t/index_merge_innodb.test	2012-06-04 15:26:11 +0000
+++ b/mysql-test/t/index_merge_innodb.test	2012-07-04 10:34:45 +0000
@@ -156,6 +156,21 @@ select * from t1 where t1.zone_id=830 AN
 
 drop table t0, t1;
 
+--echo #
+--echo # MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
+--echo #
+CREATE TABLE t1 (
+  a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
+
+
+SELECT ta.* FROM t1 AS ta, t1 AS tb
+WHERE ( tb.b != ta.b OR tb.a = ta.a )
+  AND ( tb.b = ta.c OR tb.b = ta.b );
+
+DROP TABLE t1;
 
 set optimizer_switch= @optimizer_switch_save;
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2012-06-04 15:26:11 +0000
+++ b/sql/opt_range.cc	2012-07-04 10:34:45 +0000
@@ -2008,7 +2008,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_
   if (reuse_handler)
   {
     DBUG_PRINT("info", ("Reusing handler 0x%lx", (long) file));
-    if (init() || reset())
+    if (init())
     {
       DBUG_RETURN(1);
     }
@@ -2043,7 +2043,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_
   if (file->ha_external_lock(thd, F_RDLCK))
     goto failure;
 
-  if (init() || reset())
+  if (init())
   {
     file->ha_external_lock(thd, F_UNLCK);
     file->ha_close();
@@ -2090,7 +2090,18 @@ int QUICK_RANGE_SELECT::init_ror_merged_
   head->key_read= org_key_read;
   bitmap_copy(&column_bitmap, head->read_set);
   head->column_bitmaps_set(&column_bitmap, &column_bitmap);
-
+ 
+  if (reset())
+  {
+    if (!reuse_handler)
+    {
+      file->ha_external_lock(thd, F_UNLCK);
+      file->ha_close();
+      goto failure;
+    }
+    else
+      DBUG_RETURN(1);
+  }
   DBUG_RETURN(0);
 
 failure:

_______________________________________________
commits mailing list
commits@xxxxxxxxxxx
https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits

----- End forwarded message -----

-- 
BR
 Sergei
-- 
Sergei Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog


Follow ups