Code review comment for lp:~laurynas-biveinis/percona-server/bug810272

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Redid with my_snprintf and without buffer overflow checks. Tested locally, Jenkins results will be at
http://jenkins.percona.com/view/Percona%20Server%205.5/job/percona-server-5.5-param/193/

----

Fix bug 810272 (bogus snprintf return value checking and compilation
warning).

The warning is
sql/query_response_time.cc:147: error: comparison of unsigned
expression < 0 is always false
and it indicates that the if clause is dead code, because of the wrong
assumption that snprintf returns a negative value on buffer truncate
(and the old code stores that value in an unsigned type anyway).

The fix:
- Drops buffer overflow check and returns the truncated buffer instead.
- Replaces snprintf with my_snprintf.
- Removes pre- and post-snprintf buffer writes.
- Removes STRING_OVERFLOW, QRT_STRING_OVERFLOW, changes
  QRT_POSITIVE_POWER_FILLER to "", simplifies QRT_TIME_STRING_LENGTH
  and QRT_TOTAL_STRING_LENGTH.
- Re-records the testcases.

review: Needs Resubmitting

« Back to merge proposal