List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:July 30 2009 3:34pm
Subject:Re: bzr commit into mysql-5.4-perfschema branch (marc.alff:2839)
View as plain text  
Hello Marc,

Marc Alff a écrit, Le 30.07.2009 17:11:
> #At file:///home/malff/BZR-TREE/mysql-azalea-perfschema/ based on
> revid:marc.alff@stripped
> 
>  2839 Marc Alff	2009-07-30
>       Implemented more review comments:
>       - moved doxygen comments
>       - fixed the number of bytes for file io on error

> === modified file 'include/mysql/psi/mysql_file.h'
> --- a/include/mysql/psi/mysql_file.h	2009-07-10 01:33:40 +0000
> +++ b/include/mysql/psi/mysql_file.h	2009-07-30 15:11:22 +0000
> @@ -760,9 +760,13 @@ inline_mysql_file_fread(
>  #ifdef HAVE_PSI_INTERFACE
>    if (locker)
>    {
> -    /* Warning: my_fread does not always return the number of bytes read. */
> -    size_t bytes_read= (flags & (MY_NABP | MY_FNABP))
> -                       ? count : (size_t) result;
> +    size_t bytes_read;
> +    if (result)
> +      /* my_fread does not always return the number of bytes read. */
> +      bytes_read= (flags & (MY_NABP | MY_FNABP)) ? count : (size_t) result;
> +    else
> +      /* reporting 0 in case of error */
> +      bytes_read= 0;

If "flags" contains MY_NABP or MY_FNABP, and my_fread() succeeds, then 
my_fread() returns 0, so "result" is 0, so the code above considers this 
an error and sets bytes_read to 0, which is incorrect (as the read went 
well).
I haven't checked the rest of the patch, but it probably has the same 
problem several times (my_pwrite() has the same behaviour for example).

-- 
Mr. Guilhem Bichot <guilhem@stripped>
Sun Microsystems / MySQL, Lead Software Engineer
Bordeaux, France
www.sun.com / www.mysql.com
Thread
bzr commit into mysql-5.4-perfschema branch (marc.alff:2839) Marc Alff30 Jul
  • Re: bzr commit into mysql-5.4-perfschema branch (marc.alff:2839)Guilhem Bichot30 Jul
    • Re: bzr commit into mysql-5.4-perfschema branch (marc.alff:2839)Marc Alff30 Jul