MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mysqlbinlog_have_debug.inc
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
10 let log_tmp=$temp_out_help_file;
11 --let $temp_inc=$MYSQL_TMP_DIR/temp.inc
12 let inc_tmp=$temp_inc;
13 
14 --perl
15 use strict;
16 my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set";
17 open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n");
18 my $count = () = grep(/Output debug log/g,<FILE>);
19 close FILE;
20 
21 my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set";
22 open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!");
23 print FILE_INC '--let $is_debug= '.$count;
24 close FILE_INC;
25 EOF
26 --source $temp_inc
27 
28 if (!$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