mariadb/mysql-test/suite/percona/percona_suppress_log_warning_1592.test

46 lines
1.5 KiB
Text

-- source include/have_log_bin.inc
-- source include/have_binlog_format_statement.inc
SET @old_log_warnings = @@log_warnings;
SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 0;
SET GLOBAL LOG_WARNINGS = 0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS = 1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 1;
SET GLOBAL LOG_WARNINGS = 0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS = 1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
}
# Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_;
--echo # Count the number of times the "Unsafe" message was printed
--echo # to the error log.
perl;
use strict;
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
my $count = () = grep(/suppress_1592/g,<FILE>);
print "Occurrences: $count\n";
close(FILE);
EOF