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.
Redid with my_snprintf and without buffer overflow checks. Tested locally, Jenkins results will be at jenkins. percona. com/view/ Percona% 20Server% 205.5/job/ percona- server- 5.5-param/ 193/
http://
----
Fix bug 810272 (bogus snprintf return value checking and compilation
warning).
The warning is response_ time.cc: 147: error: comparison of unsigned
sql/query_
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: OVERFLOW, changes POWER_FILLER to "", simplifies QRT_TIME_ STRING_ LENGTH STRING_ LENGTH.
- 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_
QRT_POSITIVE_
and QRT_TOTAL_
- Re-records the testcases.