1
-- source include/have_log_bin.inc
2
-- source include/have_binlog_format_statement.inc
4
SET @old_log_warnings = @@log_warnings;
5
SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592;
8
DROP TABLE IF EXISTS t1;
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');
23
SET GLOBAL log_warnings = @old_log_warnings;
24
SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592;
26
let $log_error_= `SELECT @@GLOBAL.log_error`;
27
if(!`select LENGTH('$log_error_')`)
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;
33
# Assign env variable LOG_ERROR
34
let LOG_ERROR=$log_error_;
36
--echo # Count the number of times the "Unsafe" message was printed
37
--echo # to the error log.
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";