1#############################################
2# checks if mysqlbinlog is debug compiled
3# this "cannot" be done simply by using
4# have_debug.inc
5#############################################
6
7--disable_query_log
8--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp
9--exec $MYSQL_BINLOG --help>$temp_out_help_file
10let log_tmp=$temp_out_help_file;
11--let $temp_inc=$MYSQL_TMP_DIR/temp.inc
12let inc_tmp=$temp_inc;
13
14--perl
15use strict;
16my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set";
17open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n");
18my $count = () = grep(/Output debug log/g,<FILE>);
19close FILE;
20
21my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set";
22open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!");
23print FILE_INC '--let $is_debug= '.$count;
24close FILE_INC;
25EOF
26--source $temp_inc
27
28if (!$is_debug)
29{
30  --skip mysqlbinlog needs to be debug compiled
31}
32--remove_file $temp_out_help_file
33--remove_file $temp_inc
34--enable_query_log
35