File: percona_bug643149.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (49 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# This test suffers from server
# Bug#38124 "general_log_file" variable silently unset when using expression
# In short:
#    SET GLOBAL general_log_file = @<whatever>
#    SET GLOBAL slow_query_log = @<whatever>
# cause that the value of these server system variables is set to default
# instead of the assigned values. There comes no error message or warning.
# If this bug is fixed please
# 1. try this test with "let $fixed_bug38124 = 0;"
# 2. remove all workarounds if 1. was successful.
--source include/have_profiling.inc
let $fixed_bug38124 = 0;

SET @old_slow_query_log_file=@@global.slow_query_log_file;
SET GLOBAL slow_query_log=on;
SET LOCAL log_slow_verbosity='profiling';
SET LOCAL long_query_time=0;

let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SET GLOBAL slow_query_log_file='$slogfile';

SELECT 1;

perl;
  $slogfile= $ENV{'slogfile'};

  open(FILE, "$slogfile") or
    die("Unable to read slow query log file $slogfile: $!\n");
  while(<FILE>) {
    next if (!/^#/);
    next if (/^# Time:/);
    s/[0-9]+/X/g;
    print;
  }

  close(FILE);
EOF

SET GLOBAL slow_query_log_file=@old_slow_query_log_file;

if(!$fixed_bug38124)
{
  --disable_query_log
  let $my_var = `SELECT @old_slow_query_log_file`;
  eval SET @@global.slow_query_log_file = '$my_var';
  --enable_query_log
}