Server IP : 172.67.216.182 / Your IP : 172.70.208.134 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 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 : ON Directory : /www/server/mysql/src/mysql-test/suite/binlog/t/ |
Upload File : |
############################################################################### # Bug#24609402 MYSQLBINLOG --RAW DOES NOT GET ALL LATEST EVENTS # # Problem: When mysqlbinlog is used with --raw option, output file # is not getting flushed till the process is completed. # With --stop-never option (mysqlbinlog process never completes), # output file will never contain any event. # # Steps to reproduce: # 1) Execute some dummy statements(a create and an insert). # 2) Execute MYSQL_BINLOG with --stop-never and --raw option # and backup the binlog content. # 3) Wait till server dump thread transfers all the data. # 4) Copy binary log file that is downloaded till now before # stopping dump thread that is serving mysqlbinlog # --stop-never process. # 5) kill the dump thread (serving the mysqlbinlog process). # 6) Clean up the data on the server (a drop and a reset). # 7) Apply binlog content (binlog from Step-2). # 8) Check that table and the data in it exists (data from step-1). # 9) Cleanup the server. ############################################################################### # Running MYSQL_BINLOG in a separate shell does not work properly in windows # due to MTR limitation. --source include/not_windows.inc # Test is not specific to any binlog format. Hence Running only for 'row'. --source include/have_binlog_format_row.inc # binlog file name is needed in the test. To use master-bin.000001, # RESET MASTER is needed. RESET MASTER; # kill the dump threads if there any dump threads (may be from previous test) --source include/stop_dump_threads.inc --echo # Step-1: Execute some dummy statements. CREATE TABLE t1(i int); INSERT INTO t1 values (1); --echo # Step-2: Execute MYSQL_BINLOG with --stop-never and --raw option. --write_file $MYSQL_TMP_DIR/mysqlbinlog_raw.sh #!/bin/bash (`$MYSQL_BINLOG --raw --read-from-remote-server --stop-never --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQL_TMP_DIR/ master-bin.000001`) < /dev/null > /dev/null 2>&1 & EOF --chmod 0755 $MYSQL_TMP_DIR/mysqlbinlog_raw.sh --exec $MYSQL_TMP_DIR/mysqlbinlog_raw.sh --echo # Step-3: Wait till dump thread transfer is completed. let $wait_condition= SELECT id from information_schema.processlist where processlist.command like '%Binlog%' and state like '%Master has sent%'; --source include/wait_condition.inc --echo # Step-4: copy binary log file that is downloaded till now before --echo # stopping dump thread that is serving mysqlbinlog --echo # --stop-never process. --copy_file $MYSQL_TMP_DIR/master-bin.000001 $MYSQL_TMP_DIR/master-bin-back_up_file.000001 --echo # Step-5: kill the dump thread serving the mysqlbinlog --stop-never process --source include/stop_dump_threads.inc --echo # Step-6: Cleanup the data, so that it is ready for reapply. DROP TABLE t1; RESET MASTER; --echo # Step-7: Apply the data that we got from --stop-never process. --exec $MYSQL_BINLOG $MYSQL_TMP_DIR/master-bin-back_up_file.000001 | $MYSQL --user=root --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT --echo # Step-8: Check that the data is there. --let $assert_text= Check the table t1 exists and contains one tuple with value 1. --let $assert_cond= [SELECT COUNT(*) AS Val FROM t1 WHERE i = 1, Val, 1] = 1 --source include/assert.inc --echo # Step-9: Cleanup DROP TABLE t1; --remove_file $MYSQL_TMP_DIR/mysqlbinlog_raw.sh --remove_file $MYSQL_TMP_DIR/master-bin.000001 --remove_file $MYSQL_TMP_DIR/master-bin-back_up_file.000001