~sergei.glushchenko/percona-server/55-tp

« back to all changes in this revision

Viewing changes to mysql-test/suppress_log_warning_1592.patch/percona_suppress_log_warning_1592.test

  • Committer: Oleg Tsarev
  • Date: 2010-12-09 18:30:58 UTC
  • Revision ID: oleg.tsarev@percona.com-20101209183058-1mq1qrgjjkz3qxof
propogate Oleg's patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_log_bin.inc
 
2
-- source include/have_binlog_format_statement.inc
 
3
 
 
4
SET @old_log_warnings = @@log_warnings;
 
5
SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592;
 
6
 
 
7
--disable_warnings
 
8
DROP TABLE IF EXISTS t1;
 
9
--enable_warnings
 
10
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
 
11
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 0;
 
12
SET GLOBAL LOG_WARNINGS = 0;
 
13
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
 
14
SET GLOBAL LOG_WARNINGS = 1;
 
15
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
 
16
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 1;
 
17
SET GLOBAL LOG_WARNINGS = 0;
 
18
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
 
19
SET GLOBAL LOG_WARNINGS = 1;
 
20
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
 
21
DROP TABLE t1;
 
22
 
 
23
SET GLOBAL log_warnings = @old_log_warnings;
 
24
SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592;
 
25
 
 
26
let $log_error_= `SELECT @@GLOBAL.log_error`;
 
27
if(!`select LENGTH('$log_error_')`)
 
28
{
 
29
  # MySQL Server on windows is started with --console and thus
 
30
  # does not know the location of its .err log, use default location
 
31
  let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
 
32
}
 
33
# Assign env variable LOG_ERROR
 
34
let LOG_ERROR=$log_error_;
 
35
 
 
36
--echo # Count the number of times the "Unsafe" message was printed
 
37
--echo # to the error log.
 
38
 
 
39
perl;
 
40
  use strict;
 
41
  my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
 
42
  open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
 
43
  my $count = () = grep(/suppress_1592/g,<FILE>);
 
44
  print "Occurrences: $count\n";
 
45
  close(FILE);
 
46
EOF