#At file:///export/home/didrik/mysqldev-6.0-codebase/6.0-codebase-bf-misc/ based on revid:jorgen.loland@stripped
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
=== 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 commit into mysql-6.0-codebase-bugfixing branch (tor.didriksen:3714)Bug#47338 | Tor Didriksen | 18 Nov |