List:Internals« Previous MessageNext Message »
From:Chad MILLER Date:March 20 2007 2:56pm
Subject:review of patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"
View as plain text  
Jocelyn,


> --- sql_parse.cc.old	2007-03-03 17:53:15.000000000 +0100
> +++ sql_parse.cc	2007-03-03 17:53:31.000000000 +0100
> @@ -2119,7 +2119,7 @@
> 			&LOCK_status);
>      calc_sum_of_all_status(&current_global_status_var);
>      uptime= (ulong) (thd->start_time - start_time);
> -    length= my_snprintf((char*) buff, buff_len - 1,
> +    length= snprintf((char*) buff, buff_len - 1,
>                          "Uptime: %lu  Threads: %d  Questions: %lu  "
>                          "Slow queries: %lu  Opens: %lu  Flush  
> tables: %lu  "
>                          "Open tables: %u  Queries per second avg:  
> %.3f",


In addition to Sergei's comment that we should never use snprintf()  
outside the check for HAVE_SNPRINTF, the return value of snprintf()  
varies across implementations, so we should never even trust "length"  
in this case.  Thus, another reason we can't accept this approach.   
You're right, that adding floating-point decoding to my_snprintf() is  
the right approach.

Jocelyn, are you comfortable implementing "%f"?

- chad

--
Chad Miller, Software Developer                         chad@stripped
MySQL Inc., www.mysql.com
Orlando, Florida, USA                                13-20z,  UTC-0400
Office: +1 408 213 6740                         sip:6740@stripped



Attachment: [application/pgp-signature] This is a digitally signed message part PGP.sig
Thread
review of patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Chad MILLER20 Mar
  • Re: review of patch for Bug#25615,"Status command doesn't report anymore the Queries per second avg"joce20 Mar
    • Re: review of patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Chad MILLER20 Mar
      • Re: review of patch for Bug#25615, "Status command doesn't reportanymore the Queries per second avg"Jocelyn Fournier25 Mar
        • Re: debugger suggestionsChad MILLER26 Mar
          • Re: debugger suggestionsjoce26 Mar
      • [PATCH] Patch for Bug#25615, "Status command doesn't report anymorethe Queries per second avg"Jocelyn Fournier26 Mar
        • Review of second patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Chad MILLER2 Apr
          • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"Baron Schwartz2 Apr
            • Re: Review of second patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Chad MILLER2 Apr
          • Re: Review of second patch for Bug#25615,joce2 Apr
          • Re: Review of second patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Sergei Golubchik2 Apr
            • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"joce@presence-pc.com8 Apr
              • Re: Review of second patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Sergei Golubchik9 Apr
          • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"joce@presence-pc.com9 Apr
            • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"joce@presence-pc.com9 Apr
              • Re: Review of second patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Sergei Golubchik9 Apr
              • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"joce@presence-pc.com9 Apr
                • Re: Review of second patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"joce@presence-pc.com9 Apr
                  • Review of fourth patch for Bug#25615, "Status command doesn't report anymore the Queries per second avg"Chad MILLER10 Apr
                    • Re: Review of fourth patch for Bug#25615, "Status command doesn'treport anymore the Queries per second avg"Jocelyn Fournier10 Apr