AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.213
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/include/rpl_get_end_of_relay_log.inc
# ==== Purpose ====
#
# Get the file name and file size of the last relay log.
#
# ==== Usage ====
#
# [--let $rpl_channel_name= NAME]
# --source include/rpl_get_end_of_relay_log.inc
# --echo Last relay log: $relay_log_file
# --echo Size of last relay log: $relay_log_size

--let $include_filename= include/rpl_get_end_of_relay_log.inc
--source include/begin_include_file.inc

--let _RGEORL_CHANNEL_NAME= $rpl_channel_name
--let _RGEORL_OUTPUT_FILE= `SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_end_of_relay_log-', UUID(), '.txt')`
--let _RGEORL_INDEX_FILE= `SELECT @@GLOBAL.RELAY_LOG_INDEX`
--let _RGEORL_DATADIR= `SELECT @@GLOBAL.DATADIR`
if ($rpl_debug)
{
  --echo _RGEORL_OUTPUT_FILE='$_RGEORL_OUTPUT_FILE'
  --echo _RGEORL_INDEX_FILE='$_RGEORL_INDEX_FILE'
  --echo _RGEORL_DATADIR='$_RGEORL_DATADIR'
}

perl;
  # Compute relay log filename.
  my $index_file= $ENV{'_RGEORL_INDEX_FILE'};
  my $channel_name= $ENV{'_RGEORL_CHANNEL_NAME'};
  if ($channel_name) {
    $index_file =~ s/(.*)(\.index)/$1-$channel_name$2/;
  }

  # Read relay log filename.
  open FILE, "$index_file" or die "Error $? opening $index_file: $!";
  my $relay_log_file= '';
  while (<FILE>) {
    $relay_log_file= $_;
  }
  chomp($relay_log_file);
  $relay_log_file =~ s{^\.[/\\]}{};
  close FILE or die "Error $? closing $index_file: $!";

  # Get relay log size.
  my $datadir= $ENV{'_RGEORL_DATADIR'};
  my $relay_log_size= (stat("$datadir/$relay_log_file"))[7];

  # Write output file.
  my $output_file= $ENV{'_RGEORL_OUTPUT_FILE'};
  open FILE, "> $output_file" or die "Error $? opening $output_file: $!";
  printf FILE "% 10d%s", $relay_log_size, $relay_log_file or die "Error $? writing to $output_file: $!";
  close FILE or die "Error $? writing to $output_file: $!";
EOF

# Read output file into mtr variables
--let $size_and_file= `SELECT LOAD_FILE('$_RGEORL_OUTPUT_FILE')`
--remove_file $_RGEORL_OUTPUT_FILE
--let $relay_log_size= `SELECT TRIM(SUBSTR('$size_and_file', 1, 10))`
--let $relay_log_file= `SELECT TRIM(SUBSTR('$size_and_file', 11))`

if ($rpl_debug)
{
  --echo relay_log_file=$relay_log_file relay_log_size=$relay_log_size
}

--let $include_filename= include/rpl_get_end_of_relay_log.inc
--source include/end_include_file.inc

Anon7 - 2022
AnonSec Team