Bug #25631 mysqldumpslow does not summarise multiple strings correctly
Submitted: 15 Jan 2007 16:01 Modified: 25 Feb 2007 11:29
Reporter: alan langridge Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:all OS:Solaris (solaris)
Assigned to: Assigned Account CPU Architecture:Any

[15 Jan 2007 16:01] alan langridge
mysqldumpslow does not summarise a long list of strings (in an IN clause for example) correctly, as it does for numbers.

How to repeat:
run a slow query with more than 100 comma separated strings in an IN clause, the output of mysqldumpslow will show the query with 'S', 100 times. With 100 numbers mysqldumpslow would show N,{repeated 100 times},N

Suggested fix:
Put this line of code:

s!((['"]S['"],){100,})!sprintf("$2,{repeated %d times}",length($1)/2)!eg;

after this line of code:

s!(([NS],){100,})!sprintf("$2,{repeated %d times}",length($1)/2)!eg;

and, for completeness change:

s!(([NS],){100,})!sprintf("$2,{repeated %d times}",length($1)/2)!eg;


s!(([N],){100,})!sprintf("$2,{repeated %d times}",length($1)/2)!eg;
[16 Jan 2007 9:39] Sveta Smirnova
Thank you for the report.

It is expected behaviour: mysqldumpslow is to ummarize the queries that appear in the log, not to print them "as is". For example, try to issue 2 queries takes long time to execute, but structure similar, then run mysqldumpslow and analyze output.

But there is not any documentation for mysqldumpslow except one paragraph at http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html and short --help output. So I reclassify this report to documentation request.
[17 Jan 2007 10:20] alan langridge
I'm afraid that the program does not work as described at the moment, as shown by the example in the attached file
[17 Jan 2007 10:22] alan langridge
example output from mysqldumpslow as it is and with my suggested fix

Attachment: mysql-bug25631.txt (text/plain), 10.44 KiB.

[19 Jan 2007 22:04] Sveta Smirnova
Than you for the feedback.

Please indicate your version of Perl.
[22 Jan 2007 13:39] alan langridge
hi, version of perl in use is:

perl -v

This is perl, v5.8.4 built for sun4-solaris-64int
[25 Jan 2007 7:01] Sveta Smirnova
Category changed because last information
[25 Jan 2007 11:26] Sveta Smirnova
used test

Attachment: bug25631.sql (application/octet-stream, text), 24.90 KiB.

[25 Jan 2007 11:29] Sveta Smirnova
I can not repeat with attached test file and perl v5.8.5 built for i86pc-solaris. Please, try to repeat using my test.

If you can repeat: please, upgrade Perl and try again.

If you can not repeat: please, upload query you use and output of statements SHOW CREATE TABLE table_you_use and SHOW TABLE STATUS table_you_use
[26 Feb 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".