Hi Tatjana,
Tatjana A Nuernberg wrote:
[..]
> diff -Nrup a/mysys/mf_keycache.c b/mysys/mf_keycache.c
> --- a/mysys/mf_keycache.c 2007-10-18 12:32:38 +02:00
> +++ b/mysys/mf_keycache.c 2008-03-14 08:26:28 +01:00
> @@ -442,7 +442,7 @@ int init_key_cache(KEY_CACHE *keycache,
> my_large_free(keycache->block_mem, MYF(0));
> keycache->block_mem= 0;
> }
> - if (blocks < 8)
> + if (blocks < 8 || keycache->block_mem == 0)
> {
> my_errno= ENOMEM;
> goto err;
The code already copes with a OOM condition by reducing the number of
blocks and tries to reallocate again with a lower number of blocks.
The problem is that my_malloc reports the error (sets Diagnostics_area
status to error and errno to ENOMEM) and later the allocation succeeds
and setting the ok status asserts because we already set the error.
I think the appropriate solution would be to clear out the current error
if the later allocations succeed.
Regards,
--
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com
Are you MySQL certified? www.mysql.com/certification