3 messages in com.mysql.lists.bugsBug in mysqldumpslow| From | Sent On | Attachments |
|---|---|---|
| Steven Roussey | 26 Jul 2001 12:56 | |
| Sinisa Milivojevic | 27 Jul 2001 07:17 | |
| Michael Widenius | 10 Aug 2001 15:41 |
| Subject: | Bug in mysqldumpslow![]() |
|---|---|
| From: | Michael Widenius (mon...@mysql.com) |
| Date: | 08/10/2001 03:41:04 PM |
| List: | com.mysql.lists.bugs |
Hi!
"Steven" == Steven Roussey <srou...@network54.com> writes:
Steven> If a query in the slow log has a \' in a ' quoted string, it will get Steven> confused.
Steven> # mysqldumpslow test-slow Steven> Reading mysql slow query log from test-slow Steven> Count: 1 Time=3.00s (3s) Lock=0.00s (0s) Rows=0.0 (0), Steven> apache[apache]@mouse.i Steven> insert into testtb ( col_n, col_s ) values (N, 'S' )
Steven> Count: 1 Time=3.00s (3s) Lock=0.00s (0s) Rows=0.0 (0), Steven> apache[apache]@mouse.i Steven> insert into testtb ( col_n, col_s ) values (N, 'S't OK' )
Steven> test-slow: Steven> # Time: 010725 12:50:25 Steven> # User@Host: apache[apache] @ mouse.i [10.1.1.7] Steven> # Time: 3 Lock_time: 0 Rows_sent: 0 Rows_examined: 0 Steven> insert into testtb ( col_n, col_s ) values (118656, 'Test is OK' ); Steven> # Time: 010725 12:50:26 Steven> # User@Host: apache[apache] @ mouse.i [10.1.1.7] Steven> # Time: 3 Lock_time: 0 Rows_sent: 0 Rows_examined: 0 Steven> insert into testtb ( col_n, col_s ) values (118656, 'Test isn\'t OK' );
Patch:
===== scripts/mysqldumpslow.sh 1.4 vs edited ===== *** /tmp/mysqldumpslow.sh-1.4-8007 Thu Mar 8 21:49:14 2001 --- edited/scripts/mysqldumpslow.sh Sat Aug 11 01:38:42 2001 *************** *** 3,8 **** --- 3,9 ----
# Original version by Tim Bunce, sometime in 2000. # Further changes by Tim Bunce, 8th March 2001. + # Handling of strings with \ and double '' by Monty 11 Aug 2001.
use strict; use Getopt::Long; *************** *** 95,102 **** unless ($opt{a}) { s/\b\d+\b/N/g; s/\b0x[0-9A-Fa-f]+\b/N/g; ! s/'.*?'/'S'/g; ! s/".*?"/"S"/g; # -n=8: turn log_20001231 into log_NNNNNNNN s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; # abbreviate massive "in (...)" statements and similar --- 96,103 ---- unless ($opt{a}) { s/\b\d+\b/N/g; s/\b0x[0-9A-Fa-f]+\b/N/g; ! s/'([^\\\']|\\.|\'\')+'/'S'/g; ! s/"([^\\\"]|\\.|\"\")+"/"S"/g; # -n=8: turn log_20001231 into log_NNNNNNNN s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; # abbreviate massive "in (...)" statements and similar
Regards, Monty




