MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:November 18 2009 9:30am
Subject:bzr push into mysql-6.0-codebase-bugfixing branch (tor.didriksen:3713 to
3714) Bug#47338
View as plain text  
 3714 Tor Didriksen	2009-11-18
      Bug #47338 assertion in handler::ha_external_lock
      
      Cleanup after an underlying error was not handled gracefully in
      DsMrr_impl::dsmrr_init()
     @ mysql-test/r/analyse.result
        Add test case.
     @ mysql-test/t/analyse.test
        Add test case.
     @ mysys/my_open.c
        Dont call DBUG_RETURN(functio_call())
        it makes DEBUG output very confusing.
     @ sql/handler.cc
        Avoid double delete of member variable 'h2'
        
        Dont call DBUG_RETURN(functio_call())
        it makes DEBUG output very confusing.

    modified:
      mysql-test/r/analyse.result
      mysql-test/t/analyse.test
      mysys/my_open.c
      sql/handler.cc
 3713 Jorgen Loland	2009-11-18
      Bug#43618: MyISAM&Maria returns wrong results with 'between' 
                 on timestamp
         
      When conditions are pushed to an index (ICP), the same conditions
      is not checked for records returned by the index. It is assumed
      that all records qualify for these conditions.
            
      However, for MyISAM, these conditions were checked only for
      forward index lookups (mi_rnext), and not for reverse order
      lookups (mi_rprev). Thus, records that did not qualify could be
      returned if mi_rprev was used.
            
      This patch makes mi_rprev check the pushed conditions in the 
      same way as mi_rnext does.
     @ mysql-test/r/select.result
        Added test for BUG#43618
     @ mysql-test/r/select_jcl6.result
        Added test for BUG#43618
     @ mysql-test/r/subselect3.result
        Records that did not qualify for insertion due to non-matching WHERE condition were inserted due to missing condition check for reverse index lookup with ICP. These records are no longer inserted.
     @ mysql-test/r/subselect3_jcl6.result
        Records that did not qualify for insertion due to non-matching WHERE condition were inserted due to missing condition check for reverse index lookup with ICP. These records are no longer inserted.
     @ mysql-test/t/select.test
        Added test for BUG#43618
     @ storage/myisam/mi_rnext.c
        Modify comment to reflect that record is skipped if it does not qualify for some pushed condition (ICP)
     @ storage/myisam/mi_rprev.c
        Skip record if record does not qualify for a pushed condition (ICP)

    modified:
      mysql-test/r/select.result
      mysql-test/r/select_jcl6.result
      mysql-test/r/subselect3.result
      mysql-test/r/subselect3_jcl6.result
      mysql-test/t/select.test
      storage/myisam/mi_rnext.c
      storage/myisam/mi_rprev.c
=== modified file 'mysql-test/r/analyse.result'
--- a/mysql-test/r/analyse.result	2009-10-30 09:56:32 +0000
+++ b/mysql-test/r/analyse.result	2009-11-18 08:15:50 +0000
@@ -123,3 +123,18 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 
 ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT
 DROP TABLE t1;
 End of 5.0 tests
+#
+# Bug #47338 assertion in handler::ha_external_lock
+#
+call mtr.add_suppression("Incorrect key file for table .*");
+drop table if exists t1;
+CREATE TEMPORARY TABLE t1 (f2 INT, f1 INT, PRIMARY KEY (f1)) ENGINE = MyISAM;
+INSERT t1 ( f1 ) VALUES ( 5 );
+INSERT t1 ( f1 ) VALUES ( 6 );
+ALTER TABLE t1 ENGINE = MyISAM;
+ANALYZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	status	OK
+SELECT f1,f2 FROM t1 A WHERE f1 BETWEEN 0 AND 1;
+ERROR HY000: Incorrect key file for table 'path hidden'; try to repair it
+drop table t1;

=== modified file 'mysql-test/t/analyse.test'
--- a/mysql-test/t/analyse.test	2009-10-30 09:56:32 +0000
+++ b/mysql-test/t/analyse.test	2009-11-18 08:15:50 +0000
@@ -133,3 +133,32 @@ DROP TABLE t1;
 
 
 --echo End of 5.0 tests
+
+--echo #
+--echo # Bug #47338 assertion in handler::ha_external_lock
+--echo #
+
+call mtr.add_suppression("Incorrect key file for table .*");
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TEMPORARY TABLE t1 (f2 INT, f1 INT, PRIMARY KEY (f1)) ENGINE = MyISAM;
+
+INSERT t1 ( f1 ) VALUES ( 5 );
+INSERT t1 ( f1 ) VALUES ( 6 );
+
+ALTER TABLE t1 ENGINE = MyISAM;
+ANALYZE TABLE t1;
+
+# TODO(didrik) fix bug in ANALYZE TABLE, so we can remove replace_regex
+# as well as error 126 below.
+# key_cache_read() reports HA_ERR_FILE_TOO_SHORT
+# _mi_fetch_keypage discards that my_errno, and reports HA_ERR_CRASHED instead.
+
+--replace_regex /'.*'/'path hidden'/
+--error 126
+SELECT f1,f2 FROM t1 A WHERE f1 BETWEEN 0 AND 1; 
+
+drop table t1;

=== modified file 'mysys/my_open.c'
--- a/mysys/my_open.c	2009-09-27 21:00:41 +0000
+++ b/mysys/my_open.c	2009-11-18 08:15:50 +0000
@@ -49,8 +49,8 @@ File my_open(const char *FileName, int F
   fd = open((char *) FileName, Flags);
 #endif
 
-  DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_OPEN,
-				   EE_FILENOTFOUND, MyFlags));
+  fd= my_register_filename(fd, FileName, FILE_BY_OPEN, EE_FILENOTFOUND, MyFlags);
+  DBUG_RETURN(fd);
 } /* my_open */
 
 

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2009-11-09 10:27:46 +0000
+++ b/sql/handler.cc	2009-11-18 08:15:50 +0000
@@ -4470,8 +4470,10 @@ int DsMrr_impl::dsmrr_init(handler *h_ar
   if (mode & HA_MRR_USE_DEFAULT_IMPL || mode & HA_MRR_SORTED)
   {
     use_default_impl= TRUE;
-    DBUG_RETURN(h->handler::multi_range_read_init(seq_funcs, seq_init_param,
-                                                  n_ranges, mode, buf));
+    const int retval=
+      h->handler::multi_range_read_init(seq_funcs, seq_init_param,
+                                        n_ranges, mode, buf);
+    DBUG_RETURN(retval);
   }
   rowids_buf= buf->buffer;
 
@@ -4590,6 +4592,7 @@ error:
   h2->ha_external_lock(current_thd, F_UNLCK);
   h2->close();
   delete h2;
+  h2= NULL;
   DBUG_RETURN(1);
 }
 
@@ -5569,7 +5572,8 @@ int handler::ha_reset()
   free_io_cache(table);
   /* reset the bitmaps to point to defaults */
   table->default_column_bitmaps();
-  DBUG_RETURN(reset());
+  const int retval= reset();
+  DBUG_RETURN(retval);
 }
 
 


Attachment: [text/bzr-bundle] bzr/tor.didriksen@sun.com-20091118081550-l8gv8m2lodyil1uv.bundle
Thread
bzr push into mysql-6.0-codebase-bugfixing branch (tor.didriksen:3713 to3714) Bug#47338Tor Didriksen18 Nov