~tsarev/percona-server/5.1-install_tests_fix-790199

« back to all changes in this revision

Viewing changes to mysql-test/profiling_slow.patch/percona_bug643149.test

  • Committer: Alexey Kopytov
  • Date: 2011-06-05 04:48:57 UTC
  • Revision ID: akopytov@gmail.com-20110605044857-po1idr4nz5lad4bx
Bug #770296.

Fixed the test so that:

1. long_query_time is set 0 to capture all queries in the slow query
log to make the test more deterministic.
2. We can now get rid of using SLEEP() due to 1.
3. "# Time:" lines are skipped from the slow query log, because they are
added to the query log if the current time is different from the last
logged query time, which of course makes the test non-deterministic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
SET @old_slow_query_log_file=@@global.slow_query_log_file;
15
15
SET GLOBAL slow_query_log=on;
16
16
SET LOCAL profiling_server=on;
17
 
SET LOCAL long_query_time=1;
 
17
SET LOCAL long_query_time=0;
18
18
 
19
19
let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
20
20
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
21
21
--eval SET GLOBAL slow_query_log_file='$slogfile';
22
22
 
23
23
--disable_ps_protocol
24
 
SELECT SLEEP(2);
 
24
SELECT 1;
25
25
--enable_ps_protocol
26
26
 
27
27
perl;
31
31
    die("Unable to read slow query log file $slogfile: $!\n");
32
32
  while(<FILE>) {
33
33
    next if (!/^#/);
 
34
    next if (/^# Time:/);
34
35
    s/[0-9]+/X/g;
35
 
    s/ +/ /g;
36
36
    print;
37
37
  }
38
38