maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #02054
Re: SHOW PROFILE enhancements for Windows
Hi,
> I looked at the original bug report and can't see how this bug fix
> have anything to the with the real problem.
>
> I have now done a proper fix for this. Can you please test that things
> reported in http://bugs.mysql.com/bug.php?id=31173 now works
> on windows ?
>
Yes, looks like the change works. Thanks for fixing it!
>
>> === modified file 'mysys/my_thr_init.c'
>> --- mysys/my_thr_init.c 2010-01-29 10:45:51 +0000
>> +++ mysys/my_thr_init.c 2010-01-29 14:32:36 +0000
>> @@ -317,7 +317,7 @@
>> /*
>> Skip initialization if the thread specific variable is already initialized
>> */
>> - if (THR_KEY_mysys.id)
>> + if (THR_KEY_mysys.init)
>> goto end;
>> tmp= &THR_KEY_mysys;
>> #endif
>
> I don't see checking the id would not work, as the id is guaranteed to
> always be > 0
Hmm.. If I recall correctly, id was in fact 0 when I ran it through a debugger.
The reason I think the field was incorrect is because the function does
tmp->init= 1;
to signify that the thread-local variable has been initialized. (Where
tmp == &THR_KEY_mysys).
But the check to prevent re-initialization checks a completely
different field (id), and when I was debugging it, was 0 at the time,
causing the code to be entered again.
>
> The only difference I see is that if you call my_thread_end() then
> init will be reset so it will be safe to call my_thread_init() again.
>
> I will do the change based on this assumption.
>
> If there is another reason for this change, please let me know.
>
> <cut>
>
> All other things looked good.
>
> I am now applying all your changes except the above, as a diff but
> with your comments, to MariaDB 5.1. I will push it later today.
>
Thanks a lot!
- Alex
Follow ups
References