1#
2# This test is executed once after each test to check the servers
3# for unexpected warnings found in the servers error log
4#
5# NOTE! mysql-test-run.pl has already done a rough filtering
6# of the file and written any suspicious lines
7# to $error_log.warnings file
8#
9--disable_query_log
10
11# Don't write these queries to binlog
12set SQL_LOG_BIN=0;
13
14# Do not replicate updates to other galera nodes
15--error 0,1193
16set WSREP_ON=0;
17
18# Turn off any debug crashes, allow the variable to be
19# non existent in release builds
20--error 0,1193
21set debug_dbug="";
22
23use mtr;
24# Allow this session to read-write even if server is started
25# with --transaction-read-only
26set session transaction read write;
27
28create temporary table error_log (
29  row int auto_increment primary key,
30  suspicious int default 1,
31  file_name varchar(255),
32  line varchar(1024) default null
33) engine=myisam;
34
35# Get the name of servers error log
36let $log_error= $MTR_LOG_ERROR;
37let $log_warning= $log_error.warnings;
38
39# Try to load the warnings into a temporary table,
40# it might fail with error saying "The MySQL server is
41# running with the --secure-file-priv" in which case
42# an attempt to load the file using LOAD DATA LOCAL is made
43--error 0,1290
44eval load data infile '$log_warning' into table error_log
45  fields terminated by 'xykls37' escaped by ''
46  ignore 1 lines
47  (line)
48  set file_name='$log_error';
49
50if ($mysql_errno)
51{
52  # Try LOAD DATA LOCAL
53  eval load data local infile '$log_warning' into table error_log
54    fields terminated by 'xykls37' escaped by ''
55    ignore 1 lines
56    (line)
57    set file_name='$log_error';
58}
59
60# Call check_warnings to filter out any warning in
61# the error_log table
62call mtr.check_warnings(@result);
63if (`select @result = 0`){
64  skip OK;
65}
66--enable_query_log
67echo ^ Found warnings in $log_error;
68exit;
69