Commit d5990c28 authored by unknown's avatar unknown

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 6.0 version of 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.

Since original reason that caused this bug to be exposed in 6.0 tree
might also under very special conditions lead to incorrect behavior
of earlier versions of server (i.e. to errors emitted for wrong
statements) this patch is also being pushed into 5.1 tree.

No test case is present as this code is already covered by a test
case + pushbuild options combination in 6.0.


storage/myisam/mi_create.c:
  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.
parent f2d504aa
...@@ -633,6 +633,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -633,6 +633,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
my_printf_error(0, "MyISAM table '%s' is in use " my_printf_error(0, "MyISAM table '%s' is in use "
"(most likely by a MERGE table). Try FLUSH TABLES.", "(most likely by a MERGE table). Try FLUSH TABLES.",
MYF(0), name + dirname_length(name)); MYF(0), name + dirname_length(name));
my_errno= HA_ERR_TABLE_EXIST;
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment