From: Date: April 7 2008 9:53am Subject: bk commit into 6.0 tree (dlenev:1.2620) BUG#35733 List-Archive: http://lists.mysql.com/commits/44972 X-Bug: 35733 Message-Id: <20080407075307.A918D204338@mockturtle.local> Below is the list of changes that have just been committed into a local 6.0 repository of dlenev. When dlenev 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, 2008-04-07 11:53:00+04:00, dlenev@stripped +1 -0 Tentative fix for bug #35733 "main.symlink.test fails". The problem was that symlink.test failed due to debug assertions or due to errors emitted for wrong statements (in non-debug builds) if server was run with --thread-handling=pool-of-threads option. The above problems were caused by that on the one hand code mi_create() which handles case when error is returned relies on my_errno being set to appropriate non-0 value, but on the other it has not done this in case when error was emitted due to discovery that share for table which we are going to create is already present in the list of open shares. Running server with pool-of-threads option just exposed this bug since in this scheduler mode my_errno is reset to 0 when connection (THD) is reattached to the "real" thread. This fix ensures that code in mi_create() properly sets my_errno in the case described above. Question to reviewers are marked by QQ. QQ: Does it make sense to push this fix to 5.0/5.1 (IMO yes)? storage/myisam/mi_create.c@stripped, 2008-04-07 11:52:56+04:00, dlenev@stripped +1 -0 Code in mi_create() which handles case when error is returned relies on my_errno being set to appropriate non-0 value. Adjusted code which emits error when we discover that share for table which we are going to create is already present in the list of open shares to do this. QQ: Is HA_ERR_TABLE_EXIST a right error code ? diff -Nrup a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c --- a/storage/myisam/mi_create.c 2007-10-09 21:55:16 +04:00 +++ b/storage/myisam/mi_create.c 2008-04-07 11:52:56 +04:00 @@ -634,6 +634,7 @@ int mi_create(const char *name,uint keys my_printf_error(0, "MyISAM table '%s' is in use " "(most likely by a MERGE table). Try FLUSH TABLES.", MYF(0), name + dirname_length(name)); + my_errno= HA_ERR_TABLE_EXIST; goto err; }