You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

14 years ago
14 years ago
14 years ago
14 years ago
  1. #
  2. # This test suffers from server
  3. # Bug#38124 "general_log_file" variable silently unset when using expression
  4. # In short:
  5. # SET GLOBAL general_log_file = @<whatever>
  6. # SET GLOBAL slow_query_log = @<whatever>
  7. # cause that the value of these server system variables is set to default
  8. # instead of the assigned values. There comes no error message or warning.
  9. # If this bug is fixed please
  10. # 1. try this test with "let $fixed_bug38124 = 0;"
  11. # 2. remove all workarounds if 1. was successful.
  12. --source include/have_profiling.inc
  13. let $fixed_bug38124 = 0;
  14. SET @old_slow_query_log_file=@@global.slow_query_log_file;
  15. SET GLOBAL slow_query_log=on;
  16. SET LOCAL log_slow_verbosity='profiling';
  17. SET LOCAL long_query_time=0;
  18. let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
  19. --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
  20. --eval SET GLOBAL slow_query_log_file='$slogfile';
  21. SELECT 1;
  22. perl;
  23. $slogfile= $ENV{'slogfile'};
  24. open(FILE, "$slogfile") or
  25. die("Unable to read slow query log file $slogfile: $!\n");
  26. while(<FILE>) {
  27. next if (!/^#/);
  28. next if (/^# Time:/);
  29. s/[0-9]+/X/g;
  30. print;
  31. }
  32. close(FILE);
  33. EOF
  34. SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
  35. if(!$fixed_bug38124)
  36. {
  37. --disable_query_log
  38. let $my_var = `SELECT @old_slow_query_log_file`;
  39. eval SET @@global.slow_query_log_file = '$my_var';
  40. --enable_query_log
  41. }