~ubuntu-branches/ubuntu/karmic/mysql-dfsg-5.1/karmic

« back to all changes in this revision

Viewing changes to mysql-test/include/check-warnings.test

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090625125545-v27uqh8rlsj8uh2y
Tags: upstream-5.1.34
ImportĀ upstreamĀ versionĀ 5.1.34

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
12
set SQL_LOG_BIN=0;
 
13
 
 
14
# Turn off any debug crashes, allow the variable to be
 
15
# non existent in release builds
 
16
--error 0,1193
 
17
set debug="";
 
18
 
 
19
use mtr;
 
20
 
 
21
create temporary table error_log (
 
22
  row int auto_increment primary key,
 
23
  suspicious int default 1,
 
24
  file_name varchar(255),
 
25
  line varchar(1024) default null
 
26
) engine=myisam;
 
27
 
 
28
# Get the name of servers error log
 
29
let $log_error= $MTR_LOG_ERROR;
 
30
let $log_warning= $log_error.warnings;
 
31
 
 
32
# Try tload the warnings into a temporary table,
 
33
# it might fail with error saying "The MySQL server is
 
34
# running with the --secure-file-priv" in which case
 
35
# an attempt to load the file using LOAD DATA LOCAL is made
 
36
--error 0,1290
 
37
eval load data infile '$log_warning' into table error_log
 
38
  fields terminated by 'xykls37' escaped by ''
 
39
  ignore 1 lines
 
40
  (line)
 
41
  set file_name='$log_error';
 
42
 
 
43
if ($mysql_errno)
 
44
{
 
45
  # Try LOAD DATA LOCAL
 
46
  eval load data local infile '$log_warning' into table error_log
 
47
    fields terminated by 'xykls37' escaped by ''
 
48
    ignore 1 lines
 
49
    (line)
 
50
    set file_name='$log_error';
 
51
}
 
52
 
 
53
# Call check_warnings to filter out any warning in
 
54
# the error_log table
 
55
call mtr.check_warnings(@result);
 
56
if (`select @result = 0`){
 
57
  skip OK;
 
58
}
 
59
--enable_query_log
 
60
echo ^ Found warnings!!;
 
61
exit;