Bug #79011 truncated digest_text values don't always end with "..."
Submitted: 28 Oct 2015 21:53 Modified: 20 Nov 2015 9:41
Reporter: Trey Raymond Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.6.24 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[28 Oct 2015 21:53] Trey Raymond
Description:
Not all truncated digest_text values end with "..." - and no obvious reason why some do and some don't.  Since the advent of adjustable digest length, our monitoring now checks servers for truncated digests, and if a certain % of them (by count_star) are, will send an alert to allocate more memory for a longer length.  This has not been picking up a lot of truncated queries, and upon investigation, we see that many of these values are truncated without the trailing ellipsis, which is the documented behavior it's supposed to have.  No clear reason why not, from a few samples I think it might be related to truncation in a long select field list (vs truncation after FROM), but I have no proof of that, it's just a guess.

There's no substitute way to test for truncation by length, either, as identifier length changes across tables - with max digest length at 1024, you can see a truncated one with 950 chars, a non-truncated one with 1000 chars, some with 1200 chars even.

How to repeat:
select digest_text from performance_schema.events_statements_summary_by_digest order by length(digest_text) desc;

check the top handful of these, many will be clearly cut off with no indication added.

Suggested fix:
Ensure that no matter what the case, a truncated digest_text ends with an ellipsis to clearly show that it was cut off.